[android] async rendering
- introduces GLSurfaceView - introduces Orchestration thread - renders on the gl thread
This commit is contained in:
committed by
Ivo van Dongen
parent
e780cdc29e
commit
347d7c19c0
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user