[android] extract RendererBackend from NativeMapView

This commit is contained in:
Ivo van Dongen
2017-07-20 14:19:31 +03:00
committed by Ivo van Dongen
parent c0544d8500
commit e780cdc29e
5 changed files with 109 additions and 106 deletions

View File

@@ -36,9 +36,10 @@
namespace mbgl {
namespace android {
class AndroidRendererBackend;
class AndroidRendererFrontend;
class NativeMapView : public RendererBackend, public MapObserver {
class NativeMapView : public MapObserver {
public:
static constexpr auto Name() { return "com/mapbox/mapboxsdk/maps/NativeMapView"; };
@@ -55,14 +56,6 @@ public:
virtual ~NativeMapView();
// mbgl::RendererBackend //
void bind() override;
mbgl::Size getFramebufferSize() const override;
void updateAssumedState() override;
// Deprecated //
void notifyMapChange(mbgl::MapChange);
@@ -263,13 +256,6 @@ public:
jni::jboolean getPrefetchesTiles(JNIEnv&);
protected:
// mbgl::RendererBackend //
gl::ProcAddress initializeExtension(const char*) override;
void activate() override;
void deactivate() override;
private:
void _initializeDisplay();
@@ -289,6 +275,7 @@ private:
private:
std::unique_ptr<AndroidRendererFrontend> rendererFrontend;
std::unique_ptr<AndroidRendererBackend> rendererBackend;
JavaVM *vm = nullptr;
jni::UniqueWeakObject<NativeMapView> javaPeer;
@@ -301,11 +288,6 @@ private:
EGLConfig config = nullptr;
EGLint format = -1;
EGLDisplay oldDisplay = EGL_NO_DISPLAY;
EGLSurface oldReadSurface = EGL_NO_SURFACE;
EGLSurface oldDrawSurface = EGL_NO_SURFACE;
EGLContext oldContext = EGL_NO_CONTEXT;
EGLDisplay display = EGL_NO_DISPLAY;
EGLSurface surface = EGL_NO_SURFACE;
EGLContext context = EGL_NO_CONTEXT;
@@ -320,8 +302,6 @@ private:
// Minimum texture size according to OpenGL ES 2.0 specification.
int width = 64;
int height = 64;
int fbWidth = 64;
int fbHeight = 64;
bool framebufferSizeChanged = true;