| 23 | class StraightTextLayout; |
| 24 | |
| 25 | class TextShape : public MapShape |
| 26 | { |
| 27 | public: |
| 28 | TextShape(m2::PointD const & basePoint, TextViewParams const & params, TileKey const & tileKey, |
| 29 | m2::PointF const & symbolSize, m2::PointF const & symbolOffset, dp::Anchor symbolAnchor, |
| 30 | uint32_t textIndex); |
| 31 | |
| 32 | TextShape(m2::PointD const & basePoint, TextViewParams const & params, TileKey const & tileKey, |
| 33 | std::vector<m2::PointF> const & symbolSizes, m2::PointF const & symbolOffset, dp::Anchor symbolAnchor, |
| 34 | uint32_t textIndex); |
| 35 | |
| 36 | void Draw(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::Batcher> batcher, |
| 37 | ref_ptr<dp::TextureManager> textures) const override; |
| 38 | MapShapeType GetType() const override { return MapShapeType::OverlayType; } |
| 39 | |
| 40 | // Only for testing purposes! |
| 41 | void DisableDisplacing() { m_disableDisplacing = true; } |
| 42 | |
| 43 | private: |
| 44 | void DrawSubString(ref_ptr<dp::GraphicsContext> context, StraightTextLayout & layout, dp::FontDecl const & font, |
| 45 | glsl::vec2 const & baseOffset, ref_ptr<dp::Batcher> batcher, ref_ptr<dp::TextureManager> textures, |
| 46 | bool isPrimary, bool isOptional) const; |
| 47 | |
| 48 | void DrawSubStringPlain(ref_ptr<dp::GraphicsContext> context, StraightTextLayout const & layout, |
| 49 | dp::FontDecl const & font, ref_ptr<dp::Batcher> batcher, ref_ptr<dp::TextureManager> textures, |
| 50 | bool isPrimary, bool isOptional) const; |
| 51 | |
| 52 | void DrawSubStringOutlined(ref_ptr<dp::GraphicsContext> context, StraightTextLayout const & layout, |
| 53 | dp::FontDecl const & font, ref_ptr<dp::Batcher> batcher, |
| 54 | ref_ptr<dp::TextureManager> textures, bool isPrimary, bool isOptional) const; |
| 55 | |
| 56 | uint64_t GetOverlayPriority() const; |
| 57 | |
| 58 | m2::PointD m_basePoint; |
| 59 | TextViewParams m_params; |
| 60 | m2::PointI m_tileCoords; |
| 61 | std::vector<m2::PointF> m_symbolSizes; |
| 62 | dp::Anchor m_symbolAnchor; |
| 63 | m2::PointF m_symbolOffset; |
| 64 | uint32_t m_textIndex; |
| 65 | |
| 66 | bool m_disableDisplacing = false; |
| 67 | }; |
| 68 | } // namespace df |
no outgoing calls
no test coverage detected