Bug 989858 - Part 6: Rename DeprecatedPaint and stop passing a gfxContext in. r=roc

This commit is contained in:
Matt Woodrow
2014-04-01 12:02:10 +08:00
parent 34a2662a70
commit 827f3363f9
9 changed files with 59 additions and 31 deletions

View File

@@ -21,7 +21,7 @@ namespace mozilla {
namespace layers {
void
BasicCanvasLayer::DeprecatedPaint(gfxContext* aContext, Layer* aMaskLayer)
BasicCanvasLayer::Paint(DrawTarget* aDT, Layer* aMaskLayer)
{
if (IsHidden())
return;
@@ -30,21 +30,23 @@ BasicCanvasLayer::DeprecatedPaint(gfxContext* aContext, Layer* aMaskLayer)
UpdateTarget();
FireDidTransactionCallback();
gfxMatrix m;
Matrix m;
if (mNeedsYFlip) {
m = aContext->CurrentMatrix();
aContext->Translate(gfxPoint(0.0, mBounds.height));
aContext->Scale(1.0, -1.0);
m = aDT->GetTransform();
Matrix newTransform = m;
newTransform.Translate(0.0f, mBounds.height);
newTransform.Scale(1.0f, -1.0f);
aDT->SetTransform(newTransform);
}
FillRectWithMask(aContext->GetDrawTarget(),
FillRectWithMask(aDT,
Rect(0, 0, mBounds.width, mBounds.height),
mSurface, ToFilter(mFilter),
DrawOptions(GetEffectiveOpacity(), GetEffectiveOperator(this)),
aMaskLayer);
if (mNeedsYFlip) {
aContext->SetMatrix(m);
aDT->SetTransform(m);
}
}