Bug 1281907 - Part 1 - Include zoom level compensation in clip transform passed to caller. r=botond
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 24 Mar 2018 21:27:06 +0100
changeset 411443 a2e0f2e299bcc1cad4ea74e55d4d7b9c0f6c1a49
parent 411442 edbbd00906426ed221f277f44bd7b8fac70e450d
child 411444 5506727613da421f524877e817c1fd1529160ab8
push id33760
push useraciure@mozilla.com
push dateTue, 03 Apr 2018 21:52:50 +0000
treeherdermozilla-central@ad27045cac84 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1281907
milestone61.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 1281907 - Part 1 - Include zoom level compensation in clip transform passed to caller. r=botond If we don't do that, in the case of a root scrollbar the clip transform passed to our caller will incorrectly be scaled with the current content resolution. This means that that the position of the clip rect won't match the actual position of the scrollbar if the resolution isn't ~1.0, so the scrollbars will be clipped out of existence when the content is (pinch-) zoomed in or out. MozReview-Commit-ID: 5yXa9EpTJ2g
gfx/layers/apz/src/APZCTreeManager.cpp
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -3186,28 +3186,25 @@ APZCTreeManager::ComputeTransformForScro
   // and then unapplying it after unapplying the async transform.
   if (aScrollbarIsDescendant) {
     AsyncTransformComponentMatrix overscroll =
         aApzc->GetOverscrollTransform(AsyncPanZoomController::eForCompositing);
     Matrix4x4 asyncUntransform = (asyncTransform * overscroll).Inverse().ToUnknownMatrix();
     const Matrix4x4& contentTransform = aScrollableContentTransform;
     Matrix4x4 contentUntransform = contentTransform.Inverse();
 
-    AsyncTransformComponentMatrix asyncCompensation =
-        ViewAs<AsyncTransformComponentMatrix>(
-            contentTransform
-          * asyncUntransform
-          * contentUntransform);
-
-    compensation = compensation * asyncCompensation;
-
-    // Pass the async compensation out to the caller so that it can use it
+    compensation *= ViewAs<AsyncTransformComponentMatrix>(
+                        contentTransform
+                      * asyncUntransform
+                      * contentUntransform);
+
+    // Pass the total compensation out to the caller so that it can use it
     // to transform clip transforms as needed.
     if (aOutClipTransform) {
-      *aOutClipTransform = asyncCompensation;
+      *aOutClipTransform = compensation;
     }
   }
   transform = transform * compensation;
 
   return transform;
 }
 
 APZSampler*