Bug 1552608 - Remove the 'aNode' parameter of GetAPZCAtPoint(). r=tnikkel
authorBotond Ballo <botond@mozilla.com>
Mon, 07 Oct 2019 22:00:59 +0000
changeset 496704 50fb72cc4a73351db1d17bb4970f007f55348962
parent 496703 ff8e1fa23dea4b16e6b6b6925a723211d5488068
child 496705 5482a581ab190f9b18c06d517cce575892ba0df7
push id97377
push userbballo@mozilla.com
push dateTue, 08 Oct 2019 01:21:05 +0000
treeherderautoland@6506806b3bf8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1552608
milestone71.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1552608 - Remove the 'aNode' parameter of GetAPZCAtPoint(). r=tnikkel This is a relic from earlier times when GetAPZCAtPoint() was recursive. Differential Revision: https://phabricator.services.mozilla.com/D48380
gfx/layers/apz/src/APZCTreeManager.cpp
gfx/layers/apz/src/APZCTreeManager.h
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -2583,18 +2583,17 @@ already_AddRefed<AsyncPanZoomController>
   RecursiveMutexAutoLock lock(mTreeLock);
 
   CompositorHitTestInfo hitResult;
   HitTestingTreeNode* scrollbarNode = nullptr;
   RefPtr<AsyncPanZoomController> target;
   if (gfx::gfxVars::UseWebRender()) {
     target = GetAPZCAtPointWR(aPoint, &hitResult, aOutLayersId, &scrollbarNode);
   } else {
-    target = GetAPZCAtPoint(mRootNode, aPoint, &hitResult, aOutLayersId,
-                            &scrollbarNode);
+    target = GetAPZCAtPoint(aPoint, &hitResult, aOutLayersId, &scrollbarNode);
   }
 
   if (aOutHitResult) {
     *aOutHitResult = hitResult;
   }
   if (aOutScrollbarNode && scrollbarNode) {
     RefPtr<HitTestingTreeNode> scrollbarRef = scrollbarNode;
     aOutScrollbarNode->Initialize(lock, scrollbarRef.forget(), mTreeLock);
@@ -2773,25 +2772,24 @@ AsyncPanZoomController* APZCTreeManager:
                  fpTarget.get(), n->GetFixedPosTarget());
       return fpTarget.get();
     }
   }
   return nullptr;
 }
 
 AsyncPanZoomController* APZCTreeManager::GetAPZCAtPoint(
-    HitTestingTreeNode* aNode, const ScreenPoint& aHitTestPoint,
-    CompositorHitTestInfo* aOutHitResult, LayersId* aOutLayersId,
-    HitTestingTreeNode** aOutScrollbarNode) {
+    const ScreenPoint& aHitTestPoint, CompositorHitTestInfo* aOutHitResult,
+    LayersId* aOutLayersId, HitTestingTreeNode** aOutScrollbarNode) {
   mTreeLock.AssertCurrentThreadIn();
 
   // This walks the tree in depth-first, reverse order, so that it encounters
   // APZCs front-to-back on the screen.
   HitTestingTreeNode* resultNode;
-  HitTestingTreeNode* root = aNode;
+  HitTestingTreeNode* root = mRootNode;
   std::stack<LayerPoint> hitTestPoints;
   ParentLayerPoint point = ViewAs<ParentLayerPixel>(
       aHitTestPoint, PixelCastJustification::ScreenIsParentLayerForRoot);
   hitTestPoints.push(
       ViewAs<LayerPixel>(point, PixelCastJustification::MovingDownToChildren));
 
   ForEachNode<ReverseIterator>(
       root,
--- a/gfx/layers/apz/src/APZCTreeManager.h
+++ b/gfx/layers/apz/src/APZCTreeManager.h
@@ -610,17 +610,17 @@ class APZCTreeManager : public IAPZCTree
       const ScrollableLayerGuid& aGuid);
   already_AddRefed<HitTestingTreeNode> GetTargetNode(
       const ScrollableLayerGuid& aGuid, GuidComparator aComparator) const;
   HitTestingTreeNode* FindTargetNode(HitTestingTreeNode* aNode,
                                      const ScrollableLayerGuid& aGuid,
                                      GuidComparator aComparator);
   AsyncPanZoomController* GetTargetApzcForNode(HitTestingTreeNode* aNode);
   AsyncPanZoomController* GetAPZCAtPoint(
-      HitTestingTreeNode* aNode, const ScreenPoint& aHitTestPoint,
+      const ScreenPoint& aHitTestPoint,
       gfx::CompositorHitTestInfo* aOutHitResult, LayersId* aOutLayersId,
       HitTestingTreeNode** aOutScrollbarNode);
   already_AddRefed<AsyncPanZoomController> GetAPZCAtPointWR(
       const ScreenPoint& aHitTestPoint,
       gfx::CompositorHitTestInfo* aOutHitResult, LayersId* aOutLayersId,
       HitTestingTreeNode** aOutScrollbarNode);
   AsyncPanZoomController* FindRootApzcForLayersId(LayersId aLayersId) const;
   AsyncPanZoomController* FindRootContentApzcForLayersId(