Bug 1364622 - Consider async transforms on scroll thumb layers during hit testing. r=kats

MozReview-Commit-ID: 9avcNOKmmqF

--HG--
extra : rebase_source : 0f21e336171cc369ff9bb98caa484d5f64e87c5a
This commit is contained in:
Botond Ballo 2017-05-15 20:18:48 -04:00
Родитель b1bad294f4
Коммит 600ec000fe
1 изменённых файлов: 29 добавлений и 6 удалений

Просмотреть файл

@ -2208,12 +2208,35 @@ APZCTreeManager::CommonAncestor(AsyncPanZoomController* aApzc1, AsyncPanZoomCont
LayerToParentLayerMatrix4x4
APZCTreeManager::ComputeTransformForNode(const HitTestingTreeNode* aNode) const
{
AsyncPanZoomController* apzc = aNode->GetApzc();
return aNode->GetTransform() *
CompleteAsyncTransform(
apzc
? apzc->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::NORMAL)
: AsyncTransformComponentMatrix());
if (AsyncPanZoomController* apzc = aNode->GetApzc()) {
// If the node represents scrollable content, apply the async transform
// from its APZC.
return aNode->GetTransform() *
CompleteAsyncTransform(
apzc->GetCurrentAsyncTransformWithOverscroll(AsyncPanZoomController::NORMAL));
} else if (aNode->IsScrollThumbNode()) {
// If the node represents a scrollbar thumb, compute and apply the
// transformation that will be applied to the thumb in
// AsyncCompositionManager.
ScrollableLayerGuid guid{aNode->GetLayersId(), 0, aNode->GetScrollTargetId()};
if (RefPtr<HitTestingTreeNode> scrollTargetNode = GetTargetNode(guid, &GuidComparatorIgnoringPresShell)) {
AsyncPanZoomController* scrollTargetApzc = scrollTargetNode->GetApzc();
MOZ_ASSERT(scrollTargetApzc);
return scrollTargetApzc->CallWithLastContentPaintMetrics(
[&](const FrameMetrics& aMetrics) {
return AsyncCompositionManager::ComputeTransformForScrollThumb(
aNode->GetTransform() * AsyncTransformMatrix(),
scrollTargetNode->GetTransform().ToUnknownMatrix(),
scrollTargetApzc,
aMetrics,
aNode->GetScrollThumbData(),
scrollTargetNode->IsAncestorOf(aNode),
nullptr);
});
}
}
// Otherwise, the node does not have an async transform.
return aNode->GetTransform() * AsyncTransformMatrix();
}
#if defined(MOZ_WIDGET_ANDROID)