Bug 1410129 - Restore scoping of RAII class instantation. r?mattwoodrow draft
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 19 Oct 2017 11:35:14 -0400
changeset 683362 8345080330d1a5c4b32a30aff8e10c6c7d5207f6
parent 683249 31af3ee0436093bfd3300e9002f1118df0420309
child 736617 2f35bc301fba1a5ea6872b66160b391e8cbb92c1
push id85344
push userkgupta@mozilla.com
push dateThu, 19 Oct 2017 15:35:46 +0000
reviewersmattwoodrow
bugs1410129
milestone58.0a1
Bug 1410129 - Restore scoping of RAII class instantation. r?mattwoodrow MozReview-Commit-ID: 1Eojy6STwfl
gfx/layers/wr/WebRenderCommandBuilder.cpp
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -208,24 +208,25 @@ WebRenderCommandBuilder::CreateWebRender
       // If we're going to create a new layer data for this item, stash the
       // ASR so that if we recurse into a sublist they will know where to stop
       // walking up their ASR chain when building scroll metadata.
       if (forceNewLayerData) {
         mAsrStack.push_back(asr);
       }
     }
 
-    // ensure the scope of ScrollingLayersHelper is maintained
-    ScrollingLayersHelper clip(item, aBuilder, aSc, mClipIdCache, apzEnabled);
+    { // ensure the scope of ScrollingLayersHelper is maintained
+      ScrollingLayersHelper clip(item, aBuilder, aSc, mClipIdCache, apzEnabled);
 
-    // 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,
-                                       aDisplayListBuilder)) {
-      PushItemAsImage(item, aBuilder, aResources, aSc, aDisplayListBuilder);
+      // 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,
+                                         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)
         mAsrStack.pop_back();
         const ActiveScrolledRoot* stopAtAsr =