Bug 1410129 - Restore scoping of RAII class instantation. r?mattwoodrow
MozReview-Commit-ID: 1Eojy6STwfl
--- 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 =