summaryrefslogtreecommitdiff
path: root/test/api/annotations.cpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-11-24 10:07:18 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-11-25 15:57:36 -0800
commit0c1e378bc9555f6cf826bb38b1a36fa742f8ce9b (patch)
tree9aec8e4f475ff715645072503b3e0ec78f0573af /test/api/annotations.cpp
parent2de0a351a0635192bd05116cebdf0103c2638d05 (diff)
downloadqtlocation-mapboxgl-0c1e378bc9555f6cf826bb38b1a36fa742f8ce9b.tar.gz
[core] Rewrite image handling
* Consolidate Image and StillImage * Typecheck unassociated vs premultiplied images * Rewrite default platform image decoding implementation
Diffstat (limited to 'test/api/annotations.cpp')
-rw-r--r--test/api/annotations.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp
index 55f5ca6749..b16ec71ef6 100644
--- a/test/api/annotations.cpp
+++ b/test/api/annotations.cpp
@@ -4,7 +4,6 @@
#include <mbgl/annotation/shape_annotation.hpp>
#include <mbgl/sprite/sprite_image.hpp>
#include <mbgl/map/map.hpp>
-#include <mbgl/map/still_image.hpp>
#include <mbgl/platform/default/headless_display.hpp>
#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/storage/default_file_source.hpp>
@@ -17,13 +16,11 @@
using namespace mbgl;
std::string renderPNG(Map& map) {
- std::promise<std::unique_ptr<const StillImage>> promise;
- map.renderStill([&](std::exception_ptr, std::unique_ptr<const StillImage> image) {
+ std::promise<UnassociatedImage> promise;
+ map.renderStill([&](std::exception_ptr, UnassociatedImage&& image) {
promise.set_value(std::move(image));
});
-
- auto result = promise.get_future().get();
- return util::compress_png(result->width, result->height, result->pixels.get());
+ return encodePNG(promise.get_future().get());
}
TEST(Annotations, PointAnnotation) {