Bug 1265510 - Add some scroll-snapping logging to APZC. r?botond
MozReview-Commit-ID: HHIgemTs7Jx
--- 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());