Bug 1413229 - Stop calling CreateWebRenderCommands for event regions types. r?jrmuizel
These items don't paint anything and are handled separately, so we don't need
to call CreateWebRenderCommands for them. We could just implement
CreateWebRenderCommands for the item and have it return true unconditionally,
but it's still an extra virtual call. Plus there's existing code in
WebRenderCommandBuilder that's conditioned specifically for event regions so
I prefer keeping all the conditioned code together.
MozReview-Commit-ID: 5kTuv7qgiKU
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -219,17 +219,18 @@ WebRenderCommandBuilder::CreateWebRender
if (forceNewLayerData) {
mAsrStack.push_back(asr);
}
}
mScrollingHelper.BeginItem(item, aSc);
// Note: this call to CreateWebRenderCommands can recurse back into
// this function if the |item| is a wrapper for a sublist.
- if (!item->CreateWebRenderCommands(aBuilder, aResources, aSc, mManager,
+ if (itemType != DisplayItemType::TYPE_LAYER_EVENT_REGIONS &&
+ !item->CreateWebRenderCommands(aBuilder, aResources, aSc, mManager,
aDisplayListBuilder)) {
PushItemAsImage(item, aBuilder, aResources, aSc, aDisplayListBuilder);
}
if (apzEnabled) {
if (forceNewLayerData) {
// Pop the thing we pushed before the recursion, so the topmost item on
// the stack is enclosing display item's ASR (or the stack is empty)