From ae0af80be25df1c6bbfdda248921ee583e973e0b Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Wed, 3 Sep 2014 16:50:50 -0400 Subject: [PATCH] Bug 1062545 - Print APZC info beside each layer associated with the APZC in the tree log. r=BenWa --- gfx/layers/apz/src/APZCTreeManager.cpp | 20 ++++++++++++++------ gfx/layers/apz/src/APZCTreeManager.h | 2 ++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index 9fd2e71ee55..606c3fb7236 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -207,6 +207,18 @@ ComputeTouchSensitiveRegion(GeckoContentController* aController, return unobscured; } +void +APZCTreeManager::PrintAPZCInfo(const LayerMetricsWrapper& aLayer, + const AsyncPanZoomController* apzc) +{ + const FrameMetrics& metrics = aLayer.Metrics(); + mApzcTreeLog << "APZC " << apzc->GetGuid() << "\tcb=" << metrics.mCompositionBounds + << "\tsr=" << metrics.mScrollableRect + << (aLayer.IsScrollInfoLayer() ? "\tscrollinfo" : "") + << (apzc->HasScrollgrab() ? "\tscrollgrab" : "") << "\t" + << metrics.GetContentDescription().get(); +} + AsyncPanZoomController* APZCTreeManager::PrepareAPZCForLayer(const LayerMetricsWrapper& aLayer, const FrameMetrics& aMetrics, @@ -239,6 +251,7 @@ APZCTreeManager::PrepareAPZCForLayer(const LayerMetricsWrapper& aLayer, auto insertResult = aState.mApzcMap.insert(std::make_pair(guid, static_cast(nullptr))); if (!insertResult.second) { apzc = insertResult.first->second; + PrintAPZCInfo(aLayer, apzc); } APZCTM_LOG("Found APZC %p for layer %p with identifiers %lld %lld\n", apzc, aLayer.GetLayer(), guid.mLayersId, guid.mScrollId); @@ -303,12 +316,7 @@ APZCTreeManager::PrepareAPZCForLayer(const LayerMetricsWrapper& aLayer, APZCTM_LOG("Setting region %s as visible region for APZC %p\n", Stringify(unobscured).c_str(), apzc); - mApzcTreeLog << "APZC " << guid - << "\tcb=" << aMetrics.mCompositionBounds - << "\tsr=" << aMetrics.mScrollableRect - << (aLayer.GetVisibleRegion().IsEmpty() ? "\tscrollinfo" : "") - << (apzc->HasScrollgrab() ? "\tscrollgrab" : "") - << "\t" << aMetrics.GetContentDescription().get(); + PrintAPZCInfo(aLayer, apzc); // Bind the APZC instance into the tree of APZCs if (aNextSibling) { diff --git a/gfx/layers/apz/src/APZCTreeManager.h b/gfx/layers/apz/src/APZCTreeManager.h index ce6b668c850..9e3c0e5242c 100644 --- a/gfx/layers/apz/src/APZCTreeManager.h +++ b/gfx/layers/apz/src/APZCTreeManager.h @@ -407,6 +407,8 @@ private: AsyncPanZoomController* aNextSibling, const nsIntRegion& aObscured); + void PrintAPZCInfo(const LayerMetricsWrapper& aLayer, + const AsyncPanZoomController* apzc); private: /* Whenever walking or mutating the tree rooted at mRootApzc, mTreeLock must be held. * This lock does not need to be held while manipulating a single APZC instance in