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

Issue 2562733002: Implement our own GLThread for VR Shell. (Closed)

Created:
4 years ago by mthiesse
Modified:
3 years, 6 months ago
CC:
chromium-reviews, avayvod+watch_chromium.org, jam, feature-media-reviews_chromium.org, feature-vr-reviews_chromium.org, darin-cc_chromium.org, agrieve+watch_chromium.org, piman+watch_chromium.org, mlamouri+watch-media_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement our own GLThread for VR Shell. aka most satisfying refactor of the week. This CL gets rid of our glSurfaceView managed GL thread, and replaces it with a thread we control and can post tasks to. It also refactors all of our code that runs on the GL thread into its own class, making our existing thread safety violations painfully obvious. This breaks the unshipped menu mode - to be fixed in a followup CL, and disables some webVR buffer size manipulation, which might possibly regress some webVR experiences. This will also be fixed in a followup CL. BUG=671302 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel # Skipping presubmit due to ScopedAllowIO use. NOPRESUBMIT=true Committed: https://crrev.com/0be372f1b41a7e7ad897743abd6b265da979a82e Cr-Commit-Position: refs/heads/master@{#438256}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Style pass #

Total comments: 8

Patch Set 3 : Rebase + Fix thread teardown + Address comments #

Total comments: 2

Patch Set 4 : Address comment #

Total comments: 8

Patch Set 5 : Address bshe's comments #

Total comments: 6

Patch Set 6 : Update comment #

Patch Set 7 : Minor cleanup #

Total comments: 12

Patch Set 8 : Address comments #

Total comments: 2

Patch Set 9 : Address comments #

Patch Set 10 : rebase #

Patch Set 11 : sigh #

Unified diffs Side-by-side diffs Delta from patch set Stats (+866 lines, -1759 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShell.java View 1 chunk +7 lines, -7 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java View 1 2 3 4 5 6 7 8 9 10 8 chunks +10 lines, -10 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java View 1 2 3 4 5 6 7 8 9 10 13 chunks +58 lines, -240 lines 0 comments Download
M chrome/browser/android/vr_shell/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_compositor.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/android/vr_shell/vr_compositor.cc View 2 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_shell.h View 1 2 3 4 5 6 7 7 chunks +44 lines, -130 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_shell.cc View 1 2 3 4 5 6 7 8 8 chunks +217 lines, -916 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_shell_delegate.h View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/android/vr_shell/vr_shell_delegate.cc View 2 chunks +18 lines, -2 lines 0 comments Download
A chrome/browser/android/vr_shell/vr_shell_gl.h View 1 2 3 4 5 6 7 8 1 chunk +190 lines, -0 lines 0 comments Download
A + chrome/browser/android/vr_shell/vr_shell_gl.cc View 1 2 3 4 5 6 7 8 21 chunks +278 lines, -430 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_web_contents_observer.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/android/vr_shell/vr_web_contents_observer.cc View 1 2 3 4 5 1 chunk +6 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/vr_shell/vr_shell_ui_message_handler.cc View 4 chunks +11 lines, -9 lines 0 comments Download
M content/browser/media/android/browser_surface_view_manager.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/compositor_impl_android.cc View 2 chunks +1 line, -3 lines 0 comments Download
M gpu/ipc/common/gpu_surface_tracker.h View 1 chunk +1 line, -2 lines 0 comments Download
M gpu/ipc/common/gpu_surface_tracker.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java View 1 chunk +5 lines, -0 lines 0 comments Download
M ui/gl/android/surface_texture.h View 1 chunk +3 lines, -0 lines 0 comments Download
M ui/gl/android/surface_texture.cc View 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 44 (17 generated)
mthiesse
PTAL. Sorry for the size of this CL, it's not easy to split up. Most ...
4 years ago (2016-12-08 16:41:36 UTC) #3
cjgrant
Nit-grade comments only from a first pass. https://codereview.chromium.org/2562733002/diff/1/chrome/browser/android/vr_shell/vr_shell.h File chrome/browser/android/vr_shell/vr_shell.h (right): https://codereview.chromium.org/2562733002/diff/1/chrome/browser/android/vr_shell/vr_shell.h#newcode70 chrome/browser/android/vr_shell/vr_shell.h:70: }; Blank ...
4 years ago (2016-12-08 17:02:49 UTC) #4
mthiesse
brettw@chromium.org: Please review content/ and ui/ changes. +piman for a sanity check on our GL ...
4 years ago (2016-12-08 17:07:00 UTC) #6
piman
https://codereview.chromium.org/2562733002/diff/20001/chrome/browser/android/vr_shell/vr_shell_gl.cc File chrome/browser/android/vr_shell/vr_shell_gl.cc (right): https://codereview.chromium.org/2562733002/diff/20001/chrome/browser/android/vr_shell/vr_shell_gl.cc#newcode212 chrome/browser/android/vr_shell/vr_shell_gl.cc:212: gl::init::InitializeGLOneOff()); This can fail. I don't think CHECK is ...
4 years ago (2016-12-08 21:12:19 UTC) #7
mthiesse
brettw, PTAL at the use of ScopedAllowIO in ~VrShell. I tried long and hard to ...
4 years ago (2016-12-09 01:28:43 UTC) #9
piman
https://codereview.chromium.org/2562733002/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/2562733002/diff/60001/chrome/browser/android/vr_shell/vr_shell_gl.cc#newcode214 chrome/browser/android/vr_shell/vr_shell_gl.cc:214: ForceExitVR(); You would need to return here, if initialization ...
4 years ago (2016-12-09 01:32:13 UTC) #10
mthiesse
https://codereview.chromium.org/2562733002/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/2562733002/diff/60001/chrome/browser/android/vr_shell/vr_shell_gl.cc#newcode214 chrome/browser/android/vr_shell/vr_shell_gl.cc:214: ForceExitVR(); On 2016/12/09 01:32:13, piman - On leave - ...
4 years ago (2016-12-09 15:47:59 UTC) #11
bshe
https://codereview.chromium.org/2562733002/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java File chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java (right): https://codereview.chromium.org/2562733002/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java#newcode112 chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java:112: mPresentationView = new SurfaceView(mActivity); Do you need a SurfaceView ...
4 years ago (2016-12-09 19:36:25 UTC) #12
mthiesse
https://codereview.chromium.org/2562733002/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java File chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java (right): https://codereview.chromium.org/2562733002/diff/80001/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java#newcode112 chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java:112: mPresentationView = new SurfaceView(mActivity); On 2016/12/09 19:36:25, bshe wrote: ...
4 years ago (2016-12-09 20:23:18 UTC) #13
brettw
It's hard for me to judge without understanding this service. is there a design doc ...
4 years ago (2016-12-09 20:38:33 UTC) #14
mthiesse
On 2016/12/09 20:38:33, brettw (ping after 24h) wrote: > It's hard for me to judge ...
4 years ago (2016-12-12 16:01:31 UTC) #15
mthiesse
dcheng: Please review gpu/ipc changes.
4 years ago (2016-12-12 16:05:36 UTC) #17
brettw
LGTM with comment change: https://codereview.chromium.org/2562733002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2562733002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc#newcode167 chrome/browser/android/vr_shell/vr_shell.cc:167: // Our options are: Can ...
4 years ago (2016-12-12 19:12:40 UTC) #18
mthiesse
https://codereview.chromium.org/2562733002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2562733002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc#newcode167 chrome/browser/android/vr_shell/vr_shell.cc:167: // Our options are: On 2016/12/12 19:12:40, brettw (ping ...
4 years ago (2016-12-12 19:49:31 UTC) #19
bshe
lgtm with a few nits https://codereview.chromium.org/2562733002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2562733002/diff/100001/chrome/browser/android/vr_shell/vr_shell.cc#newcode187 chrome/browser/android/vr_shell/vr_shell.cc:187: if (thread->GetVrShellGlUnsafe()) { why ...
4 years ago (2016-12-12 20:30:20 UTC) #20
dcheng
https://codereview.chromium.org/2562733002/diff/140001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2562733002/diff/140001/chrome/browser/android/vr_shell/vr_shell.cc#newcode47 chrome/browser/android/vr_shell/vr_shell.cc:47: base::WeakPtr<VrInputManager> ui_input_manager, Nit: convention is to pass WeakPtr by ...
4 years ago (2016-12-12 20:52:35 UTC) #21
mthiesse
https://codereview.chromium.org/2562733002/diff/140001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2562733002/diff/140001/chrome/browser/android/vr_shell/vr_shell.cc#newcode47 chrome/browser/android/vr_shell/vr_shell.cc:47: base::WeakPtr<VrInputManager> ui_input_manager, On 2016/12/12 20:52:34, dcheng wrote: > Nit: ...
4 years ago (2016-12-12 23:26:55 UTC) #22
dcheng
LGTM with the scoped_refptr nit addressed (again, sorry for the confusion. We should make these ...
4 years ago (2016-12-13 00:59:11 UTC) #23
mthiesse
https://codereview.chromium.org/2562733002/diff/160001/chrome/browser/android/vr_shell/vr_shell.cc File chrome/browser/android/vr_shell/vr_shell.cc (right): https://codereview.chromium.org/2562733002/diff/160001/chrome/browser/android/vr_shell/vr_shell.cc#newcode48 chrome/browser/android/vr_shell/vr_shell.cc:48: const scoped_refptr<base::SingleThreadTaskRunner>& On 2016/12/13 00:59:11, dcheng wrote: > Sorry ...
4 years ago (2016-12-13 15:13:53 UTC) #24
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/2562733002/180001
4 years ago (2016-12-13 15:14:19 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/121922) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years ago (2016-12-13 15:16:08 UTC) #29
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/2562733002/200001
4 years ago (2016-12-13 15:26:34 UTC) #33
klausw
LGTM Thanks for making this change, I think this looks a whole lot cleaner. I'm ...
4 years ago (2016-12-13 18:05:17 UTC) #34
commit-bot: I haz the power
Failed to apply patch for chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-12-13 18:09:23 UTC) #36
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/2562733002/220001
4 years ago (2016-12-13 18:16:27 UTC) #39
commit-bot: I haz the power
Committed patchset #11 (id:220001)
4 years ago (2016-12-13 19:35:48 UTC) #42
commit-bot: I haz the power
4 years ago (2016-12-13 19:37:47 UTC) #44
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/0be372f1b41a7e7ad897743abd6b265da979a82e
Cr-Commit-Position: refs/heads/master@{#438256}

Powered by Google App Engine
This is Rietveld 408576698