Bug 1104809 - Log accumulation of event regions into a PaintedLayer. r=mstange,tn

This commit is contained in:
Kartikaya Gupta 2014-11-25 17:05:39 -05:00
parent dacb431abe
commit 9b9c9319d4

View File

@ -268,6 +268,20 @@ public:
mNewChildLayersIndex(-1), mNewChildLayersIndex(-1),
mAllDrawingAbove(false) mAllDrawingAbove(false)
{} {}
#ifdef MOZ_DUMP_PAINTING
/**
* Keep track of important decisions for debugging.
*/
nsAutoCString mLog;
#define FLB_LOG_PAINTED_LAYER_DECISION(tld, ...) \
tld->mLog.AppendPrintf("\t\t\t\t"); \
tld->mLog.AppendPrintf(__VA_ARGS__);
#else
#define FLB_LOG_PAINTED_LAYER_DECISION(...)
#endif
/** /**
* Record that an item has been added to the PaintedLayer, so we * Record that an item has been added to the PaintedLayer, so we
* need to update our regions. * need to update our regions.
@ -290,16 +304,16 @@ public:
const nsIFrame* GetAnimatedGeometryRoot() { return mAnimatedGeometryRoot; } const nsIFrame* GetAnimatedGeometryRoot() { return mAnimatedGeometryRoot; }
/** /**
* Add aHitRegion, aMaybeHitRegion, and aDispatchToContentHitRegion to the * Add the given hit regions to the hit regions to the hit retions for this
* hit regions for this PaintedLayer. * PaintedLayer.
*/ */
void AccumulateEventRegions(const nsRegion& aHitRegion, void AccumulateEventRegions(nsDisplayLayerEventRegions* aEventRegions)
const nsRegion& aMaybeHitRegion,
const nsRegion& aDispatchToContentHitRegion)
{ {
mHitRegion.Or(mHitRegion, aHitRegion); FLB_LOG_PAINTED_LAYER_DECISION(this, "Accumulating event regions %p against tld=%p\n", aEventRegions, this);
mMaybeHitRegion.Or(mMaybeHitRegion, aMaybeHitRegion);
mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, aDispatchToContentHitRegion); mHitRegion.Or(mHitRegion, aEventRegions->HitRegion());
mMaybeHitRegion.Or(mMaybeHitRegion, aEventRegions->MaybeHitRegion());
mDispatchToContentHitRegion.Or(mDispatchToContentHitRegion, aEventRegions->DispatchToContentHitRegion());
} }
/** /**
@ -374,20 +388,6 @@ public:
return mFixedPosFrameForLayerData != nullptr; return mFixedPosFrameForLayerData != nullptr;
} }
#ifdef MOZ_DUMP_PAINTING
/**
* Keep track of important decisions for debugging.
*/
nsAutoCString mLog;
#define FLB_LOG_PAINTED_LAYER_DECISION(tld, ...) \
tld->mLog.AppendPrintf("\t\t\t\t"); \
tld->mLog.AppendPrintf(__VA_ARGS__);
#else
#define FLB_LOG_PAINTED_LAYER_DECISION(...)
#endif
/** /**
* The region of visible content in the layer, relative to the * The region of visible content in the layer, relative to the
* container layer (which is at the snapped top-left of the display * container layer (which is at the snapped top-left of the display
@ -3055,9 +3055,7 @@ ContainerState::ProcessDisplayItems(nsDisplayList* aList)
if (itemType == nsDisplayItem::TYPE_LAYER_EVENT_REGIONS) { if (itemType == nsDisplayItem::TYPE_LAYER_EVENT_REGIONS) {
nsDisplayLayerEventRegions* eventRegions = nsDisplayLayerEventRegions* eventRegions =
static_cast<nsDisplayLayerEventRegions*>(item); static_cast<nsDisplayLayerEventRegions*>(item);
paintedLayerData->AccumulateEventRegions(eventRegions->HitRegion(), paintedLayerData->AccumulateEventRegions(eventRegions);
eventRegions->MaybeHitRegion(),
eventRegions->DispatchToContentHitRegion());
} else { } else {
// check to see if the new item has rounded rect clips in common with // check to see if the new item has rounded rect clips in common with
// other items in the layer // other items in the layer