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

Issue 2754493002: Expose VSync pausing through WindowAndroid and pause VSync during webVR presentation (Closed)

Created:
3 years, 9 months ago by mthiesse
Modified:
3 years, 8 months ago
Reviewers:
boliu, bshe
CC:
chromium-reviews, feature-vr-reviews_chromium.org, agrieve+watch_chromium.org, klausw
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Disables the standard compositing path while in WebVR Presentation by pausing VSync. This prevents rAFs and other unnecessary compositor work from happening. BUG=698923 Review-Url: https://codereview.chromium.org/2754493002 Cr-Commit-Position: refs/heads/master@{#457552} Committed: https://chromium.googlesource.com/chromium/src/+/b10e886bab7da85506656b4bb83e707cc2170209

Patch Set 1 #

Patch Set 2 : Switch to pausing BeginFrameSource #

Patch Set 3 : Fix behaviour #

Total comments: 3

Patch Set 4 : Move implementation to WindowAndroid + Add test #

Patch Set 5 : Address missed comment #

Total comments: 20

Patch Set 6 : Address comments #

Patch Set 7 : remove log #

Total comments: 2

Patch Set 8 : Address comments #

Patch Set 9 : Missed uploading WindowAndroid changes. #

Patch Set 10 : Fix 'unused' member #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -3 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellDelegate.java View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrShellImpl.java View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrWindowAndroid.java View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M content/public/android/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java View 1 2 3 4 5 6 7 8 9 1 chunk +114 lines, -0 lines 0 comments Download
A content/test/data/android/vsync.html View 1 2 3 1 chunk +10 lines, -0 lines 0 comments Download
M ui/android/java/src/org/chromium/ui/base/WindowAndroid.java View 1 2 3 4 5 6 7 8 6 chunks +26 lines, -0 lines 0 comments Download
M ui/android/window_android.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M ui/android/window_android.cc View 1 2 3 4 6 chunks +17 lines, -2 lines 0 comments Download

Messages

Total messages: 37 (10 generated)
mthiesse
PTAL boliu, WebVR presentation bypasses the compositor and draws over the entire display, so we ...
3 years, 9 months ago (2017-03-14 18:28:07 UTC) #2
mthiesse
+cc klaus
3 years, 9 months ago (2017-03-14 18:28:54 UTC) #3
boliu
On 2017/03/14 18:28:07, mthiesse wrote: > PTAL boliu, > > WebVR presentation bypasses the compositor ...
3 years, 9 months ago (2017-03-14 20:13:33 UTC) #4
mthiesse
That's perfect, thanks! PTAL
3 years, 9 months ago (2017-03-14 21:23:40 UTC) #5
klausw (use chromium instead)
On 2017/03/14 21:23:40, mthiesse wrote: > That's perfect, thanks! > > PTAL FYI, when I ...
3 years, 9 months ago (2017-03-15 01:28:33 UTC) #6
mthiesse
On 2017/03/15 01:28:33, klausw (use chromium instead) wrote: > On 2017/03/14 21:23:40, mthiesse wrote: > ...
3 years, 9 months ago (2017-03-15 14:56:36 UTC) #7
boliu
I think this should just be a feature of WindowAndroid, and not spread across some ...
3 years, 9 months ago (2017-03-15 17:13:42 UTC) #8
boliu
https://codereview.chromium.org/2754493002/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrWindowAndroid.java File chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrWindowAndroid.java (right): https://codereview.chromium.org/2754493002/diff/40001/chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrWindowAndroid.java#newcode81 chrome/android/java/src/org/chromium/chrome/browser/vr_shell/VrWindowAndroid.java:81: @CalledByNative fwiw, @CalledByNative is used for generating c++ jni ...
3 years, 9 months ago (2017-03-15 17:15:58 UTC) #9
mthiesse
Moved implementation to WindowAndroid.java, fixed some corner cases, and added a test. https://codereview.chromium.org/2754493002/diff/40001/ui/android/window_android.cc File ui/android/window_android.cc ...
3 years, 9 months ago (2017-03-15 21:32:17 UTC) #11
boliu
https://codereview.chromium.org/2754493002/diff/80001/content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java File content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java (right): https://codereview.chromium.org/2754493002/diff/80001/content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java#newcode21 content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java:21: public class VSyncPausedTest extends ContentShellTestBase { I think a ...
3 years, 9 months ago (2017-03-15 22:08:11 UTC) #12
mthiesse
https://codereview.chromium.org/2754493002/diff/80001/content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java File content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java (right): https://codereview.chromium.org/2754493002/diff/80001/content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java#newcode21 content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java:21: public class VSyncPausedTest extends ContentShellTestBase { On 2017/03/15 22:08:11, ...
3 years, 9 months ago (2017-03-16 00:03:07 UTC) #13
boliu
Replying on phone.. https://codereview.chromium.org/2754493002/diff/80001/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java File ui/android/java/src/org/chromium/ui/base/WindowAndroid.java (right): https://codereview.chromium.org/2754493002/diff/80001/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java#newcode112 ui/android/java/src/org/chromium/ui/base/WindowAndroid.java:112: private boolean mPendingVSyncRequest; On 2017/03/16 00:03:07, ...
3 years, 9 months ago (2017-03-16 00:45:44 UTC) #14
boliu
ui/android lg2m % adding that comment test can't have sleeps though https://codereview.chromium.org/2754493002/diff/120001/content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java File content/public/android/javatests/src/org/chromium/content/browser/VSyncPausedTest.java (right): ...
3 years, 9 months ago (2017-03-16 02:28:52 UTC) #15
mthiesse
https://codereview.chromium.org/2754493002/diff/80001/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java File ui/android/java/src/org/chromium/ui/base/WindowAndroid.java (right): https://codereview.chromium.org/2754493002/diff/80001/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java#newcode112 ui/android/java/src/org/chromium/ui/base/WindowAndroid.java:112: private boolean mPendingVSyncRequest; On 2017/03/16 00:45:44, boliu wrote: > ...
3 years, 9 months ago (2017-03-16 15:36:06 UTC) #16
mthiesse
boliu, you also own content/public/android. Is there anybody else you would like to have review ...
3 years, 9 months ago (2017-03-16 15:38:10 UTC) #17
mthiesse
+bshe for a second set of eyes on the vr_shell/ code.
3 years, 9 months ago (2017-03-16 15:39:20 UTC) #19
boliu
On 2017/03/16 15:38:10, mthiesse wrote: > boliu, you also own content/public/android. Is there anybody else ...
3 years, 9 months ago (2017-03-16 16:45:30 UTC) #21
bshe
On 2017/03/16 16:45:30, boliu wrote: > On 2017/03/16 15:38:10, mthiesse wrote: > > boliu, you ...
3 years, 9 months ago (2017-03-16 18:07:08 UTC) #22
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/2754493002/160001
3 years, 9 months ago (2017-03-16 18:09:35 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/229977)
3 years, 9 months ago (2017-03-16 19:48:52 UTC) #26
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/2754493002/180001
3 years, 9 months ago (2017-03-16 19:58:08 UTC) #29
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/chromium/src/+/b10e886bab7da85506656b4bb83e707cc2170209
3 years, 9 months ago (2017-03-16 21:10:33 UTC) #32
xing.xu
Hi, as I know, in previous Android, VSYNC is not only for compositing, but also ...
3 years, 8 months ago (2017-03-29 01:17:07 UTC) #33
mthiesse
On 2017/03/29 01:17:07, xing.xu wrote: > Hi, as I know, in previous Android, VSYNC is ...
3 years, 8 months ago (2017-03-29 14:47:40 UTC) #34
xing.xu
On 2017/03/29 14:47:40, mthiesse wrote: > On 2017/03/29 01:17:07, xing.xu wrote: > > Hi, as ...
3 years, 8 months ago (2017-03-31 11:06:48 UTC) #35
mthiesse
On 2017/03/31 11:06:48, xing.xu wrote: > On 2017/03/29 14:47:40, mthiesse wrote: > > On 2017/03/29 ...
3 years, 8 months ago (2017-03-31 14:05:49 UTC) #36
xing.xu
3 years, 8 months ago (2017-04-01 00:25:31 UTC) #37
Message was sent while issue was closed.
On 2017/03/31 14:05:49, mthiesse wrote:
> On 2017/03/31 11:06:48, xing.xu wrote:
> > On 2017/03/29 14:47:40, mthiesse wrote:
> > > On 2017/03/29 01:17:07, xing.xu wrote:
> > > > Hi, as I know, in previous Android, VSYNC is not only for compositing,
but
> > > also
> > > > sent to renderer to trigger beginMainFrame.
> > > > So I stopped VSync, I am curious how the WebGL content will be
> > > > generated(TextureLayer::update will not be called)?
> > > 
> > > During webVR presentation we use a separate rendering path that bypasses
the
> > > compositor. Rendering should happen during vrDisplay#rAF callback, and
> > > SubmitFrame() triggers the texture update.
> > 
> > Thanks. 
> > Take this https://webvr.info/samples/04-simple-mirroring.html as an example:
> > Before attach phone into Daydream, The VSYNC is working, which will being
sent
> > from Browser to Renderer, and initiate beginMainFrame and rendering. In
> > BeginMainFrame, it will call js initWebGL/onAnimationFrame. 
> > 
> > If VSYNC paused, beginMainFrame will not being called too, so does
> > onAnimationFrame.
> > You know, for any animation related application, it requires a Loop. I
didn't
> > see where the Loop is when VSYNC is paused.
> 
> See crbug.com/704341 for further discussion.
> 
> As mentioned in my previous post, the rendering loop while presenting needs to
> use vrDisplay#requestAnimationFrame, not window.requestAnimationFrame. On
> Android the page is hidden while presenting, so we don't fire rAF callbacks
for
> the main frame.

Sorry for my ignorance, this is very clear! Thanks!

Powered by Google App Engine
This is Rietveld 408576698