Revert "[android] Set/unset g_hasContext variable when opengl context is available/not available. @TODO make it more clear and simple, e.g. move to Framework"
This reverts commit 8f32824b9fb46f3462232bfb1702d0a1d3982dfc.
This commit is contained in:
parent
a5dc6d3d47
commit
6ef728c659
3 changed files with 4 additions and 13 deletions
|
@ -23,14 +23,6 @@
|
|||
|
||||
extern android::Framework * g_framework;
|
||||
|
||||
namespace yg
|
||||
{
|
||||
namespace gl
|
||||
{
|
||||
extern bool g_hasContext;
|
||||
}
|
||||
}
|
||||
|
||||
namespace android
|
||||
{
|
||||
|
||||
|
@ -42,7 +34,6 @@ Framework & GetFramework()
|
|||
|
||||
Framework::Framework()
|
||||
{
|
||||
yg::gl::g_hasContext = false;
|
||||
// @TODO refactor storage
|
||||
m_work.Storage().ReInitCountries(false);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace yg
|
|||
{
|
||||
namespace gl
|
||||
{
|
||||
extern bool g_hasContext;
|
||||
extern bool g_doDeleteOnDestroy;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ Java_com_mapswithme_maps_SmartGLSurfaceView_nativeBind(JNIEnv * env, jobject thi
|
|||
{
|
||||
if (isBound)
|
||||
{
|
||||
yg::gl::g_hasContext = true;
|
||||
yg::gl::g_doDeleteOnDestroy = true;
|
||||
g_requestRenderMethodID = jni::GetJavaMethodID(env, thiz, "requestRender", "()V");
|
||||
ASSERT(g_requestRenderMethodID, ("Can't find method void com/mapswithme/maps/SmartGLSurfaceView.requestRender()"));
|
||||
|
||||
|
@ -30,7 +30,7 @@ Java_com_mapswithme_maps_SmartGLSurfaceView_nativeBind(JNIEnv * env, jobject thi
|
|||
}
|
||||
else
|
||||
{
|
||||
yg::gl::g_hasContext = false;
|
||||
yg::gl::g_doDeleteOnDestroy = false;
|
||||
jobject refToDelete = g_smartGLSurfaceView;
|
||||
g_smartGLSurfaceView = 0;
|
||||
env->DeleteGlobalRef(refToDelete);
|
||||
|
|
|
@ -55,7 +55,6 @@ public class SmartGLSurfaceView extends GLSurfaceView
|
|||
public void surfaceCreated (SurfaceHolder holder)
|
||||
{
|
||||
Log.d(TAG, "surfaceCreated");
|
||||
nativeBind(true);
|
||||
m_renderer.m_isBaseSurfaceReady = false;
|
||||
super.surfaceCreated(holder);
|
||||
}
|
||||
|
@ -67,6 +66,7 @@ public class SmartGLSurfaceView extends GLSurfaceView
|
|||
m_renderer.m_isBaseSurfaceReady = true;
|
||||
super.surfaceChanged(holder, format, w, h);
|
||||
queueEvent(m_tryToLoadResourcesIfReady);
|
||||
nativeBind(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Reference in a new issue