Bug 1062437 - Consider all layers associated with an APZC when determining if it should be the parent of another APZC. r=kats, a=bajaj
authorBotond Ballo <botond@mozilla.com>
Wed, 03 Sep 2014 17:22:05 -0400
changeset 224680 a0de2057c32aae223557cd5eab2af92f46f47e9c
parent 224679 5a319373ef016a427b9c84fd355b163aeef1678a
child 224681 13685d3640ffc300d242a15a091de8f5dc375a1d
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, bajaj
bugs1062437
milestone34.0a2
Bug 1062437 - Consider all layers associated with an APZC when determining if it should be the parent of another APZC. r=kats, a=bajaj
gfx/layers/apz/src/APZCTreeManager.cpp
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -326,19 +326,16 @@ APZCTreeManager::PrepareAPZCForLayer(con
     // 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 == aState.mOriginatingLayersId && apzc->GetParent()) {
       aState.mPaintLogger.LogTestData(aMetrics.GetScrollId(), "parentScrollId",
           apzc->GetParent()->GetGuid().mScrollId);
     }
 
-    // Let this apzc be the parent of other controllers when we recurse downwards
-    aOutParent = 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
         ZoomConstraints constraints;
         if (state->mController->GetRootZoomConstraints(&constraints)) {
           apzc->UpdateZoomConstraints(constraints);
@@ -369,16 +366,19 @@ APZCTreeManager::PrepareAPZCForLayer(con
     // async transform and so we basically assume the same amount of C is always visible
     // on top of B. Fixing this doesn't appear to be very easy so I'm leaving it for
     // now in the hopes that we won't run into this problem a lot.
     nsIntRegion unobscured = ComputeTouchSensitiveRegion(state->mController, aMetrics, aObscured);
     apzc->AddHitTestRegion(unobscured);
     APZCTM_LOG("Adding region %s to visible region of APZC %p\n", Stringify(unobscured).c_str(), apzc);
   }
 
+  // Let this apzc be the parent of other controllers when we recurse downwards
+  aOutParent = apzc;
+
   return apzc;
 }
 
 AsyncPanZoomController*
 APZCTreeManager::UpdatePanZoomControllerTree(TreeBuildingState& aState,
                                              const LayerMetricsWrapper& aLayer,
                                              uint64_t aLayersId,
                                              const gfx::Matrix4x4& aAncestorTransform,