Remove Map::start/stop
Both Android and iOS now use pause/resume. The map thread is always running, and be able to receive messages. When paused, it will just refuse to render.
This commit is contained in:
@@ -256,20 +256,6 @@ void JNICALL nativeDestroySurface(JNIEnv *env, jobject obj, jlong nativeMapViewP
|
||||
nativeMapView->destroySurface();
|
||||
}
|
||||
|
||||
void JNICALL nativeStart(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
|
||||
mbgl::Log::Debug(mbgl::Event::JNI, "nativeStart");
|
||||
assert(nativeMapViewPtr != 0);
|
||||
NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
|
||||
nativeMapView->start();
|
||||
}
|
||||
|
||||
void JNICALL nativeStop(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
|
||||
mbgl::Log::Debug(mbgl::Event::JNI, "nativeStop");
|
||||
assert(nativeMapViewPtr != 0);
|
||||
NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);
|
||||
nativeMapView->stop();
|
||||
}
|
||||
|
||||
void JNICALL nativePause(JNIEnv *env, jobject obj, jlong nativeMapViewPtr) {
|
||||
mbgl::Log::Debug(mbgl::Event::JNI, "nativePause");
|
||||
assert(nativeMapViewPtr != 0);
|
||||
@@ -932,8 +918,6 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
{"nativeCreateSurface", "(JLandroid/view/Surface;)V",
|
||||
reinterpret_cast<void *>(&nativeCreateSurface)},
|
||||
{"nativeDestroySurface", "(J)V", reinterpret_cast<void *>(&nativeDestroySurface)},
|
||||
{"nativeStart", "(J)V", reinterpret_cast<void *>(&nativeStart)},
|
||||
{"nativeStop", "(J)V", reinterpret_cast<void *>(&nativeStop)},
|
||||
{"nativePause", "(J)V", reinterpret_cast<void *>(&nativePause)},
|
||||
{"nativeResume", "(J)V", reinterpret_cast<void *>(&nativeResume)},
|
||||
{"nativeUpdate", "(J)V", reinterpret_cast<void *>(&nativeUpdate)},
|
||||
|
||||
@@ -60,7 +60,7 @@ NativeMapView::NativeMapView(JNIEnv *env, jobject obj_)
|
||||
: mbgl::View(*this),
|
||||
fileCache(mbgl::android::cachePath + "/mbgl-cache.db"),
|
||||
fileSource(&fileCache),
|
||||
map(*this, fileSource) {
|
||||
map(*this, fileSource, MapMode::Continuous, true) {
|
||||
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::NativeMapView");
|
||||
|
||||
assert(env != nullptr);
|
||||
@@ -577,23 +577,6 @@ EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint numConfi
|
||||
return configId;
|
||||
}
|
||||
|
||||
void NativeMapView::start() {
|
||||
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::start");
|
||||
|
||||
if (display == EGL_NO_DISPLAY) {
|
||||
initializeDisplay();
|
||||
}
|
||||
|
||||
if (context == EGL_NO_CONTEXT) {
|
||||
initializeContext();
|
||||
}
|
||||
|
||||
assert(display != EGL_NO_DISPLAY);
|
||||
assert(context != EGL_NO_CONTEXT);
|
||||
|
||||
map.start(true);
|
||||
}
|
||||
|
||||
void loadExtensions() {
|
||||
const GLubyte *str = glGetString(GL_EXTENSIONS);
|
||||
if (str == nullptr) {
|
||||
@@ -690,14 +673,6 @@ void loadExtensions() {
|
||||
}
|
||||
}
|
||||
|
||||
void NativeMapView::stop() {
|
||||
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::stop");
|
||||
|
||||
if ((display != EGL_NO_DISPLAY) && (context != EGL_NO_CONTEXT)) {
|
||||
map.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void NativeMapView::pause(bool waitForPause) {
|
||||
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::pause %s",
|
||||
(waitForPause) ? "true" : "false");
|
||||
|
||||
Reference in New Issue
Block a user