Bug 1548568 - Cleanup to stop passing around a guid when we only need a layers id. r=botond

Differential Revision: https://phabricator.services.mozilla.com/D29687

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2019-05-06 21:03:49 +00:00
Родитель 17fc92a0ff
Коммит cc1a6e393f
4 изменённых файлов: 13 добавлений и 13 удалений

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

@ -1634,7 +1634,7 @@ void BrowserChild::HandleRealMouseButtonEvent(const WidgetMouseEvent& aEvent,
if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
nsCOMPtr<Document> document(GetTopLevelDocument());
postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
mPuppetWidget, document, aEvent, aGuid, aInputBlockId);
mPuppetWidget, document, aEvent, aGuid.mLayersId, aInputBlockId);
}
InputAPZContext context(aGuid, aInputBlockId, nsEventStatus_eIgnore,
@ -1727,7 +1727,7 @@ void BrowserChild::DispatchWheelEvent(const WidgetWheelEvent& aEvent,
nsCOMPtr<Document> document(GetTopLevelDocument());
UniquePtr<DisplayportSetListener> postLayerization =
APZCCallbackHelper::SendSetTargetAPZCNotification(
mPuppetWidget, document, aEvent, aGuid, aInputBlockId);
mPuppetWidget, document, aEvent, aGuid.mLayersId, aInputBlockId);
if (postLayerization && postLayerization->Register()) {
Unused << postLayerization.release();
}
@ -1800,7 +1800,7 @@ mozilla::ipc::IPCResult BrowserChild::RecvRealTouchEvent(
}
UniquePtr<DisplayportSetListener> postLayerization =
APZCCallbackHelper::SendSetTargetAPZCNotification(
mPuppetWidget, document, localEvent, aGuid, aInputBlockId);
mPuppetWidget, document, localEvent, aGuid.mLayersId, aInputBlockId);
if (postLayerization && postLayerization->Register()) {
Unused << postLayerization.release();
}

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

@ -663,10 +663,10 @@ using FrameForPointOption = nsLayoutUtils::FrameForPointOption;
// the target list. If the frame doesn't have a displayport, set one.
// Return whether or not a displayport was set.
static bool PrepareForSetTargetAPZCNotification(
nsIWidget* aWidget, const ScrollableLayerGuid& aGuid, nsIFrame* aRootFrame,
nsIWidget* aWidget, const LayersId& aLayersId, nsIFrame* aRootFrame,
const LayoutDeviceIntPoint& aRefPoint,
nsTArray<SLGuidAndRenderRoot>* aTargets) {
SLGuidAndRenderRoot guid(aGuid.mLayersId, 0,
SLGuidAndRenderRoot guid(aLayersId, 0,
ScrollableLayerGuid::NULL_SCROLL_ID,
wr::RenderRoot::Default);
nsPoint point = nsLayoutUtils::GetEventCoordinatesRelativeTo(
@ -820,7 +820,7 @@ void DisplayportSetListener::DidRefresh() {
UniquePtr<DisplayportSetListener>
APZCCallbackHelper::SendSetTargetAPZCNotification(
nsIWidget* aWidget, dom::Document* aDocument, const WidgetGUIEvent& aEvent,
const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) {
const LayersId& aLayersId, uint64_t aInputBlockId) {
if (!aWidget || !aDocument) {
return nullptr;
}
@ -846,15 +846,15 @@ APZCCallbackHelper::SendSetTargetAPZCNotification(
if (const WidgetTouchEvent* touchEvent = aEvent.AsTouchEvent()) {
for (size_t i = 0; i < touchEvent->mTouches.Length(); i++) {
waitForRefresh |= PrepareForSetTargetAPZCNotification(
aWidget, aGuid, rootFrame, touchEvent->mTouches[i]->mRefPoint,
aWidget, aLayersId, rootFrame, touchEvent->mTouches[i]->mRefPoint,
&targets);
}
} else if (const WidgetWheelEvent* wheelEvent = aEvent.AsWheelEvent()) {
waitForRefresh = PrepareForSetTargetAPZCNotification(
aWidget, aGuid, rootFrame, wheelEvent->mRefPoint, &targets);
aWidget, aLayersId, rootFrame, wheelEvent->mRefPoint, &targets);
} else if (const WidgetMouseEvent* mouseEvent = aEvent.AsMouseEvent()) {
waitForRefresh = PrepareForSetTargetAPZCNotification(
aWidget, aGuid, rootFrame, mouseEvent->mRefPoint, &targets);
aWidget, aLayersId, rootFrame, mouseEvent->mRefPoint, &targets);
}
// TODO: Do other types of events need to be handled?

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

@ -167,7 +167,7 @@ class APZCCallbackHelper {
*/
static UniquePtr<DisplayportSetListener> SendSetTargetAPZCNotification(
nsIWidget* aWidget, mozilla::dom::Document* aDocument,
const WidgetGUIEvent& aEvent, const ScrollableLayerGuid& aGuid,
const WidgetGUIEvent& aEvent, const LayersId& aLayersId,
uint64_t aInputBlockId);
/* Figure out the allowed touch behaviors of each touch point in |aEvent|

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

@ -983,7 +983,7 @@ nsEventStatus nsBaseWidget::ProcessUntransformedAPZEvent(
mSetAllowedTouchBehaviorCallback);
}
postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
this, GetDocument(), *(original->AsTouchEvent()), aGuid,
this, GetDocument(), *(original->AsTouchEvent()), aGuid.mLayersId,
aInputBlockId);
}
mAPZEventState->ProcessTouchEvent(*touchEvent, aGuid, aInputBlockId,
@ -991,7 +991,7 @@ nsEventStatus nsBaseWidget::ProcessUntransformedAPZEvent(
} else if (WidgetWheelEvent* wheelEvent = aEvent->AsWheelEvent()) {
MOZ_ASSERT(wheelEvent->mFlags.mHandledByAPZ);
postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
this, GetDocument(), *(original->AsWheelEvent()), aGuid,
this, GetDocument(), *(original->AsWheelEvent()), aGuid.mLayersId,
aInputBlockId);
if (wheelEvent->mCanTriggerSwipe) {
ReportSwipeStarted(aInputBlockId, wheelEvent->TriggersSwipe());
@ -1000,7 +1000,7 @@ nsEventStatus nsBaseWidget::ProcessUntransformedAPZEvent(
} else if (WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent()) {
MOZ_ASSERT(mouseEvent->mFlags.mHandledByAPZ);
postLayerization = APZCCallbackHelper::SendSetTargetAPZCNotification(
this, GetDocument(), *(original->AsMouseEvent()), aGuid,
this, GetDocument(), *(original->AsMouseEvent()), aGuid.mLayersId,
aInputBlockId);
mAPZEventState->ProcessMouseEvent(*mouseEvent, aGuid, aInputBlockId);
}