Bug 834243 - avoid calling serverSurfaceChanged before the compositor is created - r=vladv
authorBenoit Jacob <bjacob@mozilla.com>
Wed, 20 Nov 2013 17:50:54 -0500
changeset 156700 038356d89dc2dd0203965484044f1ab4971df9d3
parent 156699 c7214775e476f174dc5a98ad93280d12ff9e8812
child 156701 21dbf12887f3dddff0a43f23dca55ec10bceae85
push id25684
push usercbook@mozilla.com
push dateThu, 21 Nov 2013 13:21:05 +0000
treeherdermozilla-central@7427eede548f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvladv
bugs834243
milestone28.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 834243 - avoid calling serverSurfaceChanged before the compositor is created - r=vladv
mobile/android/base/gfx/GLController.java
mobile/android/base/gfx/LayerView.java
--- a/mobile/android/base/gfx/GLController.java
+++ b/mobile/android/base/gfx/GLController.java
@@ -148,16 +148,20 @@ public class GLController {
         // is blocked on the gecko sync event in updateCompositor() above
         mCompositorCreated = true;
     }
 
     public boolean isServerSurfaceValid() {
         return mServerSurfaceValid;
     }
 
+    public boolean isCompositorCreated() {
+        return mCompositorCreated;
+    }
+
     private void initEGL() {
         if (mEGL != null) {
             return;
         }
         mEGL = (EGL10)EGLContext.getEGL();
 
         mEGLDisplay = mEGL.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
         if (mEGLDisplay == EGL10.EGL_NO_DISPLAY) {
--- a/mobile/android/base/gfx/LayerView.java
+++ b/mobile/android/base/gfx/LayerView.java
@@ -509,18 +509,23 @@ public class LayerView extends FrameLayo
      * Gecko is also sent the new window size, and this will likely cause an
      * extra draw a few frames later, after it's re-rendered and caught up.
      *
      * In the case that there is no valid GL surface (for example, when
      * resuming, or when coming back from the awesomescreen), or we're using a
      * TextureView instead of a SurfaceView, the first phase is skipped.
      */
     private void onSizeChanged(int width, int height) {
-        if (!mGLController.isServerSurfaceValid() || mSurfaceView == null) {
-            surfaceChanged(width, height);
+        if (!mGLController.isCompositorCreated()) {
+            return;
+        }
+
+        surfaceChanged(width, height);
+
+        if (mSurfaceView == null) {
             return;
         }
 
         if (mListener != null) {
             mListener.sizeChanged(width, height);
         }
 
         mOverscroll.setSize(width, height);