summaryrefslogtreecommitdiff
path: root/platform/android/src/snapshotter/map_snapshot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/snapshotter/map_snapshot.cpp')
-rw-r--r--platform/android/src/snapshotter/map_snapshot.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/android/src/snapshotter/map_snapshot.cpp b/platform/android/src/snapshotter/map_snapshot.cpp
index d626ae68b7..1650f72dc7 100644
--- a/platform/android/src/snapshotter/map_snapshot.cpp
+++ b/platform/android/src/snapshotter/map_snapshot.cpp
@@ -16,18 +16,18 @@ MapSnapshot::MapSnapshot(float pixelRatio_, MapSnapshot::PointForFn pointForFn_,
MapSnapshot::~MapSnapshot() = default;
-jni::Object<PointF> MapSnapshot::pixelForLatLng(jni::JNIEnv& env, jni::Object<LatLng> jLatLng) {
+jni::Local<jni::Object<PointF>> MapSnapshot::pixelForLatLng(jni::JNIEnv& env, jni::Object<LatLng>& jLatLng) {
ScreenCoordinate point = pointForFn(LatLng::getLatLng(env, jLatLng));
return PointF::New(env, point.x * pixelRatio, point.y * pixelRatio);
}
-jni::Object<LatLng> MapSnapshot::latLngForPixel(jni::JNIEnv& env, jni::Object<PointF>jPoint) {
+jni::Local<jni::Object<LatLng>> MapSnapshot::latLngForPixel(jni::JNIEnv& env, jni::Object<PointF>& jPoint) {
return LatLng::New(env, latLngForFn(PointF::getScreenCoordinate(env, jPoint)));
}
// Static methods //
-jni::Object<MapSnapshot> MapSnapshot::New(JNIEnv& env,
+jni::Local<jni::Object<MapSnapshot>> MapSnapshot::New(JNIEnv& env,
PremultipliedImage&& image,
float pixelRatio,
std::vector<std::string> attributions,
@@ -38,7 +38,7 @@ jni::Object<MapSnapshot> MapSnapshot::New(JNIEnv& env,
auto bitmap = Bitmap::CreateBitmap(env, std::move(image));
// Create the Mapsnapshot peers
- static auto javaClass = jni::Class<MapSnapshot>::Singleton(env);
+ static auto& javaClass = jni::Class<MapSnapshot>::Singleton(env);
static auto constructor = javaClass.GetConstructor<jni::jlong, jni::Object<Bitmap>, jni::Array<jni::String>, jni::jboolean>(env);
auto nativePeer = std::make_unique<MapSnapshot>(pixelRatio, pointForFn, latLngForFn);
return javaClass.New(env, constructor, reinterpret_cast<jlong>(nativePeer.release()), bitmap, conversion::toArray(env, attributions), (jni::jboolean) showLogo);
@@ -46,7 +46,7 @@ jni::Object<MapSnapshot> MapSnapshot::New(JNIEnv& env,
void MapSnapshot::registerNative(jni::JNIEnv& env) {
// Lookup the class
- static auto javaClass = jni::Class<MapSnapshot>::Singleton(env);
+ static auto& javaClass = jni::Class<MapSnapshot>::Singleton(env);
#define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name)