From 2881f47a4c5eb5e0c81bbeaabc891b801505ccad Mon Sep 17 00:00:00 2001 From: Benoit Girard Date: Wed, 16 Sep 2015 13:42:24 -0400 Subject: [PATCH] Bug 1189565 - Only factor in the async zoom change. r=kats --HG-- extra : commitid : CjuuLbwyk5M --- gfx/layers/apz/src/AsyncPanZoomController.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index eb60109a70ec..ed2a97ecda34 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -2844,7 +2844,14 @@ Matrix4x4 AsyncPanZoomController::GetTransformToLastDispatchedPaint() const { * mLastContentPaintMetrics.GetDevPixelsPerCSSPixel() * mLastContentPaintMetrics.GetCumulativeResolution(); - gfxSize zoomChange = mLastContentPaintMetrics.GetZoom() / mLastDispatchedPaintMetrics.GetZoom(); + // We're interested in the async zoom change. Factor out the content scale + // that may change when dragging the window to a monitor with a different + // content scale. + LayoutDeviceToParentLayerScale2D lastContentZoom = + mLastContentPaintMetrics.GetZoom() / mLastContentPaintMetrics.GetDevPixelsPerCSSPixel(); + LayoutDeviceToParentLayerScale2D lastDispatchedZoom = + mLastDispatchedPaintMetrics.GetZoom() / mLastDispatchedPaintMetrics.GetDevPixelsPerCSSPixel(); + gfxSize zoomChange = lastContentZoom / lastDispatchedZoom; return Matrix4x4::Translation(scrollChange.x, scrollChange.y, 0). PostScale(zoomChange.width, zoomChange.height, 1);