Bug 664996 - After quitting the application by tapping the Home button, re-entering it will show a white. Regression from bug 661843. r=dougt
authorChris Lord <chrislord.net@gmail.com>
Fri, 17 Jun 2011 08:57:46 -0700
changeset 71278 0839c57106a8351290736b54f22b416942e96d28
parent 71277 83bc8f147fa0b96b4b6dadeceb9a49c3f62cca3d
child 71279 de3b70528526cc163059a7398cc96aaf399c7b0b
push idunknown
push userunknown
push dateunknown
reviewersdougt
bugs664996, 661843
milestone7.0a1
Bug 664996 - After quitting the application by tapping the Home button, re-entering it will show a white. Regression from bug 661843. r=dougt
embedding/android/GeckoSurfaceView.java
--- a/embedding/android/GeckoSurfaceView.java
+++ b/embedding/android/GeckoSurfaceView.java
@@ -171,25 +171,28 @@ class GeckoSurfaceView
             drawSplashScreen(holder, width, height);
         mSurfaceLock.lock();
 
         try {
             if (mInDrawing) {
                 Log.w("GeckoAppJava", "surfaceChanged while mInDrawing is true!");
             }
 
+            boolean invalidSize = false;
+
             if (width == 0 || height == 0) {
                 mSoftwareBitmap = null;
                 mSoftwareBuffer = null;
                 mSoftwareBufferCopy = null;
+                invalidSize = true;
             }
 
             boolean doSyncDraw =
                 mDrawMode == DRAW_2D &&
-                (mSoftwareBitmap != null || mSoftwareBuffer != null) &&
+                !invalidSize &&
                 GeckoApp.checkLaunchState(GeckoApp.LaunchState.GeckoRunning);
             mSyncDraw = doSyncDraw;
 
             mFormat = format;
             mWidth = width;
             mHeight = height;
             mSurfaceValid = true;
 
@@ -197,17 +200,17 @@ class GeckoSurfaceView
 
             DisplayMetrics metrics = new DisplayMetrics();
             GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
 
             GeckoEvent e = new GeckoEvent(GeckoEvent.SIZE_CHANGED, width, height,
                                           metrics.widthPixels, metrics.heightPixels);
             GeckoAppShell.sendEventToGecko(e);
 
-            if (mSoftwareBitmap != null || mSoftwareBuffer != null)
+            if (!invalidSize)
                 GeckoAppShell.scheduleRedraw();
 
             if (!doSyncDraw) {
                 if (mDrawMode == DRAW_GLES_2 || mShowingSplashScreen)
                     return;
                 Canvas c = holder.lockCanvas();
                 c.drawARGB(255, 255, 255, 255);
                 holder.unlockCanvasAndPost(c);