Bug 907926 - Avoid calling CurrentSurface when we can. r=Bas

This commit is contained in:
Matt Woodrow committed 2013-09-19 17:23:30 +12:00
1 parent f0636ddcc4
commit 1341207156
2 files changed
+11 -10

No files matched your search

+11 -9
View File
@@ -175,9 +175,9 @@ public:
{
const nsIntRegion& visibleRegion = mLayer->GetEffectiveVisibleRegion();
const nsIntRect& bounds = visibleRegion.GetBounds();
nsRefPtr<gfxASurface> currentSurface = mTarget->CurrentSurface();
if (mTarget->IsCairo()) {
nsRefPtr<gfxASurface> currentSurface = mTarget->CurrentSurface();
const gfxRect& targetOpaqueRect = currentSurface->GetOpaqueRect();
// Try to annotate currentSurface with a region of pixels that have been
@@ -322,15 +322,17 @@ BasicLayerManager::PopGroupToSourceWithCachedSurface(gfxContext *aTarget, gfxCon
{
if (!aTarget)
return;
nsRefPtr<gfxASurface> current = aPushed->CurrentSurface();
if (aTarget->IsCairo() && mCachedSurface.IsSurface(current)) {
gfxContextMatrixAutoSaveRestore saveMatrix(aTarget);
aTarget->IdentityMatrix();
aTarget->SetSource(current);
mCachedSurfaceInUse = false;
} else {
aTarget->PopGroupToSource();
if (aTarget->IsCairo()) {
nsRefPtr<gfxASurface> current = aPushed->CurrentSurface();
if (mCachedSurface.IsSurface(current)) {
gfxContextMatrixAutoSaveRestore saveMatrix(aTarget);
aTarget->IdentityMatrix();
aTarget->SetSource(current);
mCachedSurfaceInUse = false;
return;
}
}
aTarget->PopGroupToSource();
}
void
-1
View File
@@ -87,7 +87,6 @@ BasicThebesLayer::PaintThebes(gfxContext* aContext,
PROFILER_LABEL("BasicThebesLayer", "PaintThebes");
NS_ASSERTION(BasicManager()->InDrawing(),
"Can only draw in drawing phase");
nsRefPtr<gfxASurface> targetSurface = aContext->CurrentSurface();
if (!mContentClient) {
// we pass a null pointer for the Forwarder argument, which means