Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gamepad.vibrationActuator: Add support for "trigger-rumble" effect type
https://bugs.webkit.org/show_bug.cgi?id=250352 rdar://104315486 Reviewed by Brent Fulgham and Geoffrey Garen. Gamepad.vibrationActuator: Add support for "trigger-rumble" effect type: - https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/GamepadHapticsActuatorTriggerRumble/explainer.md It allows vibrating the triggers (which the XBox controller supports), while the existing "dual-rumble" only makes the handles vibrate. This isn't yet part of the specification at: - https://w3c.github.io/gamepad/extensions.html#dom-gamepadhapticeffecttype However, it is supported by Blink and used by XBox cloud games. I am adding support behind an experimental feature flag, off by default. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/Modules/gamepad/GamepadEffectParameters.h: * Source/WebCore/Modules/gamepad/GamepadEffectParameters.idl: * Source/WebCore/Modules/gamepad/GamepadHapticActuator.cpp: (WebCore::GamepadHapticActuator::canPlayEffectType const): (WebCore::GamepadHapticActuator::playEffect): (WebCore::GamepadHapticActuator::stopEffects): (WebCore::GamepadHapticActuator::document const): (WebCore::GamepadHapticActuator::promiseForEffectType): * Source/WebCore/Modules/gamepad/GamepadHapticActuator.h: * Source/WebCore/Modules/gamepad/GamepadHapticEffectType.idl: * Source/WebCore/platform/gamepad/cocoa/GameControllerGamepad.mm: (WebCore::GameControllerGamepad::setupElements): * Source/WebCore/platform/gamepad/cocoa/GameControllerHapticEffect.h: * Source/WebCore/platform/gamepad/cocoa/GameControllerHapticEffect.mm: (WebCore::GameControllerHapticEffect::create): (WebCore::GameControllerHapticEffect::GameControllerHapticEffect): (WebCore::GameControllerHapticEffect::start): (WebCore::GameControllerHapticEffect::stop): (WebCore::GameControllerHapticEffect::leftEffectFinishedPlaying): (WebCore::GameControllerHapticEffect::rightEffectFinishedPlaying): (WebCore::GameControllerHapticEffect::strongEffectFinishedPlaying): Deleted. (WebCore::GameControllerHapticEffect::weakEffectFinishedPlaying): Deleted. * Source/WebCore/platform/gamepad/cocoa/GameControllerHapticEngines.h: (WebCore::GameControllerHapticEngines::leftHandleEngine): (WebCore::GameControllerHapticEngines::rightHandleEngine): (WebCore::GameControllerHapticEngines::leftTriggerEngine): (WebCore::GameControllerHapticEngines::rightTriggerEngine): (WebCore::GameControllerHapticEngines::strongEngine): Deleted. (WebCore::GameControllerHapticEngines::weakEngine): Deleted. * Source/WebCore/platform/gamepad/cocoa/GameControllerHapticEngines.mm: (WebCore::GameControllerHapticEngines::GameControllerHapticEngines): (WebCore::GameControllerHapticEngines::currentEffectForType): (WebCore::GameControllerHapticEngines::playEffect): (WebCore::GameControllerHapticEngines::stopEffects): (WebCore::GameControllerHapticEngines::ensureStarted): (WebCore::GameControllerHapticEngines::stop): * Source/WebCore/platform/gamepad/cocoa/GameControllerSoftLink.h: * Source/WebCore/platform/gamepad/cocoa/GameControllerSoftLink.mm: * Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in: Canonical link: https://commits.webkit.org/259507@main
- Loading branch information
Showing
14 changed files
with
252 additions
and
89 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.