Bug 1062545 - Print APZC info beside each layer associated with the APZC in the tree log. r=BenWa

This commit is contained in:
Botond Ballo 2014-09-03 16:50:50 -04:00
parent 3f8ed79ff5
commit ae0af80be2
2 changed files with 16 additions and 6 deletions

View File

@ -207,6 +207,18 @@ ComputeTouchSensitiveRegion(GeckoContentController* aController,
return unobscured; 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* AsyncPanZoomController*
APZCTreeManager::PrepareAPZCForLayer(const LayerMetricsWrapper& aLayer, APZCTreeManager::PrepareAPZCForLayer(const LayerMetricsWrapper& aLayer,
const FrameMetrics& aMetrics, const FrameMetrics& aMetrics,
@ -239,6 +251,7 @@ APZCTreeManager::PrepareAPZCForLayer(const LayerMetricsWrapper& aLayer,
auto insertResult = aState.mApzcMap.insert(std::make_pair(guid, static_cast<AsyncPanZoomController*>(nullptr))); auto insertResult = aState.mApzcMap.insert(std::make_pair(guid, static_cast<AsyncPanZoomController*>(nullptr)));
if (!insertResult.second) { if (!insertResult.second) {
apzc = insertResult.first->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); 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", APZCTM_LOG("Setting region %s as visible region for APZC %p\n",
Stringify(unobscured).c_str(), apzc); Stringify(unobscured).c_str(), apzc);
mApzcTreeLog << "APZC " << guid PrintAPZCInfo(aLayer, apzc);
<< "\tcb=" << aMetrics.mCompositionBounds
<< "\tsr=" << aMetrics.mScrollableRect
<< (aLayer.GetVisibleRegion().IsEmpty() ? "\tscrollinfo" : "")
<< (apzc->HasScrollgrab() ? "\tscrollgrab" : "")
<< "\t" << aMetrics.GetContentDescription().get();
// Bind the APZC instance into the tree of APZCs // Bind the APZC instance into the tree of APZCs
if (aNextSibling) { if (aNextSibling) {

View File

@ -407,6 +407,8 @@ private:
AsyncPanZoomController* aNextSibling, AsyncPanZoomController* aNextSibling,
const nsIntRegion& aObscured); const nsIntRegion& aObscured);
void PrintAPZCInfo(const LayerMetricsWrapper& aLayer,
const AsyncPanZoomController* apzc);
private: private:
/* Whenever walking or mutating the tree rooted at mRootApzc, mTreeLock must be held. /* 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 * This lock does not need to be held while manipulating a single APZC instance in