Bug 775697 - Cancel layer transactions that haven't ended after nsDisplaySVGEffects::PaintAsLayer returns. r=roc.

This commit is contained in:
Jonathan Watt 2012-07-20 00:53:55 -04:00
parent f28956b0e5
commit 613454044e
3 changed files with 14 additions and 0 deletions

View File

@ -384,6 +384,16 @@ BasicLayerManager::EndTransaction(DrawThebesLayerCallback aCallback,
EndTransactionInternal(aCallback, aCallbackData, aFlags);
}
void
BasicLayerManager::AbortTransaction()
{
NS_ASSERTION(InConstruction(), "Should be in construction phase");
#ifdef DEBUG
mPhase = PHASE_NONE;
#endif
mUsingDefaultTarget = false;
}
bool
BasicLayerManager::EndTransactionInternal(DrawThebesLayerCallback aCallback,
void* aCallbackData,

View File

@ -94,6 +94,7 @@ public:
virtual void EndTransaction(DrawThebesLayerCallback aCallback,
void* aCallbackData,
EndTransactionFlags aFlags = END_DEFAULT);
void AbortTransaction();
virtual void SetRoot(Layer* aLayer);

View File

@ -1636,6 +1636,9 @@ PaintInactiveLayer(nsDisplayListBuilder* aBuilder,
aLayerBuilder->WillEndTransaction(tempManager);
if (aItem->GetType() == nsDisplayItem::TYPE_SVG_EFFECTS) {
static_cast<nsDisplaySVGEffects*>(aItem)->PaintAsLayer(aBuilder, aCtx, tempManager);
if (tempManager->InTransaction()) {
tempManager->AbortTransaction();
}
} else {
tempManager->EndTransaction(FrameLayerBuilder::DrawThebesLayer, aBuilder);
}