Bug 1145730 - Restrict the async transforms applied to mask layers to those caused by fixed-position adjustment. r=kats

--HG--
extra : source : c7948dad4367a7a682478c344fd1d8668b33ef1d
This commit is contained in:
Botond Ballo 2015-04-01 16:47:05 -04:00
parent 8aa98da9f8
commit 3cbb0fb618
3 changed files with 14 additions and 8 deletions

View File

@ -840,14 +840,10 @@ Layer::ComputeEffectiveTransformForMaskLayer(const Matrix4x4& aTransformToSurfac
bool maskIs2D = mMaskLayer->GetTransform().CanDraw2D();
NS_ASSERTION(maskIs2D, "How did we end up with a 3D transform here?!");
#endif
// Use our shadow transform and base transform to compute a delta for the
// mask layer's effective transform, as though it was also transformed by
// the APZ.
//
// Note: This will fail if the base transform is degenerate. Currently, this
// is not expected for OMTA transformed layers.
mMaskLayer->mEffectiveTransform = mMaskLayer->GetTransform() *
GetTransform().Inverse() * GetLocalTransform() *
// The mask layer can have an async transform applied to it in some
// situations, so be sure to use its GetLocalTransform() rather than
// its GetTransform().
mMaskLayer->mEffectiveTransform = mMaskLayer->GetLocalTransform() *
mMaskLayer->mEffectiveTransform;
}
}

View File

@ -197,6 +197,12 @@ TranslateShadowLayer2D(Layer* aLayer,
if (aAdjustClipRect) {
TransformClipRect(aLayer, Matrix4x4::Translation(aTranslation.x, aTranslation.y, 0));
}
// If a fixed- or sticky-position layer has a mask layer, that mask should
// move along with the layer, so apply the translation to the mask layer too.
if (Layer* maskLayer = aLayer->GetMaskLayer()) {
TranslateShadowLayer2D(maskLayer, aTranslation, false);
}
}
static bool

View File

@ -940,6 +940,10 @@ CompositorParent::CompositeCallback(TimeStamp aScheduleTime)
/* static */ void
CompositorParent::SetShadowProperties(Layer* aLayer)
{
if (Layer* maskLayer = aLayer->GetMaskLayer()) {
SetShadowProperties(maskLayer);
}
// FIXME: Bug 717688 -- Do these updates in LayerTransactionParent::RecvUpdate.
LayerComposite* layerComposite = aLayer->AsLayerComposite();
// Set the layerComposite's base transform to the layer's base transform.