Bug 627273, part 3: Add gfxContext::FillWithOpacity. sr=vlad

This commit is contained in:
Chris Jones
2011-01-26 00:26:37 -06:00
parent 3cd11eb214
commit 9920db298a
3 changed files with 26 additions and 17 deletions

View File

@@ -743,14 +743,7 @@ BasicImageLayer::PaintContext(gfxPattern* aPattern,
// No need to snap here; our transform has already taken care of it.
aContext->Rectangle(gfxRect(0, 0, aSize.width, aSize.height));
aContext->SetPattern(aPattern);
if (aOpacity != 1.0) {
aContext->Save();
aContext->Clip();
aContext->Paint(aOpacity);
aContext->Restore();
} else {
aContext->Fill();
}
aContext->FillWithOpacity(aOpacity);
}
class BasicColorLayer : public ColorLayer, BasicImplData {
@@ -962,14 +955,7 @@ BasicCanvasLayer::PaintWithOpacity(gfxContext* aContext,
// No need to snap here; our transform is already set up to snap our rect
aContext->Rectangle(gfxRect(0, 0, mBounds.width, mBounds.height));
aContext->SetPattern(pat);
if (aOpacity != 1.0) {
aContext->Save();
aContext->Clip();
aContext->Paint(aOpacity);
aContext->Restore();
} else {
aContext->Fill();
}
aContext->FillWithOpacity(aOpacity);
if (mNeedsYFlip) {
aContext->SetMatrix(m);
@@ -2496,7 +2482,7 @@ BasicShadowCanvasLayer::Paint(gfxContext* aContext,
// No need to snap here; our transform has already taken care of it
aContext->Rectangle(r);
aContext->SetPattern(pat);
aContext->Fill();
aContext->FillWithOpacity(GetEffectiveOpacity());
}
// Create a shadow layer (PLayerChild) for aLayer, if we're forwarding