diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-07-03 22:32:03 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:19:42 +0300 |
commit | 68aa14d25318266a09cf9cc521f16c460181cfba (patch) | |
tree | 3fc303da9e622b0c74f3bc0c714da92c8ad97e56 /drape/texture.hpp | |
parent | 8570a0a9e1d77e7c54a134c045bbb49fda06481b (diff) |
[drape] texture manager refactoring. ResourceInfo based search.
Diffstat (limited to 'drape/texture.hpp')
-rw-r--r-- | drape/texture.hpp | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/drape/texture.hpp b/drape/texture.hpp index e7eeb5b3c5..94cffdc21a 100644 --- a/drape/texture.hpp +++ b/drape/texture.hpp @@ -6,6 +6,7 @@ #include "../geometry/rect2d.hpp" #include "../std/stdint.hpp" +#include "../std/function.hpp" class Texture { @@ -17,17 +18,29 @@ public: ALPHA }; + enum ResourceType + { + Symbol, + Glyph, + UniformValue + }; + class Key { public: - enum Type - { - Symbol, - Font, - UniformValue - }; - - virtual Type GetType() const = 0; + virtual ResourceType GetType() const = 0; + }; + + class ResourceInfo + { + public: + ResourceInfo(m2::RectF const & texRect); + + virtual ResourceType GetType() const = 0; + m2::RectF const & GetTexRect() const; + + private: + m2::RectF m_texRect; }; Texture(); @@ -41,7 +54,7 @@ public: void UploadData(uint32_t x, uint32_t y, uint32_t width, uint32_t height, TextureFormat format, RefPointer<void> data); - virtual bool FindResource(Key const & key, m2::RectF & texRect, m2::PointU & pixelSize) const = 0; + virtual ResourceInfo const * FindResource(Key const & key) const = 0; uint32_t GetWidth() const; uint32_t GetHeight() const; |