Bug 973976 - Revert to Thebes path for CopyableCanvasLayer. r=jmuizelaar

The performance on the Mac platform degraded after porting the code to
Moz2D in Bug 948765. This patch chooses the old thebes path instead of the
Moz2D path, so that performance is unaffected. This way we can easily
revert this patch at a later time when the perf issue has been fixed.
This commit is contained in:
Tor Arvid Lund 2014-03-17 10:49:21 -04:00
parent 799924e25f
commit 13d86024c0
2 changed files with 7 additions and 4 deletions

View File

@ -290,8 +290,11 @@ CopyableCanvasLayer::PaintWithOpacity(gfx::DrawTarget* aTarget,
options.mCompositionOp = aOperator;
}
// XXX: This needs rewriting for acceptable performance using CoreGraphics.
// Therefore - this ::PaintWithOpacity is currently not used
Rect rect = Rect(0, 0, mBounds.width, mBounds.height);
aTarget->FillRect(rect, pat, options);
if (aMaskSurface) {
aTarget->MaskSurface(pat, aMaskSurface, Point(0, 0), options);
}

View File

@ -79,10 +79,10 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
bool updated = false;
{
// Restrict drawTarget to a scope so that terminates before Unlock.
RefPtr<DrawTarget> drawTarget =
mBuffer->AsTextureClientDrawTarget()->GetAsDrawTarget();
if (drawTarget) {
aLayer->UpdateTarget(drawTarget);
nsRefPtr<gfxASurface> surface =
mBuffer->AsTextureClientSurface()->GetAsSurface();
if (surface) {
aLayer->DeprecatedUpdateSurface(surface);
updated = true;
}
}