summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-03-24 15:43:08 +0100
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-04-28 14:32:20 -0400
commitb0a30943b45e6d8f28fac9407728d62dd7e33668 (patch)
tree6ce81014e300c84e489ff50f83cd04adfa31d0bf /android
parent9dc51e7f80f4ee1406be9743d671b28710274f7e (diff)
downloadqtlocation-mapboxgl-b0a30943b45e6d8f28fac9407728d62dd7e33668.tar.gz
move most private Map code to MapContext
Diffstat (limited to 'android')
-rw-r--r--android/cpp/jni.cpp10
-rw-r--r--android/cpp/native_map_view.cpp4
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java2
3 files changed, 3 insertions, 13 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp
index ac51884840..3f57b2df20 100644
--- a/android/cpp/jni.cpp
+++ b/android/cpp/jni.cpp
@@ -287,14 +287,7 @@ void JNICALL nativeUpdate(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
mbgl::Log::Debug(mbgl::Event::JNI, "nativeUpdate");
assert(nativeMapViewPtr != 0);
NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- nativeMapView->getMap().triggerUpdate();
-}
-
-void JNICALL nativeTerminate(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
- mbgl::Log::Debug(mbgl::Event::JNI, "nativeTerminate");
- assert(nativeMapViewPtr != 0);
- NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
- nativeMapView->getMap().terminate();
+ nativeMapView->getMap().update();
}
void JNICALL nativeResize(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jint width, jint height,
@@ -943,7 +936,6 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
{"nativePause", "(J)V", reinterpret_cast<void *>(&nativePause)},
{"nativeResume", "(J)V", reinterpret_cast<void *>(&nativeResume)},
{"nativeUpdate", "(J)V", reinterpret_cast<void *>(&nativeUpdate)},
- {"nativeTerminate", "(J)V", reinterpret_cast<void *>(&nativeTerminate)},
{"nativeResize", "(JIIFII)V",
reinterpret_cast<void *>(static_cast<void JNICALL (
*)(JNIEnv *, jobject, jlong, jint, jint, jfloat, jint, jint)>(&nativeResize))},
diff --git a/android/cpp/native_map_view.cpp b/android/cpp/native_map_view.cpp
index 39a777bff2..4e219bf521 100644
--- a/android/cpp/native_map_view.cpp
+++ b/android/cpp/native_map_view.cpp
@@ -121,11 +121,11 @@ void NativeMapView::deactivate() {
}
}
-void NativeMapView::invalidate() {
+void NativeMapView::invalidate(std::function<void()> render) {
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::invalidate");
if ((display != EGL_NO_DISPLAY) && (surface != EGL_NO_SURFACE)) {
- map.render();
+ render();
if (!eglSwapBuffers(display, surface)) {
mbgl::Log::Error(mbgl::Event::OpenGL, "eglSwapBuffers() returned error %d",
diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java
index 4dcd5ef8ed..c03306049b 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java
+++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxgl/views/NativeMapView.java
@@ -396,8 +396,6 @@ class NativeMapView {
private native void nativeUpdate(long nativeMapViewPtr);
- private native void nativeTerminate(long nativeMapViewPtr);
-
private native void nativeResize(long nativeMapViewPtr, int width,
int height, float ratio, int fbWidth, int fbHeight);