summaryrefslogtreecommitdiff
path: root/opengl
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-04-18 13:26:48 -0700
committerJohn Reck <jreck@google.com>2016-04-18 13:26:48 -0700
commitfd3cee138e24f6fa84db89a936eb7381a8673fe9 (patch)
tree83c8e4b61e67cfb011a0cc10635a6a9a267fa7ba /opengl
parent7d0b8d792886b2ed5ff89ac6c2723fba9d44c7d4 (diff)
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
Diffstat (limited to 'opengl')
-rw-r--r--opengl/java/android/opengl/GLSurfaceView.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java
index f37ec58fbe26..38ed9321653d 100644
--- a/opengl/java/android/opengl/GLSurfaceView.java
+++ b/opengl/java/android/opengl/GLSurfaceView.java
@@ -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();
+ }
}