Created
February 19, 2019 19:13
-
-
Save staktrace/6b87bd7ba12df80f53552b1e2220b795 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp | |
index d6757151b7f0..8919e03eef4b 100644 | |
--- a/gfx/layers/apz/src/APZCTreeManager.cpp | |
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp | |
@@ -2507,17 +2507,19 @@ already_AddRefed<AsyncPanZoomController> APZCTreeManager::GetAPZCAtPointWR( | |
return result.forget(); | |
} | |
LayersId layersId = wr::AsLayersId(pipelineId); | |
result = GetTargetAPZC(layersId, scrollId); | |
if (!result) { | |
// It falls back to the root | |
MOZ_ASSERT(scrollId == ScrollableLayerGuid::NULL_SCROLL_ID); | |
- result = FindRootApzcForLayersId(layersId); | |
+ HitTestingTreeNode* httn = FindRootHitTestingTreeNodeForLayersId(layersId); | |
+ CSSTransformMatrix theMatrixHenriWants = httn->GetCSSTransformToContent(); | |
+ result = httn->GetNearestContainingApzc(); | |
MOZ_ASSERT(result); | |
} | |
const bool isScrollbar = | |
hitInfo.contains(gfx::CompositorHitTestFlags::eScrollbar); | |
const bool isScrollbarThumb = | |
hitInfo.contains(gfx::CompositorHitTestFlags::eScrollbarThumb); | |
const ScrollDirection direction = | |
@@ -2730,26 +2732,32 @@ AsyncPanZoomController* APZCTreeManager::GetAPZCAtPoint( | |
APZCTM_LOG("Successfully matched APZC %p via node %p (hit result 0x%x)\n", | |
result, resultNode, aOutHitResult->serialize()); | |
return result; | |
} | |
return nullptr; | |
} | |
-AsyncPanZoomController* APZCTreeManager::FindRootApzcForLayersId( | |
+HitTestingTreeNode* APZCTreeManager::FindRootHitTestingTreeNodeForLayersId( | |
LayersId aLayersId) const { | |
mTreeLock.AssertCurrentThreadIn(); | |
HitTestingTreeNode* resultNode = BreadthFirstSearch<ReverseIterator>( | |
mRootNode.get(), [aLayersId](HitTestingTreeNode* aNode) { | |
AsyncPanZoomController* apzc = aNode->GetApzc(); | |
return apzc && apzc->GetLayersId() == aLayersId && | |
apzc->IsRootForLayersId(); | |
}); | |
+ return resultNode; | |
+} | |
+ | |
+AsyncPanZoomController* APZCTreeManager::FindRootApzcForLayersId( | |
+ LayersId aLayersId) const { | |
+ HitTestingTreeNode* resultNode = FindRootHitTestingTreeNodeForLayersId(aLayersId); | |
return resultNode ? resultNode->GetApzc() : nullptr; | |
} | |
AsyncPanZoomController* APZCTreeManager::FindRootContentApzcForLayersId( | |
LayersId aLayersId) const { | |
mTreeLock.AssertCurrentThreadIn(); | |
HitTestingTreeNode* resultNode = BreadthFirstSearch<ReverseIterator>( | |
diff --git a/gfx/layers/apz/src/HitTestingTreeNode.cpp b/gfx/layers/apz/src/HitTestingTreeNode.cpp | |
index 44d547d8faca..958acaf19b20 100644 | |
--- a/gfx/layers/apz/src/HitTestingTreeNode.cpp | |
+++ b/gfx/layers/apz/src/HitTestingTreeNode.cpp | |
@@ -305,16 +305,23 @@ CompositorHitTestInfo HitTestingTreeNode::HitTest( | |
EventRegionsOverride HitTestingTreeNode::GetEventRegionsOverride() const { | |
return mOverride; | |
} | |
const CSSTransformMatrix& HitTestingTreeNode::GetTransform() const { | |
return mTransform; | |
} | |
+const CSSTransformMatrix& HitTestingTreeNode::GetCSSTransformToContent() const { | |
+ if (mParent) { | |
+ return mParent->GetCSSTransformToContent() * mTransform; | |
+ } | |
+ return mTransform; | |
+} | |
+ | |
const LayerIntRegion& HitTestingTreeNode::GetVisibleRegion() const { | |
return mVisibleRegion; | |
} | |
bool HitTestingTreeNode::IsAsyncZoomContainer() const { | |
return mIsAsyncZoomContainer; | |
} | |
diff --git a/gfx/layers/apz/src/HitTestingTreeNode.h b/gfx/layers/apz/src/HitTestingTreeNode.h | |
index 7c27b462b4cf..16b7dee842fd 100644 | |
--- a/gfx/layers/apz/src/HitTestingTreeNode.h | |
+++ b/gfx/layers/apz/src/HitTestingTreeNode.h | |
@@ -134,16 +134,17 @@ class HitTestingTreeNode { | |
const ParentLayerPoint& aPoint, | |
const LayerToParentLayerMatrix4x4& aTransform) const; | |
/* Assuming aPoint is inside the clip region for this node, check which of the | |
* event region spaces it falls inside. */ | |
gfx::CompositorHitTestInfo HitTest(const LayerPoint& aPoint) const; | |
/* Returns the mOverride flag. */ | |
EventRegionsOverride GetEventRegionsOverride() const; | |
const CSSTransformMatrix& GetTransform() const; | |
+ const CSSTransformMatrix& GetCSSTransformToContent() const; | |
const LayerIntRegion& GetVisibleRegion() const; | |
bool IsAsyncZoomContainer() const; | |
/* Debug helpers */ | |
void Dump(const char* aPrefix = "") const; | |
private: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment