Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WPE] Add gamepad support #911

Merged
merged 1 commit into from
Aug 24, 2022
Merged

Conversation

ceyusa
Copy link
Contributor

@ceyusa ceyusa commented May 23, 2022

ab0e247

[WPE] Add gamepad support
https://bugs.webkit.org/show_bug.cgi?id=230630

With gamepad support in libwpe[1] is possible to communicate gamepads events between the
application (cog, for example) and WPEWebKit. This patch are the changes required to attend that
communication and enable the gamepad support in WPE port.

1. WebPlatformForEmbedded/libwpe#88

Reviewed by Adrian Perez de Castro.

* LayoutTests/platform/wpe/TestExpectations: Enable skipped tests.
* Source/WebCore/PlatformWPE.cmake: Add headers if enabled.
* Source/WebCore/SourcesWPE.txt: Add source files.
* Source/WebCore/platform/gamepad/wpe/WPEGamepad.cpp: Added.
(WebCore::WPEGamepad::WPEGamepad):
(WebCore::WPEGamepad::~WPEGamepad):
(WebCore::WPEGamepad::buttonPressedOrReleased):
(WebCore::WPEGamepad::absoluteAxisChanged):
* Source/WebCore/platform/gamepad/wpe/WPEGamepad.h: Added.
* Source/WebCore/platform/gamepad/wpe/WPEGamepadProvider.cpp: Added.
(WebCore::WPEGamepadProvider::singleton):
(WebCore::WPEGamepadProvider::WPEGamepadProvider):
(WebCore::WPEGamepadProvider::~WPEGamepadProvider):
(WebCore::WPEGamepadProvider::startMonitoringGamepads):
(WebCore::WPEGamepadProvider::stopMonitoringGamepads):
(WebCore::WPEGamepadProvider::gamepadConnected):
(WebCore::WPEGamepadProvider::gamepadDisconnected):
(WebCore::WPEGamepadProvider::indexForNewlyConnectedDevice):
(WebCore::WPEGamepadProvider::removeGamepadForId):
(WebCore::WPEGamepadProvider::initialGamepadsConnectedTimerFired):
(WebCore::WPEGamepadProvider::inputNotificationTimerFired):
(WebCore::WPEGamepadProvider::scheduleInputNotification):
(WebCore::WPEGamepadProvider::inputView):
* Source/WebCore/platform/gamepad/wpe/WPEGamepadProvider.h: Added.
* Source/WebKit/SourcesWPE.txt: Add source files.
* Source/WebKit/UIProcess/API/wpe/WPEView.cpp: Reports the view where gamepad currently operates.
(WKWPE::m_backend):
(WKWPE::View::~View):
(WKWPE::View::setViewState):
(WKWPE::View::platformWebPageProxyForGamepadInput):
* Source/WebKit/UIProcess/API/wpe/WPEView.h:
* Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.cpp:
* Source/WebKit/UIProcess/Gamepad/wpe/UIGamepadProviderWPE.cpp: Added.
(WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
(WebKit::UIGamepadProvider::platformStopMonitoringInput):
(WebKit::UIGamepadProvider::platformStartMonitoringInput):
* Source/cmake/OptionsWPE.cmake:

Canonical link: https://commits.webkit.org/253720@main

90e79f0

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 🧪 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-debug ✅ 🛠 gtk ✅ 🛠 wincairo
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🛠 mac-AS-debug ✅ 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 api-mac ❌ 🧪 api-gtk
✅ 🛠 🧪 jsc ✅ 🛠 tv ✅ 🧪 mac-wk1 ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ✅ 🧪 mac-wk2 ✅ 🧪 jsc-armv7-tests
✅ 🛠 🧪 merge ✅ 🛠 watch ✅ 🧪 mac-AS-debug-wk2 ✅ 🛠 jsc-mips
✅ 🛠 watch-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 jsc-mips-tests

@ceyusa ceyusa self-assigned this May 23, 2022
@ceyusa ceyusa added WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit). WebKit Nightly Build labels May 23, 2022
@ceyusa ceyusa changed the title https://bugs.webkit.org/show_bug.cgi?id=230630 [WPE] Add gamepad support May 23, 2022
@ceyusa ceyusa requested a review from aperezdc May 23, 2022 12:29
@webkit-early-warning-system webkit-early-warning-system added the merging-blocked Applied to prevent a change from being merged label May 23, 2022
@ceyusa ceyusa removed the merging-blocked Applied to prevent a change from being merged label Jul 12, 2022
@ceyusa ceyusa force-pushed the 230630 branch 2 times, most recently from 1ba8388 to 62a3f67 Compare July 14, 2022 17:35
@ceyusa ceyusa requested review from a team, zdobersek and cdumez as code owners August 10, 2022 17:33
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 10, 2022
@ceyusa ceyusa removed the merging-blocked Applied to prevent a change from being merged label Aug 22, 2022
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Aug 22, 2022
Copy link
Contributor

@aperezdc aperezdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a couple of touch-ups before landing, but it is almost ready.

Source/cmake/OptionsWPE.cmake Outdated Show resolved Hide resolved
Source/WebCore/platform/gamepad/wpe/WPEGamepadProvider.cpp Outdated Show resolved Hide resolved
Source/cmake/OptionsWPE.cmake Outdated Show resolved Hide resolved
Source/cmake/OptionsWPE.cmake Outdated Show resolved Hide resolved
@ceyusa ceyusa removed the merging-blocked Applied to prevent a change from being merged label Aug 23, 2022
Copy link
Contributor

@aperezdc aperezdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@ceyusa ceyusa added the merge-queue Applied to send a pull request to merge-queue label Aug 24, 2022
https://bugs.webkit.org/show_bug.cgi?id=230630

With gamepad support in libwpe[1] is possible to communicate gamepads events between the
application (cog, for example) and WPEWebKit. This patch are the changes required to attend that
communication and enable the gamepad support in WPE port.

1. WebPlatformForEmbedded/libwpe#88

Reviewed by Adrian Perez de Castro.

* LayoutTests/platform/wpe/TestExpectations: Enable skipped tests.
* Source/WebCore/PlatformWPE.cmake: Add headers if enabled.
* Source/WebCore/SourcesWPE.txt: Add source files.
* Source/WebCore/platform/gamepad/wpe/WPEGamepad.cpp: Added.
(WebCore::WPEGamepad::WPEGamepad):
(WebCore::WPEGamepad::~WPEGamepad):
(WebCore::WPEGamepad::buttonPressedOrReleased):
(WebCore::WPEGamepad::absoluteAxisChanged):
* Source/WebCore/platform/gamepad/wpe/WPEGamepad.h: Added.
* Source/WebCore/platform/gamepad/wpe/WPEGamepadProvider.cpp: Added.
(WebCore::WPEGamepadProvider::singleton):
(WebCore::WPEGamepadProvider::WPEGamepadProvider):
(WebCore::WPEGamepadProvider::~WPEGamepadProvider):
(WebCore::WPEGamepadProvider::startMonitoringGamepads):
(WebCore::WPEGamepadProvider::stopMonitoringGamepads):
(WebCore::WPEGamepadProvider::gamepadConnected):
(WebCore::WPEGamepadProvider::gamepadDisconnected):
(WebCore::WPEGamepadProvider::indexForNewlyConnectedDevice):
(WebCore::WPEGamepadProvider::removeGamepadForId):
(WebCore::WPEGamepadProvider::initialGamepadsConnectedTimerFired):
(WebCore::WPEGamepadProvider::inputNotificationTimerFired):
(WebCore::WPEGamepadProvider::scheduleInputNotification):
(WebCore::WPEGamepadProvider::inputView):
* Source/WebCore/platform/gamepad/wpe/WPEGamepadProvider.h: Added.
* Source/WebKit/SourcesWPE.txt: Add source files.
* Source/WebKit/UIProcess/API/wpe/WPEView.cpp: Reports the view where gamepad currently operates.
(WKWPE::m_backend):
(WKWPE::View::~View):
(WKWPE::View::setViewState):
(WKWPE::View::platformWebPageProxyForGamepadInput):
* Source/WebKit/UIProcess/API/wpe/WPEView.h:
* Source/WebKit/UIProcess/Gamepad/UIGamepadProvider.cpp:
* Source/WebKit/UIProcess/Gamepad/wpe/UIGamepadProviderWPE.cpp: Added.
(WebKit::UIGamepadProvider::platformSetDefaultGamepadProvider):
(WebKit::UIGamepadProvider::platformWebPageProxyForGamepadInput):
(WebKit::UIGamepadProvider::platformStopMonitoringInput):
(WebKit::UIGamepadProvider::platformStartMonitoringInput):
* Source/cmake/OptionsWPE.cmake:

Canonical link: https://commits.webkit.org/253720@main
@webkit-commit-queue
Copy link
Collaborator

Committed 253720@main (ab0e247): https://commits.webkit.org/253720@main

Reviewed commits have been landed. Closing PR #911 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Aug 24, 2022
@webkit-early-warning-system webkit-early-warning-system merged commit ab0e247 into WebKit:main Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebCore Misc. For miscellaneous bugs in the WebCore framework (and not JavaScriptCore or WebKit).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants