Backed out 2 changesets (bug 1223736) for reftest failures in mask-layer-transform.html CLOSED TREE

Backed out changeset 1982db677df6 (bug 1223736)
Backed out changeset 5813dbb50356 (bug 1223736)

MozReview-Commit-ID: HrnSIGPovea
This commit is contained in:
Wes Kocher 2016-03-18 16:44:09 -07:00
parent 8d3fbe0177
commit d19c0a23f3
5 changed files with 17 additions and 76 deletions

View File

@ -1466,7 +1466,11 @@ ContainerLayer::DefaultComputeEffectiveTransforms(const Matrix4x4& aTransformToS
ComputeEffectiveTransformsForChildren(idealTransform);
}
ComputeEffectiveTransformForMaskLayers(aTransformToSurface);
if (idealTransform.CanDraw2D()) {
ComputeEffectiveTransformForMaskLayers(aTransformToSurface);
} else {
ComputeEffectiveTransformForMaskLayers(Matrix4x4());
}
}
void

View File

@ -397,25 +397,6 @@ RoundOut(Rect r)
return IntRect(r.x, r.y, r.width, r.height);
}
static void
SetupMask(const EffectChain& aEffectChain,
DrawTarget* aDest,
const IntPoint& aOffset,
RefPtr<SourceSurface>& aMaskSurface,
Matrix& aMaskTransform)
{
if (aEffectChain.mSecondaryEffects[EffectTypes::MASK]) {
EffectMask *effectMask = static_cast<EffectMask*>(aEffectChain.mSecondaryEffects[EffectTypes::MASK].get());
aMaskSurface = effectMask->mMaskTexture->AsSourceBasic()->GetSurface(aDest);
if (!aMaskSurface) {
gfxWarning() << "Invalid sourceMask effect";
}
MOZ_ASSERT(effectMask->mMaskTransform.Is2D(), "How did we end up with a 3D transform here?!");
aMaskTransform = effectMask->mMaskTransform.As2D();
aMaskTransform.PostTranslate(-aOffset.x, -aOffset.y);
}
}
void
BasicCompositor::DrawQuad(const gfx::Rect& aRect,
const gfx::Rect& aClipRect,
@ -461,8 +442,7 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
// When we apply the 3D transformation, we do it against a temporary
// surface, so undo the coordinate offset.
new3DTransform = aTransform;
new3DTransform.PreTranslate(aRect.x, aRect.y, 0);
new3DTransform = Matrix4x4::Translation(aRect.x, aRect.y, 0) * aTransform;
}
buffer->PushClipRect(aClipRect);
@ -472,8 +452,16 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
RefPtr<SourceSurface> sourceMask;
Matrix maskTransform;
if (aTransform.Is2D()) {
SetupMask(aEffectChain, dest, offset, sourceMask, maskTransform);
if (aEffectChain.mSecondaryEffects[EffectTypes::MASK]) {
EffectMask *effectMask = static_cast<EffectMask*>(aEffectChain.mSecondaryEffects[EffectTypes::MASK].get());
sourceMask = effectMask->mMaskTexture->AsSourceBasic()->GetSurface(dest);
if (!sourceMask) {
gfxWarning() << "Invalid sourceMask effect";
}
MOZ_ASSERT(effectMask->mMaskTransform.Is2D(), "How did we end up with a 3D transform here?!");
MOZ_ASSERT(!effectMask->mIs3D);
maskTransform = effectMask->mMaskTransform.As2D();
maskTransform.PostTranslate(-offset.x, -offset.y);
}
CompositionOp blendMode = CompositionOp::OP_OVER;
@ -580,40 +568,8 @@ BasicCompositor::DrawQuad(const gfx::Rect& aRect,
Transform(temp, source, new3DTransform, transformBounds.TopLeft());
SetupMask(aEffectChain, buffer, offset, sourceMask, maskTransform);
// Adjust for the fact that our content now start at 0,0 instead
// of the top left of transformBounds.
transformBounds.MoveTo(0, 0);
maskTransform.PostTranslate(-transformBounds.x, -transformBounds.y);
if (sourceMask) {
// Transform the source by it's normal transform, and then the inverse
// of the mask transform so that it's in the mask's untransformed
// coordinate space.
Matrix old = buffer->GetTransform();
Matrix sourceTransform = old;
Matrix inverseMask = maskTransform;
inverseMask.Invert();
sourceTransform *= inverseMask;
SurfacePattern source(temp, ExtendMode::CLAMP, sourceTransform);
buffer->PushClipRect(transformBounds);
// Mask in the untransformed coordinate space, and then transform
// by the mask transform to put the result back into destination
// coords.
buffer->SetTransform(maskTransform);
buffer->MaskSurface(source, sourceMask, Point(0, 0));
buffer->SetTransform(old);
buffer->PopClip();
} else {
buffer->DrawSurface(temp, transformBounds, transformBounds);
}
buffer->DrawSurface(temp, transformBounds, transformBounds);
}
buffer->PopClip();

View File

@ -1,8 +0,0 @@
<html>
<body>
<div style="position:relative; left: 400px; width: 200px; height: 200px; overflow:hidden; border-radius: 20px;">
<div style="width:200px; height:200px; background-color:red; transform: perspective(100px) rotateY(10deg)"></div>
</div>
</body>
</html>

View File

@ -1,10 +0,0 @@
<html>
<body>
<div style="width:200px; height: 200px; transform: translate(400px);">
<div style="width: 200px; height: 200px; overflow:hidden; border-radius: 20px;">
<div style="width:200px; height:200px; background-color:red; transform: perspective(100px) rotateY(10deg)"></div>
</div>
</div>
</body>
</html>

View File

@ -19,4 +19,3 @@ skip-if(!asyncPan) != pull-background-displayport-4.html about:blank # fails wit
skip-if(!asyncPan) != pull-background-displayport-5.html about:blank
skip-if(!asyncPan) != pull-background-displayport-6.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
fuzzy(2,30150) == opacity-blending.html opacity-blending-ref.html
fuzzy(1,5) == mask-layer-transform.html mask-layer-transform-ref.html