Don't render while pinching. Reduces jank and makes zooming easier to debug.
authorPatrick Walton <pwalton@mozilla.com>
Mon, 13 Feb 2012 22:48:00 -0800
changeset 89136 32cbeb938818e8f73fb30631f7642a9da6c05bda
parent 89135 1733f6aa5db6f90c15f22dc04a38934a9a6ace62
child 89137 d5ed03dea0e78ce8482051f6d41bfc3676df8ff4
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)
milestone13.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
Don't render while pinching. Reduces jank and makes zooming easier to debug.
mobile/android/base/gfx/GeckoLayerClient.java
mobile/android/base/gfx/LayerController.java
mobile/android/base/ui/PanZoomController.java
--- a/mobile/android/base/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/gfx/GeckoLayerClient.java
@@ -260,20 +260,18 @@ public abstract class GeckoLayerClient e
     }
 
     @Override
     public void render() {
         adjustViewportWithThrottling();
     }
 
     private void adjustViewportWithThrottling() {
-        // FIXME: Allow redraw while a finger is down, but only if we're about to checkerboard.
-        // This requires fixing aboutToCheckerboard() to know about the new buffer size.
-        /*if (!getLayerController().getRedrawHint())
-            return;*/
+        if (!getLayerController().getRedrawHint())
+            return;
 
         if (mPendingViewportAdjust)
             return;
 
         long timeDelta = System.currentTimeMillis() - mLastViewportChangeTime;
         if (timeDelta < MIN_VIEWPORT_CHANGE_DELAY) {
             getLayerController().getView().postDelayed(
                 new Runnable() {
--- a/mobile/android/base/gfx/LayerController.java
+++ b/mobile/android/base/gfx/LayerController.java
@@ -314,22 +314,25 @@ public class LayerController {
         }
     }
 
     /**
      * Returns true if this controller is fine with performing a redraw operation or false if it
      * would prefer that the action didn't take place.
      */
     public boolean getRedrawHint() {
+        // FIXME: Allow redraw while a finger is down, but only if we're about to checkerboard.
+        // This requires fixing aboutToCheckerboard() to know about the new buffer size.
+
         if (mForceRedraw) {
             mForceRedraw = false;
             return true;
         }
 
-        return aboutToCheckerboard() && mPanZoomController.getRedrawHint();
+        return mPanZoomController.getRedrawHint();
     }
 
     private RectF getTileRect() {
         if (mRootLayer == null)
             return new RectF();
 
         float x = mRootLayer.getOrigin().x, y = mRootLayer.getOrigin().y;
         IntSize layerSize = mRootLayer.getSize();
--- a/mobile/android/base/ui/PanZoomController.java
+++ b/mobile/android/base/ui/PanZoomController.java
@@ -814,17 +814,17 @@ public class PanZoomController
 
         // Force a viewport synchronisation
         GeckoApp.mAppContext.showPlugins();
         mController.setForceRedraw();
         mController.notifyLayerClientOfGeometryChange();
     }
 
     public boolean getRedrawHint() {
-        return (mState == PanZoomState.NOTHING || mState == PanZoomState.FLING);
+        return (mState != PanZoomState.PINCHING && mState != PanZoomState.ANIMATED_ZOOM);
     }
 
     private void sendPointToGecko(String event, MotionEvent motionEvent) {
         String json;
         try {
             PointF point = new PointF(motionEvent.getX(), motionEvent.getY());
             point = mController.convertViewPointToLayerPoint(point);
             if (point == null) {