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;
}
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<AsyncPanZoomController*>(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) {

View File

@ -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