Bug 1400440 - Apply scroll shift for dynamic toolbar to the composited scroll offset right away. r=kats

MozReview-Commit-ID: 1I7C0lFx4WP

--HG--
extra : rebase_source : 9c6ae39e10a2f9b86d2886140ee2e0d4f5cb4fda
This commit is contained in:
Botond Ballo 2017-09-15 19:47:46 -04:00
Родитель 0cc6f26617
Коммит 6ad906fc6d
1 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -2999,10 +2999,14 @@ void AsyncPanZoomController::AdjustScrollForSurfaceShift(const ScreenPoint& aShi
/ mFrameMetrics.GetZoom();
APZC_LOG("%p adjusting scroll position by %s for surface shift\n",
this, Stringify(adjustment).c_str());
CSSPoint scrollOffset = mFrameMetrics.GetScrollOffset();
scrollOffset.y = mY.ClampOriginToScrollableRect(scrollOffset.y + adjustment.y);
scrollOffset.x = mX.ClampOriginToScrollableRect(scrollOffset.x + adjustment.x);
mFrameMetrics.SetScrollOffset(scrollOffset);
CSSRect scrollRange = mFrameMetrics.CalculateScrollRange();
// Apply shift to mFrameMetrics.mScrollOffset.
mFrameMetrics.SetScrollOffset(scrollRange.ClampPoint(
mFrameMetrics.GetScrollOffset() + adjustment));
// Apply shift to mCompositedScrollOffset, since the dynamic toolbar expects
// the shift to take effect right away, without the usual frame delay.
mCompositedScrollOffset = scrollRange.ClampPoint(
mCompositedScrollOffset + adjustment);
RequestContentRepaint();
UpdateSharedCompositorFrameMetrics();
}