OSDN Git Service

Fix bug 2325244 screen turns black for a brief period of time
authorJack Palevich <jackpal@google.com>
Mon, 21 Dec 2009 06:47:35 +0000 (14:47 +0800)
committerJack Palevich <jackpal@google.com>
Tue, 22 Dec 2009 03:45:31 +0000 (11:45 +0800)
commit49c9a3a3d4e34aa3ff824e8f4536aa92c6bdc967
tree4031656f17122ddba889497129e3b057b3bacf85
parent11b97c50e6fb6d723e88eac3c125b60ca42184f7
Fix bug 2325244 screen turns black for a brief period of time

The problem was a black first frame when creating a surface, or a
garbage frame when the surface was resized.

The cause was lack of synchronization between the render thread and the
UI thread. The UI thread would typically return before the render thread
had a chance to draw its first frame.

The fix was to make the UI thread wait until at least one frame had been
rendered by the rendering thread.

The waiting is done in the surfaceChanged method because we know
that surfaceChanged will be called in both the surface created
and surface changed cases.
opengl/java/android/opengl/GLSurfaceView.java