diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /gfx/layers/ipc/RemoteContentController.cpp | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/layers/ipc/RemoteContentController.cpp')
-rw-r--r-- | gfx/layers/ipc/RemoteContentController.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/gfx/layers/ipc/RemoteContentController.cpp b/gfx/layers/ipc/RemoteContentController.cpp index 682331362b..8c6ab22acd 100644 --- a/gfx/layers/ipc/RemoteContentController.cpp +++ b/gfx/layers/ipc/RemoteContentController.cpp @@ -62,7 +62,7 @@ void RemoteContentController::RequestContentRepaint( } } -void RemoteContentController::HandleTapOnMainThread( +void RemoteContentController::HandleTapOnParentProcessMainThread( TapType aTapType, LayoutDevicePoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid, uint64_t aInputBlockId, const Maybe<DoubleTapToZoomMetrics>& aDoubleTapToZoomMetrics) { @@ -78,20 +78,19 @@ void RemoteContentController::HandleTapOnMainThread( } } -void RemoteContentController::HandleTapOnCompositorThread( +void RemoteContentController::HandleTapOnGPUProcessMainThread( TapType aTapType, LayoutDevicePoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid, uint64_t aInputBlockId, const Maybe<DoubleTapToZoomMetrics>& aDoubleTapToZoomMetrics) { MOZ_ASSERT(XRE_IsGPUProcess()); - MOZ_ASSERT(mCompositorThread->IsOnCurrentThread()); + MOZ_ASSERT(NS_IsMainThread()); - // The raw pointer to APZCTreeManagerParent is ok here because we are on - // the compositor thread. - APZCTreeManagerParent* apzctmp = - CompositorBridgeParent::GetApzcTreeManagerParentForRoot(aGuid.mLayersId); - if (apzctmp) { - Unused << apzctmp->SendHandleTap(aTapType, aPoint, aModifiers, aGuid, - aInputBlockId, aDoubleTapToZoomMetrics); + // Send a message to the controller thread to handle the single-tap gesture. + APZInputBridgeParent* apzib = + CompositorBridgeParent::GetApzInputBridgeParentForRoot(aGuid.mLayersId); + if (apzib) { + Unused << apzib->SendHandleTap(aTapType, aPoint, aModifiers, aGuid, + aInputBlockId, aDoubleTapToZoomMetrics); } } @@ -103,19 +102,18 @@ void RemoteContentController::HandleTap( APZThreadUtils::AssertOnControllerThread(); if (XRE_GetProcessType() == GeckoProcessType_GPU) { - if (mCompositorThread->IsOnCurrentThread()) { - HandleTapOnCompositorThread(aTapType, aPoint, aModifiers, aGuid, - aInputBlockId, aDoubleTapToZoomMetrics); + if (NS_IsMainThread()) { + HandleTapOnGPUProcessMainThread(aTapType, aPoint, aModifiers, aGuid, + aInputBlockId, aDoubleTapToZoomMetrics); } else { - // We have to send messages from the compositor thread - mCompositorThread->Dispatch( - NewRunnableMethod<TapType, LayoutDevicePoint, Modifiers, - ScrollableLayerGuid, uint64_t, - Maybe<DoubleTapToZoomMetrics>>( - "layers::RemoteContentController::HandleTapOnCompositorThread", - this, &RemoteContentController::HandleTapOnCompositorThread, - aTapType, aPoint, aModifiers, aGuid, aInputBlockId, - aDoubleTapToZoomMetrics)); + NS_DispatchToMainThread(NewRunnableMethod<TapType, LayoutDevicePoint, + Modifiers, ScrollableLayerGuid, + uint64_t, + Maybe<DoubleTapToZoomMetrics>>( + "layers::RemoteContentController::HandleTapOnGPUProcessMainThread", + this, &RemoteContentController::HandleTapOnGPUProcessMainThread, + aTapType, aPoint, aModifiers, aGuid, aInputBlockId, + aDoubleTapToZoomMetrics)); } return; } @@ -123,8 +121,8 @@ void RemoteContentController::HandleTap( MOZ_ASSERT(XRE_IsParentProcess()); if (NS_IsMainThread()) { - HandleTapOnMainThread(aTapType, aPoint, aModifiers, aGuid, aInputBlockId, - aDoubleTapToZoomMetrics); + HandleTapOnParentProcessMainThread(aTapType, aPoint, aModifiers, aGuid, + aInputBlockId, aDoubleTapToZoomMetrics); } else { // We must be on Android, running on the Java UI thread #ifndef MOZ_WIDGET_ANDROID @@ -138,13 +136,15 @@ void RemoteContentController::HandleTap( // using NS_DispatchToMainThread would post to a different message loop, // and introduces the possibility of this tap event getting processed // out of order with respect to the touch events that synthesized it. - mozilla::jni::DispatchToGeckoPriorityQueue( - NewRunnableMethod<TapType, LayoutDevicePoint, Modifiers, - ScrollableLayerGuid, uint64_t, - Maybe<DoubleTapToZoomMetrics>>( - "layers::RemoteContentController::HandleTapOnMainThread", this, - &RemoteContentController::HandleTapOnMainThread, aTapType, aPoint, - aModifiers, aGuid, aInputBlockId, aDoubleTapToZoomMetrics)); + mozilla::jni::DispatchToGeckoPriorityQueue(NewRunnableMethod< + TapType, LayoutDevicePoint, + Modifiers, ScrollableLayerGuid, + uint64_t, + Maybe<DoubleTapToZoomMetrics>>( + "layers::RemoteContentController::HandleTapOnParentProcessMainThread", + this, &RemoteContentController::HandleTapOnParentProcessMainThread, + aTapType, aPoint, aModifiers, aGuid, aInputBlockId, + aDoubleTapToZoomMetrics)); #endif } } |