Bug 1180295 - Disconnect scrolling notifications going to LayerMarginsAnimator. r=rbarker
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 18 Aug 2015 14:27:18 -0400
changeset 258263 69a90ad6126e513bd9566efb72276a7cc5df9ecf
parent 258262 0700729ed00747937218685cd95a660a3bfc1910
child 258264 2ed49a9cb8594640dfd6b18fb7cde9a9e29e62b8
push id29249
push userryanvm@gmail.com
push dateWed, 19 Aug 2015 11:17:27 +0000
treeherdermozilla-central@706b23a03d1c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrbarker
bugs1180295
milestone43.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 1180295 - Disconnect scrolling notifications going to LayerMarginsAnimator. r=rbarker
mobile/android/base/gfx/GeckoLayerClient.java
mobile/android/base/gfx/JavaPanZoomController.java
mobile/android/base/gfx/PanZoomTarget.java
--- a/mobile/android/base/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/gfx/GeckoLayerClient.java
@@ -894,32 +894,17 @@ class GeckoLayerClient implements LayerV
      * delta will be applied to the margins and the remainder will be applied to
      * the viewport origin.
      *
      * You must hold the monitor while calling this.
      */
     @Override
     public void scrollBy(float dx, float dy) {
         // Set mViewportMetrics manually so the margin changes take.
-        mViewportMetrics = mMarginsAnimator.scrollBy(mViewportMetrics, dx, dy);
-        viewportMetricsChanged(true);
-    }
-
-    /** Implementation of PanZoomTarget
-     * Notification that a subdocument has been scrolled by a certain amount.
-     * This is used here to make sure that the margins are still accessible
-     * during subdocument scrolling.
-     *
-     * You must hold the monitor while calling this.
-     */
-    @Override
-    public void scrollMarginsBy(float dx, float dy) {
-        ImmutableViewportMetrics newMarginsMetrics =
-            mMarginsAnimator.scrollBy(mViewportMetrics, dx, dy);
-        mViewportMetrics = mViewportMetrics.setMarginsFrom(newMarginsMetrics);
+        mViewportMetrics = mViewportMetrics.offsetViewportBy(dx, dy);
         viewportMetricsChanged(true);
     }
 
     /** Implementation of PanZoomTarget */
     @Override
     public void panZoomStopped() {
         if (mDynamicToolbarViewportChangeListener != null) {
             mDynamicToolbarViewportChangeListener.onPanZoomStopped();
--- a/mobile/android/base/gfx/JavaPanZoomController.java
+++ b/mobile/android/base/gfx/JavaPanZoomController.java
@@ -818,21 +818,17 @@ class JavaPanZoomController
 
     private void updatePosition() {
         mX.displace();
         mY.displace();
         PointF displacement = resetDisplacement();
         if (FloatUtils.fuzzyEquals(displacement.x, 0.0f) && FloatUtils.fuzzyEquals(displacement.y, 0.0f)) {
             return;
         }
-        if (mDefaultPrevented || mSubscroller.scrollBy(displacement)) {
-            synchronized (mTarget.getLock()) {
-                mTarget.scrollMarginsBy(displacement.x, displacement.y);
-            }
-        } else {
+        if (!mDefaultPrevented && !mSubscroller.scrollBy(displacement)) {
             synchronized (mTarget.getLock()) {
                 scrollBy(displacement.x, displacement.y);
             }
         }
     }
 
     /**
      * This class is an implementation of RenderTask which enforces its implementor to run in the UI thread.
--- a/mobile/android/base/gfx/PanZoomTarget.java
+++ b/mobile/android/base/gfx/PanZoomTarget.java
@@ -14,17 +14,16 @@ public interface PanZoomTarget {
     public ImmutableViewportMetrics getViewportMetrics();
     public ZoomConstraints getZoomConstraints();
     public FullScreenState getFullScreenState();
     public RectF getMaxMargins();
 
     public void setAnimationTarget(ImmutableViewportMetrics viewport);
     public void setViewportMetrics(ImmutableViewportMetrics viewport);
     public void scrollBy(float dx, float dy);
-    public void scrollMarginsBy(float dx, float dy);
     public void panZoomStopped();
     /** This triggers an (asynchronous) viewport update/redraw. */
     public void forceRedraw(DisplayPortMetrics displayPort);
 
     public boolean post(Runnable action);
     public void postRenderTask(RenderTask task);
     public void removeRenderTask(RenderTask task);
     public Object getLock();