diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-11-25 13:49:12 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-11-25 15:57:37 -0800 |
commit | 1d33790dc06a1127e55753d123d55e6ec6e89713 (patch) | |
tree | 3db9915f722dada6375a273297647cc1b0c9df51 /platform/node | |
parent | ed5eb9edc1458692bf6ff71d5ec95a7d3400318f (diff) | |
download | qtlocation-mapboxgl-1d33790dc06a1127e55753d123d55e6ec6e89713.tar.gz |
[core] Fix image type of Map::renderStill
It's a premultiplied image. This implies that we were misusing encodePNG
in most cases, as we were passing premultiplied pixels which were then
interpreted as unmultiplied. I changed encodePNG to accept premultipled
pixels, and unpremultiply in the implementations.
Diffstat (limited to 'platform/node')
-rw-r--r-- | platform/node/src/node_map.cpp | 2 | ||||
-rw-r--r-- | platform/node/src/node_map.hpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp index 0ce7d9398b..d4c551d666 100644 --- a/platform/node/src/node_map.cpp +++ b/platform/node/src/node_map.cpp @@ -300,7 +300,7 @@ void NodeMap::startRender(std::unique_ptr<NodeMap::RenderOptions> options) { map->setBearing(options->bearing); map->setPitch(options->pitch); - map->renderStill([this](const std::exception_ptr eptr, mbgl::UnassociatedImage&& result) { + map->renderStill([this](const std::exception_ptr eptr, mbgl::PremultipliedImage&& result) { if (eptr) { error = std::move(eptr); uv_async_send(async); diff --git a/platform/node/src/node_map.hpp b/platform/node/src/node_map.hpp index 455d38e957..23cd3c9fab 100644 --- a/platform/node/src/node_map.hpp +++ b/platform/node/src/node_map.hpp @@ -49,7 +49,7 @@ public: std::unique_ptr<mbgl::Map> map; std::exception_ptr error; - mbgl::UnassociatedImage image; + mbgl::PremultipliedImage image; std::unique_ptr<Nan::Callback> callback; // Async for delivering the notifications of render completion. |