Blind try to fix ANR timeout when app is restored from background
This commit is contained in:
@@ -904,6 +904,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
||||
mNeedStart = true;
|
||||
mSizeChanged = true;
|
||||
SwapBuffers();
|
||||
DrawLogo();
|
||||
SwapBuffers();
|
||||
|
||||
mRenderer.onDrawFrame(mGL);
|
||||
@@ -954,7 +955,9 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
||||
}
|
||||
while (needToWait()) {
|
||||
//Log.v("SDL", "GLSurfaceView_SDL::run(): paused");
|
||||
wait();
|
||||
try {
|
||||
wait(500);
|
||||
} catch(Exception e) { }
|
||||
}
|
||||
if (mDone) {
|
||||
return false;
|
||||
@@ -1115,6 +1118,14 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call
|
||||
return null;
|
||||
}
|
||||
|
||||
private void DrawLogo() {
|
||||
// TODO: draw some logo instead of making screen non-black
|
||||
mGL.glClearColor(0.0f, 0.5f, 0.7f, 1.0f);
|
||||
mGL.glClear(mGL.GL_COLOR_BUFFER_BIT | mGL.GL_DEPTH_BUFFER_BIT);
|
||||
mGL.glFlush();
|
||||
mGL.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
private boolean mDone;
|
||||
private boolean mPaused;
|
||||
private boolean mHasSurface;
|
||||
|
||||
Reference in New Issue
Block a user