diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-13 16:05:26 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-14 16:28:12 -0600 |
commit | d819ece74c52658c68d4e297c9bef5a74f739e28 (patch) | |
tree | 3f5af4a976546db7b811522c62c5ab0b504837a2 /src/mbgl/sprite/sprite_atlas.hpp | |
parent | 58de1e15c5e3f4983f445eacefb2fcc931371788 (diff) | |
download | qtlocation-mapboxgl-d819ece74c52658c68d4e297c9bef5a74f739e28.tar.gz |
[core] Combine SpriteAtlas::getPosition with SpriteAtlas::getImage
Diffstat (limited to 'src/mbgl/sprite/sprite_atlas.hpp')
-rw-r--r-- | src/mbgl/sprite/sprite_atlas.hpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/mbgl/sprite/sprite_atlas.hpp b/src/mbgl/sprite/sprite_atlas.hpp index d839109a24..124d0ae294 100644 --- a/src/mbgl/sprite/sprite_atlas.hpp +++ b/src/mbgl/sprite/sprite_atlas.hpp @@ -23,21 +23,17 @@ namespace gl { class Context; } // namespace gl -class SpriteImage; -class SpritePosition; - -class SpriteAtlasPosition { -public: - std::array<float, 2> size = {{ 0, 0 }}; - std::array<float, 2> tl = {{ 0, 0 }}; - std::array<float, 2> br = {{ 0, 0 }}; -}; - class SpriteAtlasElement { public: + SpriteAtlasElement(Rect<uint16_t>, std::shared_ptr<const SpriteImage>, Size size, float pixelRatio); + Rect<uint16_t> pos; std::shared_ptr<const SpriteImage> spriteImage; + float relativePixelRatio; + std::array<float, 2> size; + std::array<float, 2> tl; + std::array<float, 2> br; }; enum class SpritePatternMode : bool { @@ -78,10 +74,6 @@ public: // the resulting icon measurements. If not, returns an empty optional. optional<SpriteAtlasElement> getImage(const std::string& name, SpritePatternMode mode); - // This function is used for getting the position during render time. - optional<SpriteAtlasPosition> getPosition(const std::string& name, - SpritePatternMode mode = SpritePatternMode::Single); - // Binds the atlas texture to the GPU, and uploads data if it is out of date. void bind(bool linear, gl::Context&, gl::TextureUnit unit); |