From d1e69c8bafec2b799fae441be17b79c3566baac3 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Tue, 19 Sep 2017 10:56:47 +0300 Subject: [android] CustomLayer - optionally accept a context lost callback function --- platform/android/src/style/layers/custom_layer.cpp | 5 +++-- platform/android/src/style/layers/custom_layer.hpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'platform/android/src') diff --git a/platform/android/src/style/layers/custom_layer.cpp b/platform/android/src/style/layers/custom_layer.cpp index e6321a8efa..51a48520bf 100644 --- a/platform/android/src/style/layers/custom_layer.cpp +++ b/platform/android/src/style/layers/custom_layer.cpp @@ -7,11 +7,12 @@ namespace mbgl { namespace android { - CustomLayer::CustomLayer(jni::JNIEnv& env, jni::String layerId, jni::jlong initializeFunction, jni::jlong renderFunction, jni::jlong deinitializeFunction, jni::jlong context) + CustomLayer::CustomLayer(jni::JNIEnv& env, jni::String layerId, jni::jlong initializeFunction, jni::jlong renderFunction, jni::jlong contextLostFunction, jni::jlong deinitializeFunction, jni::jlong context) : Layer(env, std::make_unique( jni::Make(env, layerId), reinterpret_cast(initializeFunction), reinterpret_cast(renderFunction), + reinterpret_cast(contextLostFunction), reinterpret_cast(deinitializeFunction), reinterpret_cast(context)) ) { @@ -52,7 +53,7 @@ namespace android { // Register the peer jni::RegisterNativePeer( env, CustomLayer::javaClass, "nativePtr", - std::make_unique, + std::make_unique, "initialize", "finalize", METHOD(&CustomLayer::update, "nativeUpdate")); diff --git a/platform/android/src/style/layers/custom_layer.hpp b/platform/android/src/style/layers/custom_layer.hpp index 3e3f3bf77f..9e079c1288 100644 --- a/platform/android/src/style/layers/custom_layer.hpp +++ b/platform/android/src/style/layers/custom_layer.hpp @@ -16,7 +16,7 @@ public: static void registerNative(jni::JNIEnv&); - CustomLayer(jni::JNIEnv&, jni::String, jni::jlong, jni::jlong, jni::jlong, jni::jlong); + CustomLayer(jni::JNIEnv&, jni::String, jni::jlong, jni::jlong, jni::jlong, jni::jlong, jni::jlong); CustomLayer(mbgl::Map&, mbgl::style::CustomLayer&); -- cgit v1.2.1