From 79506c359b501f508223d4570f72f1252e88b6e7 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Tue, 1 Apr 2014 15:53:15 +0800 Subject: [PATCH] Bug 990338 - Use CopySurface when copying data to a TextureClient for better performance. r=nical --- gfx/layers/CopyableCanvasLayer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gfx/layers/CopyableCanvasLayer.cpp b/gfx/layers/CopyableCanvasLayer.cpp index 4333d82c1e2..da759893ebf 100644 --- a/gfx/layers/CopyableCanvasLayer.cpp +++ b/gfx/layers/CopyableCanvasLayer.cpp @@ -88,9 +88,9 @@ CopyableCanvasLayer::UpdateTarget(DrawTarget* aDestTarget) if (!mGLContext && aDestTarget) { NS_ASSERTION(mSurface, "Must have surface to draw!"); if (mSurface) { - SurfacePattern source(mSurface, ExtendMode::CLAMP, Matrix(), ToFilter(mFilter)); - aDestTarget->FillRect(Rect(0, 0, mBounds.width, mBounds.height), - source, DrawOptions(1.0f, CompositionOp::OP_SOURCE)); + aDestTarget->CopySurface(mSurface, + IntRect(0, 0, mBounds.width, mBounds.height), + IntPoint(0, 0)); } return; } @@ -155,9 +155,9 @@ CopyableCanvasLayer::UpdateTarget(DrawTarget* aDestTarget) resultDataSurface->Stride(), resultDataSurface->GetFormat()); IntSize readSize = readSurf->GetSize(); - Rect r(0, 0, readSize.width, readSize.height); - DrawOptions opts(1.0f, CompositionOp::OP_SOURCE, AntialiasMode::DEFAULT); - dt->DrawSurface(readSurf, r, r, DrawSurfaceOptions(), opts); + dt->CopySurface(readSurf, + IntRect(0, 0, readSize.width, readSize.height), + IntPoint(0, 0)); } // If !aDestSurface then we will end up painting using mSurface, so