Bug 1405359 - Add some logging code in ScrollingLayersHelper. r?jrmuizel draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 24 Oct 2017 18:47:24 -0400
changeset 685850 3c0c540cb1be66a21feb6445a84000aa8118e954
parent 685849 ee406b85224d8d5bbc19a8e00edf14e76e90bf77
child 737228 bd2b2334fa96cf7504738428c3202ad7eb91dd6d
push id86016
push userkgupta@mozilla.com
push dateWed, 25 Oct 2017 01:53:44 +0000
reviewersjrmuizel
bugs1405359
milestone58.0a1
Bug 1405359 - Add some logging code in ScrollingLayersHelper. r?jrmuizel MozReview-Commit-ID: Lb4UeUxO5HL
gfx/layers/wr/ScrollingLayersHelper.cpp
--- a/gfx/layers/wr/ScrollingLayersHelper.cpp
+++ b/gfx/layers/wr/ScrollingLayersHelper.cpp
@@ -7,16 +7,19 @@
 
 #include "DisplayItemClipChain.h"
 #include "FrameMetrics.h"
 #include "mozilla/layers/StackingContextHelper.h"
 #include "mozilla/webrender/WebRenderAPI.h"
 #include "nsDisplayList.h"
 #include "UnitTransforms.h"
 
+#define SLH_LOG(...)
+//#define SLH_LOG(...) printf_stderr("SLH: " __VA_ARGS__)
+
 namespace mozilla {
 namespace layers {
 
 ScrollingLayersHelper::ScrollingLayersHelper()
   : mBuilder(nullptr)
 {
 }
 
@@ -50,22 +53,25 @@ ScrollingLayersHelper::EndList()
   mItemClipStack.back().Unapply(mBuilder);
   mItemClipStack.pop_back();
 }
 
 void
 ScrollingLayersHelper::BeginItem(nsDisplayItem* aItem,
                                  const StackingContextHelper& aStackingContext)
 {
+  SLH_LOG("processing item %p\n", aItem);
+
   ItemClips clips(aItem->GetActiveScrolledRoot(), aItem->GetClipChain());
   MOZ_ASSERT(!mItemClipStack.empty());
   if (clips.HasSameInputs(mItemClipStack.back())) {
     // Early-exit because if the clips are the same then we don't need to do
     // do the work of popping the old stuff and then pushing it right back on
     // for the new item.
+    SLH_LOG("early-exit for %p\n", aItem);
     return;
   }
   mItemClipStack.back().Unapply(mBuilder);
   mItemClipStack.pop_back();
 
   int32_t auPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
 
   // There are two ASR chains here that we need to be fully defined. One is the
@@ -125,16 +131,18 @@ ScrollingLayersHelper::BeginItem(nsDispl
     if (!clipId) {
       clipId = mBuilder->TopmostClipId();
     }
     clips.mClipAndScroll = Some(std::make_pair(scrollId, clipId));
   }
 
   clips.Apply(mBuilder);
   mItemClipStack.push_back(clips);
+
+  SLH_LOG("done setup for %p\n", aItem);
 }
 
 std::pair<Maybe<FrameMetrics::ViewID>, Maybe<wr::WrClipId>>
 ScrollingLayersHelper::DefineClipChain(nsDisplayItem* aItem,
                                        const ActiveScrolledRoot* aAsr,
                                        const DisplayItemClipChain* aChain,
                                        int32_t aAppUnitsPerDevPixel,
                                        const StackingContextHelper& aStackingContext)