From 8ae70105463db78699ef3743fb24503ed8feb054 Mon Sep 17 00:00:00 2001 From: Asheem Mamoowala Date: Tue, 11 Jul 2017 14:31:05 -0700 Subject: [core][ios][android][macos] Use premultiplied image directly for RasterTile and ImageSource, un-premultiply in the shader for blending --- src/mbgl/renderer/buckets/raster_bucket.cpp | 8 ++++---- src/mbgl/renderer/buckets/raster_bucket.hpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mbgl/renderer/buckets') diff --git a/src/mbgl/renderer/buckets/raster_bucket.cpp b/src/mbgl/renderer/buckets/raster_bucket.cpp index 61548ee333..8a2f1227a5 100644 --- a/src/mbgl/renderer/buckets/raster_bucket.cpp +++ b/src/mbgl/renderer/buckets/raster_bucket.cpp @@ -9,11 +9,11 @@ namespace mbgl { using namespace style; -RasterBucket::RasterBucket(UnassociatedImage&& image_) { - image = std::make_shared(std::move(image_)); +RasterBucket::RasterBucket(PremultipliedImage&& image_) { + image = std::make_shared(std::move(image_)); } -RasterBucket::RasterBucket(std::shared_ptr image_): image(image_) { +RasterBucket::RasterBucket(std::shared_ptr image_): image(image_) { } void RasterBucket::upload(gl::Context& context) { @@ -40,7 +40,7 @@ void RasterBucket::clear() { uploaded = false; } -void RasterBucket::setImage(std::shared_ptr image_) { +void RasterBucket::setImage(std::shared_ptr image_) { image = std::move(image_); texture = {}; uploaded = false; diff --git a/src/mbgl/renderer/buckets/raster_bucket.hpp b/src/mbgl/renderer/buckets/raster_bucket.hpp index e92e4b51f7..1b0d787bcd 100644 --- a/src/mbgl/renderer/buckets/raster_bucket.hpp +++ b/src/mbgl/renderer/buckets/raster_bucket.hpp @@ -13,8 +13,8 @@ namespace mbgl { class RasterBucket : public Bucket { public: - RasterBucket(UnassociatedImage&&); - RasterBucket(std::shared_ptr); + RasterBucket(PremultipliedImage&&); + RasterBucket(std::shared_ptr); void upload(gl::Context&) override; void render(Painter&, PaintParameters&, const RenderLayer&, const RenderTile&) override; void render(Painter& painter, @@ -24,8 +24,8 @@ public: bool hasData() const override; void clear(); - void setImage(std::shared_ptr); - std::shared_ptr image; + void setImage(std::shared_ptr); + std::shared_ptr image; optional texture; // Bucket specific vertices are used for Image Sources only -- cgit v1.2.1