Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Issue 2762003002: Refactor GVR controller gamepad API integration (Closed)

Created:
3 years, 9 months ago by klausw
Modified:
3 years, 9 months ago
Reviewers:
mthiesse, bajones, cjgrant
CC:
chromium-reviews, feature-vr-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor GVR controller gamepad API integration The GVR device code had its own gvr_api instance and controller state in the UI thread, this was causing conflicts with using the same APIs from the GL thread in vr_shell_gl. Symptoms included not getting window click events for touchpad clicks after a WebVR application used the gamepad API to read a GVR controller, this broke transient event handling such as button up/down detection. Instead, poll controllers only once from within VrShellGl, and post the data to VrShell which acts as a GvrGamepadDataProvider. That also handles registering/unregistering the gamepad device factory as needed. This only works while presenting, but that restriction already existed, the controller was not functional in magic window mode. BUG=687992 Review-Url: https://codereview.chromium.org/2762003002 Cr-Commit-Position: refs/heads/master@{#459017} Committed: https://chromium.googlesource.com/chromium/src/+/dee8e0a41990efbaec2435faff764baee5b894d9

Patch Set 1 #

Patch Set 2 : Remove obsolete gvr includes #

Patch Set 3 : Add missing .h file #

Patch Set 4 : Add comments to help demystify this new abstraction #

Total comments: 4

Patch Set 5 : Comment fixes #

Patch Set 6 : Fix comment, include gvr_types only for data provider #

Total comments: 2

Patch Set 7 : Rename GamepadData{Update,Get} to {Update,Get}GamepadData #

Patch Set 8 : Rebase, fix merge conflict #

Patch Set 9 : Fix __aeabi_f2lz link error. Argh. #

Patch Set 10 : Move gamepad data provider to vr_shell-delegate. #

Patch Set 11 : Revert vr_shell_delegate changes, new fetcher/provider API #

Total comments: 2

Patch Set 12 : Add more lifecycle comments #

Patch Set 13 : Add missing "override" #

Patch Set 14 : Rebase, no changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -69 lines) Patch
M chrome/browser/android/vr_shell/vr_controller.h View 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_controller.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +41 lines, -3 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_shell.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +14 lines, -1 line 0 comments Download
M chrome/browser/android/vr_shell/vr_shell.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +30 lines, -0 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_shell_delegate.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_shell_gl.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/android/vr_shell/vr_shell_gl.cc View 1 2 3 4 5 6 7 10 5 chunks +14 lines, -2 lines 0 comments Download
M device/gamepad/gamepad_provider.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -1 line 0 comments Download
M device/vr/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M device/vr/android/gvr/gvr_gamepad_data_fetcher.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +8 lines, -8 lines 0 comments Download
M device/vr/android/gvr/gvr_gamepad_data_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +38 lines, -48 lines 0 comments Download
A device/vr/android/gvr/gvr_gamepad_data_provider.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +67 lines, -0 lines 0 comments Download

Messages

Total messages: 56 (31 generated)
klausw
3 years, 9 months ago (2017-03-21 00:09:01 UTC) #4
mthiesse
missing gvr_gamepad_data_provider.h?
3 years, 9 months ago (2017-03-21 14:56:24 UTC) #5
klausw
On 2017/03/21 14:56:24, mthiesse wrote: > missing gvr_gamepad_data_provider.h? Added.
3 years, 9 months ago (2017-03-21 15:37:10 UTC) #6
cjgrant
Thanks Klaus. I'll patch this onto Menu Mode and re-test. https://codereview.chromium.org/2762003002/diff/60001/chrome/browser/android/vr_shell/vr_shell_gl.cc File chrome/browser/android/vr_shell/vr_shell_gl.cc (right): https://codereview.chromium.org/2762003002/diff/60001/chrome/browser/android/vr_shell/vr_shell_gl.cc#newcode1212 ...
3 years, 9 months ago (2017-03-21 15:55:39 UTC) #8
bajones
LGTM with outstanding nits fixed.
3 years, 9 months ago (2017-03-21 16:01:08 UTC) #9
klausw
https://codereview.chromium.org/2762003002/diff/60001/chrome/browser/android/vr_shell/vr_shell_gl.cc File chrome/browser/android/vr_shell/vr_shell_gl.cc (right): https://codereview.chromium.org/2762003002/diff/60001/chrome/browser/android/vr_shell/vr_shell_gl.cc#newcode1212 chrome/browser/android/vr_shell/vr_shell_gl.cc:1212: // Get controller data now so that it's ready ...
3 years, 9 months ago (2017-03-21 16:55:57 UTC) #10
mthiesse
lgtm https://codereview.chromium.org/2762003002/diff/100001/device/vr/android/gvr/gvr_gamepad_data_provider.h File device/vr/android/gvr/gvr_gamepad_data_provider.h (right): https://codereview.chromium.org/2762003002/diff/100001/device/vr/android/gvr/gvr_gamepad_data_provider.h#newcode34 device/vr/android/gvr/gvr_gamepad_data_provider.h:34: virtual void GamepadDataUpdate(GvrGamepadData data) = 0; nit: Update/GetGamepadData? ...
3 years, 9 months ago (2017-03-21 17:35:13 UTC) #11
klausw
https://codereview.chromium.org/2762003002/diff/100001/device/vr/android/gvr/gvr_gamepad_data_provider.h File device/vr/android/gvr/gvr_gamepad_data_provider.h (right): https://codereview.chromium.org/2762003002/diff/100001/device/vr/android/gvr/gvr_gamepad_data_provider.h#newcode34 device/vr/android/gvr/gvr_gamepad_data_provider.h:34: virtual void GamepadDataUpdate(GvrGamepadData data) = 0; On 2017/03/21 17:35:13, ...
3 years, 9 months ago (2017-03-21 18:28:56 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2762003002/120001
3 years, 9 months ago (2017-03-21 18:30:04 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/231808) android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, ...
3 years, 9 months ago (2017-03-21 18:34:36 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2762003002/140001
3 years, 9 months ago (2017-03-21 19:36:29 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: android_compile_dbg on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_compile_dbg/builds/232919)
3 years, 9 months ago (2017-03-21 20:23:46 UTC) #22
klausw
PTAL. I moved the gamepad data provider to vr_shell_delegate to fix a pre-existing crash due ...
3 years, 9 months ago (2017-03-22 00:18:52 UTC) #27
mthiesse
On 2017/03/22 00:18:52, klausw wrote: > PTAL. I moved the gamepad data provider to vr_shell_delegate ...
3 years, 9 months ago (2017-03-22 14:57:30 UTC) #28
klausw
On 2017/03/22 14:57:30, mthiesse wrote: > On 2017/03/22 00:18:52, klausw wrote: > > PTAL. I ...
3 years, 9 months ago (2017-03-22 22:21:07 UTC) #29
mthiesse
lgtm, though those linker errors are going to give me bad dreams tonight. https://codereview.chromium.org/2762003002/diff/200001/chrome/browser/android/vr_shell/vr_shell.h File ...
3 years, 9 months ago (2017-03-22 22:30:48 UTC) #32
klausw
https://codereview.chromium.org/2762003002/diff/200001/chrome/browser/android/vr_shell/vr_shell.h File chrome/browser/android/vr_shell/vr_shell.h (right): https://codereview.chromium.org/2762003002/diff/200001/chrome/browser/android/vr_shell/vr_shell.h#newcode183 chrome/browser/android/vr_shell/vr_shell.h:183: void RegisterGamepadDataFetcher(device::GvrGamepadDataFetcher*); On 2017/03/22 22:30:47, mthiesse wrote: > Add ...
3 years, 9 months ago (2017-03-22 22:53:25 UTC) #33
bajones
On 2017/03/22 22:53:25, klausw wrote: > https://codereview.chromium.org/2762003002/diff/200001/chrome/browser/android/vr_shell/vr_shell.h > File chrome/browser/android/vr_shell/vr_shell.h (right): > > https://codereview.chromium.org/2762003002/diff/200001/chrome/browser/android/vr_shell/vr_shell.h#newcode183 > ...
3 years, 9 months ago (2017-03-23 01:37:55 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2762003002/240001
3 years, 9 months ago (2017-03-23 03:03:46 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_chromium_compile_only_ng/builds/304262)
3 years, 9 months ago (2017-03-23 03:19:20 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2762003002/240001
3 years, 9 months ago (2017-03-23 03:47:55 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2762003002/260001
3 years, 9 months ago (2017-03-23 03:51:49 UTC) #49
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_chromium_compile_only_ng/builds/304310)
3 years, 9 months ago (2017-03-23 04:09:25 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2762003002/260001
3 years, 9 months ago (2017-03-23 07:10:05 UTC) #53
commit-bot: I haz the power
3 years, 9 months ago (2017-03-23 07:46:00 UTC) #56
Message was sent while issue was closed.
Committed patchset #14 (id:260001) as
https://chromium.googlesource.com/chromium/src/+/dee8e0a41990efbaec2435faff76...

Powered by Google App Engine
This is Rietveld 408576698