Bug 1732600. Make ComputeDisplayportScale use the ancestor process transform to ancestor scale. r=botond
authorTimothy Nikkel <tnikkel@gmail.com>
Tue, 05 Oct 2021 09:28:57 +0000
changeset 594577 e3712c7214b8d296db806e20ade2fd94a550e838
parent 594576 d39165de0a11e4a26c5b6c61b5765ae9129730f1
child 594578 9e95cc6419d782427a79c8ec61f91cf30c619807
push id38849
push usernerli@mozilla.com
push dateTue, 05 Oct 2021 15:48:45 +0000
treeherdermozilla-central@04a3446f3ae3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1732600
milestone95.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1732600. Make ComputeDisplayportScale use the ancestor process transform to ancestor scale. r=botond Differential Revision: https://phabricator.services.mozilla.com/D126660
layout/base/DisplayPortUtils.cpp
--- a/layout/base/DisplayPortUtils.cpp
+++ b/layout/base/DisplayPortUtils.cpp
@@ -57,21 +57,22 @@ CSSToScreenScale2D ComputeDisplayportSca
   // but we don't calculate the entire frame metrics.
   if (!aScrollFrame) {
     return CSSToScreenScale2D(1.0, 1.0);
   }
   nsIFrame* frame = do_QueryFrame(aScrollFrame);
   MOZ_ASSERT(frame);
   nsPresContext* presContext = frame->PresContext();
   PresShell* presShell = presContext->PresShell();
+
   return presContext->CSSToDevPixelScale() *
-         LayoutDeviceToLayerScale2D(
-             presShell->GetCumulativeResolution() *
-             nsLayoutUtils::GetTransformToAncestorScale(frame)) *
-         LayerToScreenScale2D(1.0, 1.0);
+         LayoutDeviceToLayerScale(presShell->GetCumulativeResolution()) *
+         LayerToParentLayerScale(1.0) *
+         nsLayoutUtils::GetTransformToAncestorScaleCrossProcessForFrameMetrics(
+             frame);
 }
 
 /* static */
 DisplayPortMargins DisplayPortMargins::ForScrollFrame(
     nsIScrollableFrame* aScrollFrame, const ScreenMargin& aMargins,
     const Maybe<CSSToScreenScale2D>& aScale) {
   CSSPoint visualOffset;
   CSSPoint layoutOffset;