Bug 961289 - Log APZC tree parent links on compositor side for APZ testing. r=kats
authorBotond Ballo <botond@mozilla.com>
Mon, 21 Apr 2014 17:47:33 -0400
changeset 195757 d24910545fbe70f1a662eb686fe99336d1b7c818
parent 195756 0289c6b78933e2a4c6f92509c35fbeff471584cc
child 195758 043b5bcd7bc1f419332b6ba35c5181c1149369cd
push id5990
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:40:24 +0000
treeherdermozilla-aurora@0796197efbc9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs961289
milestone32.0a1
Bug 961289 - Log APZC tree parent links on compositor side for APZ testing. r=kats
gfx/layers/apz/src/APZCTreeManager.cpp
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -262,16 +262,27 @@ APZCTreeManager::UpdatePanZoomController
           aNextSibling->SetPrevSibling(apzc);
         } else if (aParent) {
           aParent->SetLastChild(apzc);
         } else {
           mRootApzc = apzc;
           apzc->MakeRoot();
         }
 
+        // For testing, log the parent scroll id of every APZC that has a
+        // parent. This allows test code to reconstruct the APZC tree.
+        // Note that we currently only do this for APZCs in the layer tree
+        // that originated the update, because the only identifying information
+        // we are logging about APZCs is the scroll id, and otherwise we could
+        // confuse APZCs from different layer trees with the same scroll id.
+        if (aLayersId == aOriginatingLayersId && apzc->GetParent()) {
+          aPaintLogger.LogTestData(metrics.GetScrollId(), "parentScrollId",
+              apzc->GetParent()->GetGuid().mScrollId);
+        }
+
         // Let this apzc be the parent of other controllers when we recurse downwards
         aParent = apzc;
 
         if (newApzc) {
           if (apzc->IsRootForLayersId()) {
             // If we just created a new apzc that is the root for its layers ID, then
             // we need to update its zoom constraints which might have arrived before this
             // was created