Bug 1152509. Use Mask with alpha to avoid allocating a surface. r=bas

This should give a performance improvement on platforms
not using Cairo (especially D2D)
This commit is contained in:
Jeff Muizelaar
2015-04-09 10:52:11 -04:00
parent a4694e7257
commit d5ef15a88e
3 changed files with 5 additions and 10 deletions

View File

@@ -44,13 +44,8 @@ PaintWithMask(gfxContext* aContext, float aOpacity, Layer* aMaskLayer)
{
AutoMoz2DMaskData mask;
if (GetMaskData(aMaskLayer, Point(), &mask)) {
if (aOpacity < 1.0) {
aContext->PushGroup(gfxContentType::COLOR_ALPHA);
aContext->Paint(aOpacity);
aContext->PopGroupToSource();
}
aContext->SetMatrix(ThebesMatrix(mask.GetTransform()));
aContext->Mask(mask.GetSurface());
aContext->Mask(mask.GetSurface(), aOpacity);
return;
}