Bug 1030523 - Back out cset 038356d89dc2 so we properly initialize the compositor when we get a surface. r=snorp
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 14 Oct 2014 14:52:05 -0400
changeset 210295 7246195fb751da0975f4a5abff617ff42e2ba712
parent 210294 1a5153ae014fcc6025e11e38bd6628df1c5d26b3
child 210296 cb55300789e1dd8aea8e61a6d7e22c64299f06ed
child 210324 c76eb2abb768775a1300591b6fd18f38f65ca1b3
push id9359
push userkgupta@mozilla.com
push dateTue, 14 Oct 2014 18:54:35 +0000
treeherderfx-team@7246195fb751 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1030523
milestone36.0a1
Bug 1030523 - Back out cset 038356d89dc2 so we properly initialize the compositor when we get a surface. r=snorp
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
@@ -196,20 +196,16 @@ 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;
         }
 
         // This join() should not be necessary, but makes this code a bit easier to think about.
         // The EGLPreloadingThread should long be done by now, and even if it's not,
         // it shouldn't be a problem to be initalizing EGL from two different threads.
--- a/mobile/android/base/gfx/LayerView.java
+++ b/mobile/android/base/gfx/LayerView.java
@@ -471,23 +471,18 @@ 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.isCompositorCreated()) {
-            return;
-        }
-
-        surfaceChanged(width, height);
-
-        if (mSurfaceView == null) {
+        if (!mGLController.isServerSurfaceValid() || mSurfaceView == null) {
+            surfaceChanged(width, height);
             return;
         }
 
         if (mListener != null) {
             mListener.sizeChanged(width, height);
         }
 
         if (mOverscroll != null) {