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
--- 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*