Fix incorrect rendering after orientation change.
authorAli Juma <ajuma@mozilla.com>
Wed, 08 Feb 2012 16:09:10 -0500
changeset 89098 dbce328867a2e7a7188065eb7e187193ad4ce859
parent 89095 b067db598cdd5941d64b165bc599caa09151bf9f
child 89102 841821abc30a7e9c4b53edb8087e014f3e6e3e42
push id22242
push userkgupta@mozilla.com
push dateWed, 14 Mar 2012 15:19:09 +0000
treeherdermozilla-central@936ef50fa498 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone12.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
Fix incorrect rendering after orientation change.
mobile/android/base/gfx/FlexibleGLSurfaceView.java
mobile/android/base/gfx/GeckoGLLayerClient.java
--- a/mobile/android/base/gfx/FlexibleGLSurfaceView.java
+++ b/mobile/android/base/gfx/FlexibleGLSurfaceView.java
@@ -152,18 +152,17 @@ public class FlexibleGLSurfaceView exten
     public synchronized void surfaceChanged(SurfaceHolder holder, int format, int width,
                                             int height) {
         mController.sizeChanged(width, height);
         if (mGLThread != null) {
             mGLThread.surfaceChanged(width, height);
         }
         
         if (mListener != null) {
-            mListener.compositionResumeRequested();
-            mListener.renderRequested();
+            mListener.surfaceChanged(width, height);
         }
     }
 
     public synchronized void surfaceCreated(SurfaceHolder holder) {
         mController.surfaceCreated();
         if (mGLThread != null) {
             mGLThread.surfaceCreated();
         }
@@ -198,16 +197,17 @@ public class FlexibleGLSurfaceView exten
             return null;
         }
     }
 
     public interface Listener {
         void renderRequested();
         void compositionPauseRequested();
         void compositionResumeRequested();
+        void surfaceChanged(int width, int height);
     }
 
     public static class FlexibleGLSurfaceViewException extends RuntimeException {
         public static final long serialVersionUID = 1L;
 
         FlexibleGLSurfaceViewException(String e) {
             super(e);
         }
--- a/mobile/android/base/gfx/GeckoGLLayerClient.java
+++ b/mobile/android/base/gfx/GeckoGLLayerClient.java
@@ -198,10 +198,18 @@ public class GeckoGLLayerClient extends 
         Log.e(LOGTAG, "### Scheduling PauseComposition");
         GeckoAppShell.schedulePauseComposition();
     }
 
     public void compositionResumeRequested() {
         Log.e(LOGTAG, "### Scheduling ResumeComposition");
         GeckoAppShell.scheduleResumeComposition();
     }
+
+    public void surfaceChanged(int width, int height) {
+        compositionPauseRequested();
+        LayerController layerController = getLayerController();
+        layerController.setViewportSize(new FloatSize(width, height));
+        compositionResumeRequested();
+        renderRequested();
+    }
 }