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.
This commit is contained in:
Kartikaya Gupta 2011-11-21 12:17:24 -05:00
parent 3dda672274
commit 77f46817f9

View File

@ -96,7 +96,9 @@ public abstract class TileLayer extends Layer {
@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);