From ab0f5b1d5ad31a9f7e0329f5c6ce19fc40803775 Mon Sep 17 00:00:00 2001 From: ExMix Date: Sat, 7 Feb 2015 21:04:48 +0300 Subject: [PATCH] [drape, android] deallocate system surface buffers. We use opengl back buffer --- .../jni/com/mapswithme/opengl/androidoglcontextfactory.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/android/jni/com/mapswithme/opengl/androidoglcontextfactory.cpp b/android/jni/com/mapswithme/opengl/androidoglcontextfactory.cpp index 05b7e193a7..00a03241e2 100644 --- a/android/jni/com/mapswithme/opengl/androidoglcontextfactory.cpp +++ b/android/jni/com/mapswithme/opengl/androidoglcontextfactory.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace android { @@ -165,6 +166,11 @@ bool AndroidOGLContextFactory::createWindowSurface() for (int i = 0; i < count; ++i) { EGLConfig currentConfig = configs[i]; + + EGLint format; + eglGetConfigAttrib(m_display, currentConfig, EGL_NATIVE_VISUAL_ID, &format); + ANativeWindow_setBuffersGeometry(m_nativeWindow, 0, 0, format); + EGLint surfaceAttributes[] = { EGL_RENDER_BUFFER, EGL_BACK_BUFFER, EGL_NONE }; m_windowSurface = eglCreateWindowSurface(m_display, currentConfig, m_nativeWindow, surfaceAttributes); if (m_windowSurface == EGL_NO_SURFACE)