Bug 624505 - Avoid unnecessary uploads of canvas to improve the panorama zooming performance among other things; r=jrmuizel sr=roc a=joe

This commit is contained in:
Vladimir Vukicevic 2011-01-11 18:59:26 -05:00
parent 2ceedc4232
commit 1628ac3a66

View File

@ -1238,9 +1238,6 @@ nsCanvasRenderingContext2D::Render(gfxContext *ctx, gfxPattern::GraphicsFilter a
if (mOpaque)
ctx->SetOperator(op);
mIsEntireFrameInvalid = PR_FALSE;
mInvalidateCount = 0;
return rv;
}
@ -4061,8 +4058,13 @@ nsCanvasRenderingContext2D::GetCanvasLayer(CanvasLayer *aOldLayer,
if (!mResetLayer && aOldLayer &&
aOldLayer->HasUserData(&g2DContextLayerUserData)) {
NS_ADDREF(aOldLayer);
// XXX Need to just update the changed area here
aOldLayer->Updated(nsIntRect(0, 0, mWidth, mHeight));
if (mIsEntireFrameInvalid || mInvalidateCount > 0) {
// XXX Need to just update the changed area here; we should keep track
// of the rectangle based on Redraw args.
aOldLayer->Updated(nsIntRect(0, 0, mWidth, mHeight));
MarkContextClean();
}
return aOldLayer;
}
@ -4084,6 +4086,9 @@ nsCanvasRenderingContext2D::GetCanvasLayer(CanvasLayer *aOldLayer,
canvasLayer->Updated(nsIntRect(0, 0, mWidth, mHeight));
mResetLayer = PR_FALSE;
MarkContextClean();
return canvasLayer.forget().get();
}
@ -4091,5 +4096,6 @@ void
nsCanvasRenderingContext2D::MarkContextClean()
{
mIsEntireFrameInvalid = PR_FALSE;
mInvalidateCount = 0;
}