Fix incorrect rendering after orientation change.
authorAli Juma <ajuma@mozilla.com>
Wed, 08 Feb 2012 16:09:10 -0500
changeset 90910 dbce328867a2e7a7188065eb7e187193ad4ce859
parent 90907 b067db598cdd5941d64b165bc599caa09151bf9f
child 90914 841821abc30a7e9c4b53edb8087e014f3e6e3e42
push idunknown
push userunknown
push dateunknown
milestone12.0a1
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();
+    }
 }