summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-12-10 11:48:12 +0100
committerAlexander Shalamov <alexander.shalamov@mapbox.com>2020-01-15 15:02:11 +0200
commitc80baa35b3e03bd0ef795e54bb6a83641627e9b0 (patch)
tree2e3e2185e7039da30952fe8b8328514058898809
parent47dc5727ab7e1b4b2d13540a0b4310e629668cfe (diff)
downloadqtlocation-mapboxgl-c80baa35b3e03bd0ef795e54bb6a83641627e9b0.tar.gz
[core] add stretches + content to ImagePosition
-rw-r--r--src/mbgl/renderer/image_atlas.cpp13
-rw-r--r--src/mbgl/renderer/image_atlas.hpp3
2 files changed, 8 insertions, 8 deletions
diff --git a/src/mbgl/renderer/image_atlas.cpp b/src/mbgl/renderer/image_atlas.cpp
index c9cedb3386..e38bd923ee 100644
--- a/src/mbgl/renderer/image_atlas.cpp
+++ b/src/mbgl/renderer/image_atlas.cpp
@@ -9,14 +9,11 @@ static constexpr uint32_t padding = 1;
ImagePosition::ImagePosition(const mapbox::Bin& bin, const style::Image::Impl& image, uint32_t version_)
: pixelRatio(image.pixelRatio),
- textureRect(
- bin.x + padding,
- bin.y + padding,
- bin.w - padding * 2,
- bin.h - padding * 2
- ),
- version(version_) {
-}
+ textureRect(bin.x + padding, bin.y + padding, bin.w - padding * 2, bin.h - padding * 2),
+ version(version_),
+ stretchX(image.stretchX),
+ stretchY(image.stretchY),
+ content(image.content) {}
const mapbox::Bin& _packImage(mapbox::ShelfPack& pack, const style::Image::Impl& image, ImageAtlas& resultImage, ImageType imageType) {
const mapbox::Bin& bin = *pack.packOne(-1,
diff --git a/src/mbgl/renderer/image_atlas.hpp b/src/mbgl/renderer/image_atlas.hpp
index e4d7d0f009..e5305b0e42 100644
--- a/src/mbgl/renderer/image_atlas.hpp
+++ b/src/mbgl/renderer/image_atlas.hpp
@@ -24,6 +24,9 @@ public:
float pixelRatio;
Rect<uint16_t> textureRect;
uint32_t version;
+ style::ImageStretches stretchX;
+ style::ImageStretches stretchY;
+ style::ImageContent content;
std::array<uint16_t, 2> tl() const {
return {{