зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1612750 - Simplify a misleading calculation in AsyncPanZoomController::GetCurrentAsyncTransform(). r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D62090 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b53c4508e9
Коммит
9d2b7b80cb
|
@ -4181,18 +4181,17 @@ AsyncTransform AsyncPanZoomController::GetCurrentAsyncTransform(
|
|||
|
||||
ParentLayerPoint translation;
|
||||
if (aComponents.contains(AsyncTransformComponent::eVisual)) {
|
||||
CSSPoint lastPaintVisualOffset;
|
||||
// There is no "lastPaintVisualOffset" to subtract here; the visual offset
|
||||
// is entirely async.
|
||||
if (mLastContentPaintMetrics.IsScrollable()) {
|
||||
lastPaintVisualOffset =
|
||||
mLastContentPaintMetrics.GetScrollOffset() -
|
||||
mLastContentPaintMetrics.GetLayoutViewport().TopLeft();
|
||||
MOZ_ASSERT(mLastContentPaintMetrics.GetScrollOffset() ==
|
||||
mLastContentPaintMetrics.GetLayoutViewport().TopLeft());
|
||||
}
|
||||
|
||||
CSSPoint currentVisualOffset = GetEffectiveScrollOffset(aMode) -
|
||||
GetEffectiveLayoutViewport(aMode).TopLeft();
|
||||
|
||||
translation +=
|
||||
(currentVisualOffset - lastPaintVisualOffset) * effectiveZoom;
|
||||
translation += currentVisualOffset * effectiveZoom;
|
||||
}
|
||||
if (aComponents.contains(AsyncTransformComponent::eLayout)) {
|
||||
CSSPoint lastPaintLayoutOffset;
|
||||
|
|
|
@ -88,6 +88,7 @@ TEST_F(APZCBasicTester, ComplexTransform) {
|
|||
metrics.SetCompositionBounds(ParentLayerRect(0, 0, 24, 24));
|
||||
metrics.SetDisplayPort(CSSRect(-1, -1, 6, 6));
|
||||
metrics.SetScrollOffset(CSSPoint(10, 10));
|
||||
metrics.SetLayoutViewport(CSSRect(10, 10, 8, 8));
|
||||
metrics.SetScrollableRect(CSSRect(0, 0, 50, 50));
|
||||
metrics.SetCumulativeResolution(LayoutDeviceToLayerScale2D(2, 2));
|
||||
metrics.SetPresShellResolution(2.0f);
|
||||
|
|
Загрузка…
Ссылка в новой задаче