Bug 539356 - Part 8a - Add END_NO_COMPOSITE to EndTransactionFlags and implement in for all LayerManagers. r=roc

This commit is contained in:
Matt Woodrow
2012-06-30 15:06:10 +12:00
parent 90311bee4c
commit 670e5120e5
19 changed files with 175 additions and 75 deletions

View File

@@ -396,6 +396,12 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
mTransactionIncomplete = false;
if (aFlags & END_NO_COMPOSITE) {
// TODO: We should really just set mTarget to null and make sure we can handle that further down the call chain
nsRefPtr<gfxASurface> surf = gfxPlatform::GetPlatform()->CreateOffscreenSurface(gfxIntSize(1, 1), gfxASurface::CONTENT_COLOR);
mTarget = new gfxContext(surf);
}
if (mTarget && mRoot && !(aFlags & END_NO_IMMEDIATE_REDRAW)) {
nsIntRect clipRect;
if (HasShadowManager()) {
@@ -425,9 +431,19 @@ BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
}
}
PaintLayer(mTarget, mRoot, aCallback, aCallbackData, nsnull);
if (mWidget) {
FlashWidgetUpdateArea(mTarget);
if (aFlags & END_NO_COMPOSITE) {
if (IsRetained()) {
// Clip the destination out so that we don't draw to it, and
// only end up validating ThebesLayers.
mTarget->Clip(gfxRect(0, 0, 0, 0));
PaintLayer(mTarget, mRoot, aCallback, aCallbackData, nsnull);
}
// If we're not retained, then don't composite means do nothing at all.
} else {
PaintLayer(mTarget, mRoot, aCallback, aCallbackData, nsnull);
if (mWidget) {
FlashWidgetUpdateArea(mTarget);
}
}
if (!mTransactionIncomplete) {