Make surfaceRedrawNeeded forgiving

Fixes: 27071678

It's semi-common for apps to not realize surfaceRedrawNeeded
is a callback they can (and should) be handling, so have it be
more tolerant in lifecycle handling.

Specifically allow a renderer to have not yet been set on
GLSurfaceView, even though it was supposed to have been set already.
Apps are overriding the other lifecycle methods that require this
(created, changed, an destroyed) but not noticing this method.

Change-Id: I6cebca541eeec6e9949bdb55f687b095768a17b2
This commit is contained in:
John Reck
2016-04-18 13:26:48 -07:00
parent 7d0b8d7928
commit fd3cee138e

View File

@@ -547,7 +547,9 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
*/
@Override
public void surfaceRedrawNeeded(SurfaceHolder holder) {
mGLThread.requestRenderAndWait();
if (mGLThread != null) {
mGLThread.requestRenderAndWait();
}
}