diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-07-21 16:15:30 +0300 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-09-22 23:33:56 +0300 |
commit | 347d7c19c0a70f91252163b14e37583eea83fdd5 (patch) | |
tree | c46968ba9fb947be6b6387ab18b10a0fede35f59 /platform/android/src/native_map_view.hpp | |
parent | e780cdc29ee82459a75db5aba2e72c5536a2d1b0 (diff) | |
download | qtlocation-mapboxgl-347d7c19c0a70f91252163b14e37583eea83fdd5.tar.gz |
[android] async rendering
- introduces GLSurfaceView
- introduces Orchestration thread
- renders on the gl thread
Diffstat (limited to 'platform/android/src/native_map_view.hpp')
-rwxr-xr-x | platform/android/src/native_map_view.hpp | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp index 074906dbab..0539a29b46 100755 --- a/platform/android/src/native_map_view.hpp +++ b/platform/android/src/native_map_view.hpp @@ -36,7 +36,6 @@ namespace mbgl { namespace android { -class AndroidRendererBackend; class AndroidRendererFrontend; class NativeMapView : public MapObserver { @@ -78,18 +77,19 @@ public: // JNI // + // Called on OpenGL Thread + void onSurfaceCreated(jni::JNIEnv&); + + // Called on OpenGL Thread void render(jni::JNIEnv&); void update(jni::JNIEnv&); void resizeView(jni::JNIEnv&, int, int); + // Called on OpenGL Thread void resizeFramebuffer(jni::JNIEnv&, int, int); - void createSurface(jni::JNIEnv&, jni::Object<>); - - void destroySurface(jni::JNIEnv&); - jni::String getStyleUrl(jni::JNIEnv&); void setStyleUrl(jni::JNIEnv&, jni::String); @@ -257,25 +257,11 @@ public: jni::jboolean getPrefetchesTiles(JNIEnv&); private: - void _initializeDisplay(); - - void _terminateDisplay(); - - void _initializeContext(); - - void _terminateContext(); - - void _createSurface(ANativeWindow*); - - void _destroySurface(); - - EGLConfig chooseConfig(const EGLConfig configs[], EGLint numConfigs); void updateFps(); private: std::unique_ptr<AndroidRendererFrontend> rendererFrontend; - std::unique_ptr<AndroidRendererBackend> rendererBackend; JavaVM *vm = nullptr; jni::UniqueWeakObject<NativeMapView> javaPeer; @@ -283,28 +269,14 @@ private: std::string styleUrl; std::string apiKey; - ANativeWindow *window = nullptr; - - EGLConfig config = nullptr; - EGLint format = -1; - - EGLDisplay display = EGL_NO_DISPLAY; - EGLSurface surface = EGL_NO_SURFACE; - EGLContext context = EGL_NO_CONTEXT; - - float pixelRatio; bool fpsEnabled = false; - bool snapshot = false; - bool firstRender = true; double fps = 0.0; // Minimum texture size according to OpenGL ES 2.0 specification. int width = 64; int height = 64; - bool framebufferSizeChanged = true; - // Ensure these are initialised last std::shared_ptr<mbgl::ThreadPool> threadPool; std::unique_ptr<mbgl::Map> map; |