Bug 802321 - Don't compare geometry objects for inactive layers. r=roc

This commit is contained in:
Matt Woodrow 2012-10-17 21:00:00 +13:00
parent ebd7c262da
commit 7c3fac5a5a
2 changed files with 30 additions and 4 deletions

View File

@ -2028,8 +2028,6 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
topLeft = activeScrolledRoot->GetOffsetToCrossDoc(mContainerReferenceFrame);
}
}
nsAutoPtr<nsDisplayItemGeometry> geometry(item->AllocateGeometry(mBuilder));
// Assign the item to a layer
if (layerState == LAYER_ACTIVE_FORCE ||
@ -2047,7 +2045,7 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
// InvalidateForLayerChange doesn't need the new layer pointer.
// We also need to check the old data now, because BuildLayer
// can overwrite it.
InvalidateForLayerChange(item, nullptr, aClip, topLeft, geometry);
InvalidateForLayerChange(item, nullptr, aClip, topLeft, nullptr);
// If the item would have its own layer but is invisible, just hide it.
// Note that items without their own layers can't be skipped this
@ -2121,10 +2119,16 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
"Layer already in list???");
mNewChildLayers.AppendElement(ownLayer);
/**
* No need to allocate geometry for items that aren't
* part of a ThebesLayer.
*/
nsAutoPtr<nsDisplayItemGeometry> dummy;
mLayerBuilder->AddLayerDisplayItem(ownLayer, item,
aClip, layerState,
topLeft, nullptr,
geometry);
dummy);
} else {
ThebesLayerData* data =
FindThebesLayerFor(item, itemVisibleRect, itemDrawRect, aClip,
@ -2132,6 +2136,8 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList,
data->mLayer->SetIsFixedPosition(isFixed);
nsAutoPtr<nsDisplayItemGeometry> geometry(item->AllocateGeometry(mBuilder));
InvalidateForLayerChange(item, data->mLayer, aClip, topLeft, geometry);
mLayerBuilder->AddThebesDisplayItem(data->mLayer, item, aClip,

View File

@ -2158,6 +2158,12 @@ public:
nsRegion* aVisibleRegion,
const nsRect& aAllowVisibleRegionExpansion) MOZ_OVERRIDE;
virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) MOZ_OVERRIDE;
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
nsRegion* aInvalidRegion) MOZ_OVERRIDE
{
// We don't need to compute an invalidation region since we have LayerTreeInvalidation
}
NS_DISPLAY_DECL_NAME("Opacity", TYPE_OPACITY)
bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder);
@ -2507,6 +2513,13 @@ public:
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerParameters& aContainerParameters) MOZ_OVERRIDE;
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
nsRegion* aInvalidRegion) MOZ_OVERRIDE
{
// We don't need to compute an invalidation region since we have LayerTreeInvalidation
}
void PaintAsLayer(nsDisplayListBuilder* aBuilder,
nsRenderingContext* aCtx,
@ -2593,6 +2606,13 @@ public:
virtual bool TryMerge(nsDisplayListBuilder *aBuilder, nsDisplayItem *aItem) MOZ_OVERRIDE;
virtual uint32_t GetPerFrameKey() MOZ_OVERRIDE { return (mIndex << nsDisplayItem::TYPE_BITS) | nsDisplayItem::GetPerFrameKey(); }
virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
const nsDisplayItemGeometry* aGeometry,
nsRegion* aInvalidRegion) MOZ_OVERRIDE
{
// We don't need to compute an invalidation region since we have LayerTreeInvalidation
}
virtual const nsIFrame* ReferenceFrameForChildren() const MOZ_OVERRIDE {
// If we were created using a transform-getter, then we don't