diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-21 14:52:19 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-24 15:52:28 -0700 |
commit | 5dd98df50ba1210b1eef0d8d6655713a725f2995 (patch) | |
tree | b289bb3cbad5d1c3076816f4891a057d6089fc93 /platform/android | |
parent | 6f708ac5458fe332e25ca398431928b7ff5ba404 (diff) | |
download | qtlocation-mapboxgl-5dd98df50ba1210b1eef0d8d6655713a725f2995.tar.gz |
[all] Rationalize style::Image
A style has a collection of images, just as it has collections of sources and layers.
* Name things appropriately
* Use std::unique_ptr
Diffstat (limited to 'platform/android')
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 5418a9e42a..1e2464f1a0 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -25,7 +25,7 @@ #include <mbgl/util/logging.hpp> #include <mbgl/util/platform.hpp> #include <mbgl/util/projection.hpp> -#include <mbgl/sprite/sprite_image.hpp> +#include <mbgl/style/image.hpp> #include <mbgl/style/filter.hpp> // Java -> C++ conversion @@ -735,12 +735,12 @@ void NativeMapView::addAnnotationIcon(JNIEnv& env, jni::String symbol, jint w, j } jni::GetArrayRegion(env, *jpixels, 0, size, reinterpret_cast<jbyte*>(premultipliedImage.data.get())); - auto iconImage = std::make_shared<mbgl::SpriteImage>(std::move(premultipliedImage), float(scale)); - map->addAnnotationIcon(symbolName, iconImage); + map->addAnnotationImage(symbolName, + std::make_unique<mbgl::style::Image>(std::move(premultipliedImage), float(scale))); } jdouble NativeMapView::getTopOffsetPixelsForAnnotationSymbol(JNIEnv& env, jni::String symbolName) { - return map->getTopOffsetPixelsForAnnotationIcon(jni::Make<std::string>(env, symbolName)); + return map->getTopOffsetPixelsForAnnotationImage(jni::Make<std::string>(env, symbolName)); } jlong NativeMapView::getTransitionDuration(JNIEnv&) { @@ -1036,9 +1036,9 @@ void NativeMapView::addImage(JNIEnv& env, jni::String name, jni::jint w, jni::ji } jni::GetArrayRegion(env, *pixels, 0, size, reinterpret_cast<jbyte*>(premultipliedImage.data.get())); - auto spriteImage = std::make_unique<mbgl::SpriteImage>(std::move(premultipliedImage), float(scale)); - map->addImage(jni::Make<std::string>(env, name), std::move(spriteImage)); + map->addImage(jni::Make<std::string>(env, name), + std::make_unique<mbgl::style::Image>(std::move(premultipliedImage), float(scale))); } void NativeMapView::removeImage(JNIEnv& env, jni::String name) { |