diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-07 12:45:35 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-06-13 10:18:43 -0700 |
commit | 0b687312071305c050d97e04fef1c80193f443c5 (patch) | |
tree | 64c20efaa17fefef9f902811a000fd6e425c849b /src/mbgl/text | |
parent | 92252849c1a2ddf7887d1908841fa3c90dd59766 (diff) | |
download | qtlocation-mapboxgl-0b687312071305c050d97e04fef1c80193f443c5.tar.gz |
[core] Per-bucket icon atlases
Diffstat (limited to 'src/mbgl/text')
-rw-r--r-- | src/mbgl/text/quads.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/text/shaping.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/text/shaping.hpp | 13 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/mbgl/text/quads.cpp b/src/mbgl/text/quads.cpp index ad57342b82..81827ca32e 100644 --- a/src/mbgl/text/quads.cpp +++ b/src/mbgl/text/quads.cpp @@ -22,7 +22,7 @@ SymbolQuad getIconQuad(const Anchor& anchor, const float layoutTextSize, const style::SymbolPlacementType placement, const Shaping& shapedText) { - const SpriteAtlasElement& image = shapedIcon.image(); + const ImagePosition& image = shapedIcon.image(); // If you have a 10px icon that isn't perfectly aligned to the pixel grid it will cover 11 actual // pixels. The quad needs to be padded to account for this, otherwise they'll look slightly clipped diff --git a/src/mbgl/text/shaping.cpp b/src/mbgl/text/shaping.cpp index 0ef347ba0b..338abe2e43 100644 --- a/src/mbgl/text/shaping.cpp +++ b/src/mbgl/text/shaping.cpp @@ -10,7 +10,7 @@ namespace mbgl { -PositionedIcon PositionedIcon::shapeIcon(const SpriteAtlasElement& image, const std::array<float, 2>& iconOffset, const float iconRotation) { +PositionedIcon PositionedIcon::shapeIcon(const ImagePosition& image, const std::array<float, 2>& iconOffset, const float iconRotation) { float dx = iconOffset[0]; float dy = iconOffset[1]; float x1 = dx - image.displaySize()[0] / 2.0f; diff --git a/src/mbgl/text/shaping.hpp b/src/mbgl/text/shaping.hpp index 1984b14e1d..ca475e2a6c 100644 --- a/src/mbgl/text/shaping.hpp +++ b/src/mbgl/text/shaping.hpp @@ -1,30 +1,29 @@ #pragma once #include <mbgl/text/glyph.hpp> -#include <mbgl/sprite/sprite_atlas.hpp> +#include <mbgl/renderer/image_atlas.hpp> namespace mbgl { -class SpriteAtlasElement; class SymbolFeature; class BiDi; class PositionedIcon { private: - PositionedIcon(const SpriteAtlasElement& image_, + PositionedIcon(ImagePosition image_, float top_, float bottom_, float left_, float right_, float angle_) - : _image(image_), + : _image(std::move(image_)), _top(top_), _bottom(bottom_), _left(left_), _right(right_), _angle(angle_) {} - SpriteAtlasElement _image; + ImagePosition _image; float _top; float _bottom; float _left; @@ -32,9 +31,9 @@ private: float _angle; public: - static PositionedIcon shapeIcon(const SpriteAtlasElement&, const std::array<float, 2>& iconOffset, const float iconRotation); + static PositionedIcon shapeIcon(const ImagePosition&, const std::array<float, 2>& iconOffset, const float iconRotation); - const SpriteAtlasElement& image() const { return _image; } + const ImagePosition& image() const { return _image; } float top() const { return _top; } float bottom() const { return _bottom; } float left() const { return _left; } |