Bug 1281907 - Part 1 - Include zoom level compensation in clip transform passed to caller. r?botond draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 24 Mar 2018 21:27:06 +0100
changeset 775927 7a562412e07f8da36340c8909a25bcb127577601
parent 775926 48e6fb0cb1005c72612d48c833a019b082d962fd
child 775928 2e3e63cc42c86f25c5c24a2ff0ac79130498ee65
child 775930 9936a5f9f22e4410485d1dcbb0053febc158338b
child 776032 3ef023762c0be93820c8b91a75061003b230a818
push id104750
push usermozilla@buttercookie.de
push dateSun, 01 Apr 2018 20:21:04 +0000
reviewersbotond
bugs1281907
milestone61.0a1
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*