mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-15 14:35:58 -10:00
Bug 907926 - Avoid calling CurrentSurface when we can. r=Bas
This commit is contained in:
1 parent
f0636ddcc4
commit
1341207156
2 files changed
+11
-10
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user