| 30 | class HWTextureAllocator; |
| 31 | |
| 32 | class TextureManager |
| 33 | { |
| 34 | public: |
| 35 | class BaseRegion |
| 36 | { |
| 37 | public: |
| 38 | BaseRegion(); |
| 39 | void SetResourceInfo(ref_ptr<Texture::ResourceInfo> info); |
| 40 | void SetTexture(ref_ptr<Texture> texture); |
| 41 | ref_ptr<Texture> GetTexture() const { return m_texture; } |
| 42 | bool IsValid() const; |
| 43 | |
| 44 | m2::PointF GetPixelSize() const; |
| 45 | float GetPixelHeight() const; |
| 46 | m2::RectF const & GetTexRect() const; |
| 47 | |
| 48 | protected: |
| 49 | ref_ptr<Texture::ResourceInfo> m_info; |
| 50 | ref_ptr<Texture> m_texture; |
| 51 | }; |
| 52 | |
| 53 | class SymbolRegion : public BaseRegion |
| 54 | { |
| 55 | public: |
| 56 | uint32_t GetTextureIndex() const { return m_textureIndex; } |
| 57 | void SetTextureIndex(uint32_t index) { m_textureIndex = index; } |
| 58 | |
| 59 | private: |
| 60 | uint32_t m_textureIndex = 0; |
| 61 | }; |
| 62 | |
| 63 | using GlyphRegion = BaseRegion; |
| 64 | |
| 65 | class StippleRegion : public BaseRegion |
| 66 | { |
| 67 | public: |
| 68 | m2::PointU GetMaskPixelSize() const; |
| 69 | }; |
| 70 | |
| 71 | using ColorRegion = BaseRegion; |
| 72 | |
| 73 | struct Params |
| 74 | { |
| 75 | std::string m_resPostfix; |
| 76 | double m_visualScale = 1.0; |
| 77 | std::string m_colors; |
| 78 | std::string m_patterns; |
| 79 | GlyphManager::Params m_glyphMngParams; |
| 80 | std::string m_arrowTexturePath; // maybe empty if no custom texture |
| 81 | bool m_arrowTextureUseDefaultResourceFolder = false; |
| 82 | }; |
| 83 | |
| 84 | TextureManager(); |
| 85 | void Release(); |
| 86 | |
| 87 | void Init(ref_ptr<dp::GraphicsContext> context, Params const & params); |
| 88 | void OnSwitchMapStyle(ref_ptr<dp::GraphicsContext> context); |
| 89 | void OnVisualScaleChanged(ref_ptr<dp::GraphicsContext> context, Params const & params); |
nothing calls this directly
no test coverage detected