Bug 704114 - Fix missing texture crash [r=pcwalton]
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 21 Nov 2011 12:17:24 -0500
changeset 83558 2b458bfe5a17d7436b2ac961467a649173f96dce
parent 83557 6e07405e7c5098c956d29103bebf6aec5bc193d4
child 83559 448027be3bae3144981a5f2e0face0b8ea87d789
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspcwalton
bugs704114
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 704114 - Fix missing texture crash [r=pcwalton] During startup there is a race condition where the LayerRenderer might request a paint of the root layer before the root layer has successfully generated a texture. This might happen if the transaction lock is already held when the root layer attempts to generate the texture. Fix by inserting a null guard that aborts the paint if the texture has not been generated.
mobile/android/base/gfx/TileLayer.java
--- a/mobile/android/base/gfx/TileLayer.java
+++ b/mobile/android/base/gfx/TileLayer.java
@@ -91,17 +91,19 @@ public abstract class TileLayer extends 
      * Subclasses implement this method to perform tile drawing.
      *
      * Invariant: The current matrix mode must be GL_MODELVIEW both before and after this call.
      */
     protected abstract void onTileDraw(GL10 gl);
 
     @Override
     protected void onDraw(GL10 gl) {
-        if (mImage == null)
+        // mTextureIDs may be null here during startup if Layer.java's draw method
+        // failed to acquire the transaction lock and call performUpdates.
+        if (mImage == null || mTextureIDs == null)
             return;
 
         gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
         gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
         gl.glPushMatrix();
 
         onTileDraw(gl);