Bug 1413229 - Stop calling CreateWebRenderCommands for event regions types. r?jrmuizel draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 31 Oct 2017 12:07:23 -0400
changeset 689489 5d0268f4d6e6b96f67c07a80e6d451a2a3ff18e9
parent 689488 8db0f7e54aee3071350a40243d76bfa8bb7402ac
child 738324 44d0947d3805af4812f7df9c6369521951ae295d
push id87032
push userkgupta@mozilla.com
push dateTue, 31 Oct 2017 16:08:02 +0000
reviewersjrmuizel
bugs1413229
milestone58.0a1
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
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- 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)