am e3449553: Merge change I49c9a3a3 into eclair
Merge commit 'e344955393133ac2f99f06cc6a4fe97fbf76f62e' into eclair-plus-aosp * commit 'e344955393133ac2f99f06cc6a4fe97fbf76f62e': Fix bug 2325244 screen turns black for a brief period of time
This commit is contained in:
@@ -999,6 +999,8 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
|
|||||||
GL10 gl = null;
|
GL10 gl = null;
|
||||||
boolean createEglSurface = false;
|
boolean createEglSurface = false;
|
||||||
boolean sizeChanged = false;
|
boolean sizeChanged = false;
|
||||||
|
boolean wantRenderNotification = false;
|
||||||
|
boolean doRenderNotification = false;
|
||||||
int w = 0;
|
int w = 0;
|
||||||
int h = 0;
|
int h = 0;
|
||||||
Runnable event = null;
|
Runnable event = null;
|
||||||
@@ -1044,6 +1046,13 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
|
|||||||
sGLThreadManager.notifyAll();
|
sGLThreadManager.notifyAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (doRenderNotification) {
|
||||||
|
wantRenderNotification = false;
|
||||||
|
doRenderNotification = false;
|
||||||
|
mRenderComplete = true;
|
||||||
|
sGLThreadManager.notifyAll();
|
||||||
|
}
|
||||||
|
|
||||||
// Ready to draw?
|
// Ready to draw?
|
||||||
if ((!mPaused) && mHasSurface
|
if ((!mPaused) && mHasSurface
|
||||||
&& (mWidth > 0) && (mHeight > 0)
|
&& (mWidth > 0) && (mHeight > 0)
|
||||||
@@ -1063,6 +1072,8 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
|
|||||||
sizeChanged = true;
|
sizeChanged = true;
|
||||||
w = mWidth;
|
w = mWidth;
|
||||||
h = mHeight;
|
h = mHeight;
|
||||||
|
wantRenderNotification = true;
|
||||||
|
|
||||||
if (DRAW_TWICE_AFTER_SIZE_CHANGED) {
|
if (DRAW_TWICE_AFTER_SIZE_CHANGED) {
|
||||||
// We keep mRequestRender true so that we draw twice after the size changes.
|
// We keep mRequestRender true so that we draw twice after the size changes.
|
||||||
// (Once because of mSizeChanged, the second time because of mRequestRender.)
|
// (Once because of mSizeChanged, the second time because of mRequestRender.)
|
||||||
@@ -1119,6 +1130,10 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
|
|||||||
Log.i("GLThread", "egl surface lost tid=" + getId());
|
Log.i("GLThread", "egl surface lost tid=" + getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wantRenderNotification) {
|
||||||
|
doRenderNotification = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
/*
|
/*
|
||||||
@@ -1201,7 +1216,20 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
|
|||||||
mHeight = h;
|
mHeight = h;
|
||||||
mSizeChanged = true;
|
mSizeChanged = true;
|
||||||
mRequestRender = true;
|
mRequestRender = true;
|
||||||
|
mRenderComplete = false;
|
||||||
sGLThreadManager.notifyAll();
|
sGLThreadManager.notifyAll();
|
||||||
|
|
||||||
|
// Wait for thread to react to resize and render a frame
|
||||||
|
while (! mExited && !mPaused && !mRenderComplete ) {
|
||||||
|
if (LOG_SURFACE) {
|
||||||
|
Log.i("Main thread", "onWindowResize waiting for render complete.");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
sGLThreadManager.wait();
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
Thread.currentThread().interrupt();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1247,6 +1275,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
|
|||||||
private int mHeight;
|
private int mHeight;
|
||||||
private int mRenderMode;
|
private int mRenderMode;
|
||||||
private boolean mRequestRender;
|
private boolean mRequestRender;
|
||||||
|
private boolean mRenderComplete;
|
||||||
private ArrayList<Runnable> mEventQueue = new ArrayList<Runnable>();
|
private ArrayList<Runnable> mEventQueue = new ArrayList<Runnable>();
|
||||||
// End of member variables protected by the sGLThreadManager monitor.
|
// End of member variables protected by the sGLThreadManager monitor.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user