Commit 0473ebc1 authored by Kartikaya Gupta's avatar Kartikaya Gupta
Browse files

Bug 1394695 - Don't push scrolling clips in layers-free WR if APZ is disabled. r=mstange

MozReview-Commit-ID: AesXui61mB2

--HG--
extra : rebase_source : bd8d1adacb3be142cc5227e9bae347abf0ddc14d
parent 0adcdd62
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -89,7 +89,8 @@ ScrollingLayersHelper::ScrollingLayersHelper(WebRenderLayer* aLayer,
ScrollingLayersHelper::ScrollingLayersHelper(nsDisplayItem* aItem,
                                             wr::DisplayListBuilder& aBuilder,
                                             const StackingContextHelper& aStackingContext,
                                             WebRenderLayerManager::ClipIdMap& aCache)
                                             WebRenderLayerManager::ClipIdMap& aCache,
                                             bool aApzEnabled)
  : mLayer(nullptr)
  , mBuilder(&aBuilder)
  , mPushedLayerLocalClip(false)
@@ -97,6 +98,14 @@ ScrollingLayersHelper::ScrollingLayersHelper(nsDisplayItem* aItem,
{
  int32_t auPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();

  if (!aApzEnabled) {
    // If APZ is not enabled, we can ignore all the stuff with ASRs; we just
    // need to define the clip chain on the item and that's it.
    DefineAndPushChain(aItem->GetClipChain(), aBuilder, aStackingContext,
        auPerDevPixel, aCache);
    return;
  }

  // There are two ASR chains here that we need to be fully defined. One is the
  // ASR chain pointed to by aItem->GetActiveScrolledRoot(). The other is the
  // ASR chain pointed to by aItem->GetClipChain()->mASR. We pick the leafmost
+2 −1
Original line number Diff line number Diff line
@@ -33,7 +33,8 @@ public:
  ScrollingLayersHelper(nsDisplayItem* aItem,
                        wr::DisplayListBuilder& aBuilder,
                        const StackingContextHelper& aStackingContext,
                        WebRenderLayerManager::ClipIdMap& aCache);
                        WebRenderLayerManager::ClipIdMap& aCache,
                        bool aApzEnabled);
  ~ScrollingLayersHelper();

private:
+1 −1
Original line number Diff line number Diff line
@@ -328,7 +328,7 @@ WebRenderLayerManager::CreateWebRenderCommandsFromDisplayList(nsDisplayList* aDi
    }

    { // scope the ScrollingLayersHelper
      ScrollingLayersHelper clip(item, aBuilder, aSc, mClipIdCache);
      ScrollingLayersHelper clip(item, aBuilder, aSc, mClipIdCache, AsyncPanZoomEnabled());

      // Note: this call to CreateWebRenderCommands can recurse back into
      // this function if the |item| is a wrapper for a sublist.