diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-05-22 15:56:05 +0200 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-06-26 10:32:06 -0700 |
commit | 84e2ea886dc55917a1d6b665337fff6d3862984a (patch) | |
tree | 75d7411f09f48aa8b35be9348bc3687cb4efb1f8 /android | |
parent | 740281cc89e99fbbedf07fcf62253ada84f60776 (diff) | |
download | qtlocation-mapboxgl-84e2ea886dc55917a1d6b665337fff6d3862984a.tar.gz |
drive map rendering from main thread
Diffstat (limited to 'android')
-rw-r--r-- | android/cpp/native_map_view.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/android/cpp/native_map_view.cpp b/android/cpp/native_map_view.cpp index 1d25442a55..845d10ea67 100644 --- a/android/cpp/native_map_view.cpp +++ b/android/cpp/native_map_view.cpp @@ -124,12 +124,16 @@ void NativeMapView::deactivate() { } } -void NativeMapView::invalidate(std::function<void()> render) { +void NativeMapView::invalidate() { mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::invalidate"); - if ((display != EGL_NO_DISPLAY) && (surface != EGL_NO_SURFACE)) { - render(); + // TODO: inform the main thread that it must call map->renderSync(); +} +void NativeMapView::swap() { + mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::invalidate"); + + if ((display != EGL_NO_DISPLAY) && (surface != EGL_NO_SURFACE)) { if (!eglSwapBuffers(display, surface)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglSwapBuffers() returned error %d", eglGetError()); |