Bug 934860 - Start and finish transactions with temporary layer managers each time we use them to ensure that these are paired. r=roc

This commit is contained in:
Matt Woodrow 2013-11-07 08:10:49 +13:00
parent 305cff4872
commit 33e71bb6ac
2 changed files with 8 additions and 10 deletions

View File

@ -1942,6 +1942,7 @@ PaintInactiveLayer(nsDisplayListBuilder* aBuilder,
context = new gfxContext(surf);
}
#endif
basic->BeginTransaction();
basic->SetTarget(context);
if (aItem->GetType() == nsDisplayItem::TYPE_SVG_EFFECTS) {
@ -2347,7 +2348,7 @@ FrameLayerBuilder::AddThebesDisplayItem(ThebesLayer* aLayer,
{
ThebesDisplayItemLayerUserData* thebesData =
static_cast<ThebesDisplayItemLayerUserData*>(aLayer->GetUserData(&gThebesDisplayItemLayerUserData));
nsRefPtr<LayerManager> tempManager;
nsRefPtr<BasicLayerManager> tempManager;
nsIntRect intClip;
bool hasClip = false;
if (aLayerState != LAYER_NONE) {
@ -2417,6 +2418,7 @@ FrameLayerBuilder::AddThebesDisplayItem(ThebesLayer* aLayer,
tempManager->SetRoot(layer);
layerBuilder->WillEndTransaction();
tempManager->AbortTransaction();
nsIntPoint offset = GetLastPaintOffset(aLayer) - GetTranslationForThebesLayer(aLayer);
props->MoveBy(-offset);
@ -2506,13 +2508,7 @@ FrameLayerBuilder::StoreDataForFrame(nsIFrame* aFrame,
FrameLayerBuilder::ClippedDisplayItem::~ClippedDisplayItem()
{
if (mInactiveLayerManager) {
// We always start a transaction during layer construction for all inactive
// layers, but we don't necessarily call EndTransaction during painting.
// If the transaaction is still open, end it to avoid assertions.
BasicLayerManager* basic = static_cast<BasicLayerManager*>(mInactiveLayerManager.get());
if (basic->InTransaction()) {
basic->EndTransaction(nullptr, nullptr);
}
basic->SetUserData(&gLayerManagerLayerBuilder, nullptr);
}
}
@ -2523,7 +2519,7 @@ FrameLayerBuilder::AddLayerDisplayItem(Layer* aLayer,
const DisplayItemClip& aClip,
LayerState aLayerState,
const nsPoint& aTopLeft,
LayerManager* aManager,
BasicLayerManager* aManager,
nsAutoPtr<nsDisplayItemGeometry> aGeometry)
{
if (aLayer->Manager() != mRetainingManager)

View File

@ -24,6 +24,7 @@ namespace mozilla {
namespace layers {
class ContainerLayer;
class LayerManager;
class BasicLayerManager;
class ThebesLayer;
}
@ -95,6 +96,7 @@ public:
typedef layers::ThebesLayer ThebesLayer;
typedef layers::ImageLayer ImageLayer;
typedef layers::LayerManager LayerManager;
typedef layers::BasicLayerManager BasicLayerManager;
FrameLayerBuilder() :
mRetainingManager(nullptr),
@ -273,7 +275,7 @@ public:
const DisplayItemClip& aClip,
LayerState aLayerState,
const nsPoint& aTopLeft,
LayerManager* aManager,
BasicLayerManager* aManager,
nsAutoPtr<nsDisplayItemGeometry> aGeometry);
/**
@ -420,7 +422,7 @@ public:
LayerManagerData* mParent;
nsRefPtr<Layer> mLayer;
nsRefPtr<Layer> mOptLayer;
nsRefPtr<LayerManager> mInactiveManager;
nsRefPtr<BasicLayerManager> mInactiveManager;
nsAutoTArray<nsIFrame*, 1> mFrameList;
nsAutoPtr<nsDisplayItemGeometry> mGeometry;
DisplayItemClip mClip;