Bug 979760 - Pull out a BeginTransaction call common to the start of all three branches of if/else logic. r=mattwoodrow

I don't see any particular reason for them to logically be in each
branch, and it seems the code was originally written with the
BeginTransaction in one place, but later had to be refactored into its
current form.

Note that this separates the comment from one of the EndEmptyTransaction
calls below it, but the comment was actually associated primarily with
the further EndEmptyTransaction call, and with the if above it, based on
the history pointing to
https://hg.mozilla.org/mozilla-central/rev/b4e9a17e7fe2
This commit is contained in:
L. David Baron 2014-03-06 22:08:57 -08:00
parent 4b652ed544
commit bfbcf864da

View File

@ -5851,6 +5851,8 @@ PresShell::Paint(nsView* aViewToPaint,
mIsFirstPaint = false;
}
layerManager->BeginTransaction();
if (frame && isRetainingManager) {
// Try to do an empty transaction, if the frame tree does not
// need to be updated. Do not try to do an empty transaction on
@ -5858,14 +5860,12 @@ PresShell::Paint(nsView* aViewToPaint,
// draws the window title bar on Mac), because a) it won't work
// and b) below we don't want to clear NS_FRAME_UPDATE_LAYER_TREE,
// that will cause us to forget to update the real layer manager!
if (!(aFlags & PAINT_LAYERS)) {
layerManager->BeginTransaction();
if (layerManager->EndEmptyTransaction()) {
return;
}
NS_WARNING("Must complete empty transaction when compositing!");
} else {
layerManager->BeginTransaction();
}
if (!(frame->GetStateBits() & NS_FRAME_UPDATE_LAYER_TREE) &&
@ -5908,8 +5908,6 @@ PresShell::Paint(nsView* aViewToPaint,
}
}
frame->RemoveStateBits(NS_FRAME_UPDATE_LAYER_TREE);
} else {
layerManager->BeginTransaction();
}
if (frame) {
frame->ClearPresShellsFromLastPaint();