Bug 1265510 - Add some scroll-snapping logging to APZC. r?botond draft
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 25 Apr 2016 19:56:01 -0400
changeset 356193 06981fb0bbe86d35c1e20e32e388f3ab8459c8d7
parent 356179 79de998e7307650fec99ea6188ae60ac64ebeedb
child 356194 4882975b2d699ef92dad6c2f1823dc7f633201c8
push id16473
push userkgupta@mozilla.com
push dateMon, 25 Apr 2016 23:56:46 +0000
reviewersbotond
bugs1265510
milestone49.0a1
Bug 1265510 - Add some scroll-snapping logging to APZC. r?botond MozReview-Commit-ID: HHIgemTs7Jx
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -1891,16 +1891,17 @@ nsEventStatus AsyncPanZoomController::On
         startPosition = mAnimation->AsWheelScrollAnimation()->GetDestination();
       } else if (mState == SMOOTH_SCROLL) {
         startPosition = mAnimation->AsSmoothScrollAnimation()->GetDestination();
       }
       if (MaybeAdjustDeltaForScrollSnapping(aEvent, delta, startPosition)) {
         // If we're scroll snapping, use a smooth scroll animation to get
         // the desired physics. Note that SmoothScrollTo() will re-use an
         // existing smooth scroll animation if there is one.
+        APZC_LOG("%p wheel scrolling to snap point %s\n", this, Stringify(startPosition).c_str());
         SmoothScrollTo(startPosition);
         break;
       }
 
       // Otherwise, use a wheel scroll animation, also reusing one if possible.
       if (mState != WHEEL_SCROLL) {
         CancelAnimation();
         SetState(WHEEL_SCROLL);
@@ -3978,16 +3979,17 @@ Maybe<CSSPoint> AsyncPanZoomController::
   }
   return Nothing();
 }
 
 void AsyncPanZoomController::ScrollSnapNear(const CSSPoint& aDestination) {
   if (Maybe<CSSPoint> snapPoint =
         FindSnapPointNear(aDestination, nsIScrollableFrame::DEVICE_PIXELS)) {
     if (*snapPoint != mFrameMetrics.GetScrollOffset()) {
+      APZC_LOG("%p smooth scrolling to snap point %s\n", this, Stringify(*snapPoint).c_str());
       SmoothScrollTo(*snapPoint);
     }
   }
 }
 
 void AsyncPanZoomController::ScrollSnap() {
   ReentrantMonitorAutoEnter lock(mMonitor);
   ScrollSnapNear(mFrameMetrics.GetScrollOffset());