Bug 989858 - Part 2: Convert BasicCanvasLayer. r=roc

This commit is contained in:
Matt Woodrow 2014-04-01 12:02:09 +08:00
parent e921db2fe5
commit 4586f037e0
2 changed files with 17 additions and 10 deletions

View File

@ -367,8 +367,6 @@ CopyableCanvasLayer::GetTempSurface(const IntSize& aSize,
mCachedFormat = aFormat;
}
MOZ_ASSERT(mCachedTempSurface->Stride() ==
mCachedTempSurface->GetSize().width * 4);
return mCachedTempSurface;
}

View File

@ -43,16 +43,25 @@ BasicCanvasLayer::DeprecatedPaint(gfxContext* aContext, Layer* aMaskLayer)
return;
FirePreTransactionCallback();
DeprecatedUpdateSurface();
UpdateTarget();
FireDidTransactionCallback();
gfxContext::GraphicsOperator mixBlendMode = DeprecatedGetEffectiveMixBlendMode();
DeprecatedPaintWithOpacity(aContext,
GetEffectiveOpacity(),
aMaskLayer,
mixBlendMode != gfxContext::OPERATOR_OVER ?
mixBlendMode :
DeprecatedGetOperator());
gfxMatrix m;
if (mNeedsYFlip) {
m = aContext->CurrentMatrix();
aContext->Translate(gfxPoint(0.0, mBounds.height));
aContext->Scale(1.0, -1.0);
}
FillRectWithMask(aContext->GetDrawTarget(),
Rect(0, 0, mBounds.width, mBounds.height),
mSurface, ToFilter(mFilter),
DrawOptions(GetEffectiveOpacity(), GetEffectiveOperator(this)),
aMaskLayer);
if (mNeedsYFlip) {
aContext->SetMatrix(m);
}
}
already_AddRefed<CanvasLayer>