From 93231ce78b37689130960e42a27386058344b8ec Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Sun, 17 May 2015 02:00:10 -0500 Subject: [PATCH] Bug 1165536. Don't include resolution compensation when adjusting the cliprect of ancestors of scrollbars. r=botond We are trying to adjust for the async transform that gets applied to the scrollable container layer by applying a transform to the scrollbar layer. That means we also need to adjust our clip rect. The resolution compensation is not done for this reason (compensating for a transform on an ancestor layer), hence we don't need to adjust the clip rect for the resolution compensation. --- gfx/layers/composite/AsyncCompositionManager.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index fe4e3c646832..c6ae2cc33f37 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -831,17 +831,18 @@ ApplyAsyncTransformToScrollbarForContent(Layer* aScrollbar, Matrix4x4 contentTransform = aContent.GetTransform(); Matrix4x4 contentUntransform = contentTransform.Inverse(); - compensation = compensation - * contentTransform - * asyncUntransform - * contentUntransform; + Matrix4x4 asyncCompensation = contentTransform + * asyncUntransform + * contentUntransform; + + compensation = compensation * asyncCompensation; // We also need to make a corresponding change on the clip rect of all the // layers on the ancestor chain from the scrollbar layer up to but not // including the layer with the async transform. Otherwise the scrollbar // shifts but gets clipped and so appears to flicker. for (Layer* ancestor = aScrollbar; ancestor != aContent.GetLayer(); ancestor = ancestor->GetParent()) { - TransformClipRect(ancestor, compensation); + TransformClipRect(ancestor, asyncCompensation); } } transform = transform * compensation;