Reland "Add SubmitFrameMissing mojo call for WebVR/WebXR"
This is a reland of f5bbb138 Original change's description: > Add SubmitFrameMissing mojo call for WebVR/WebXR > > Goal is that we get a clean lifecycle for a functioning WebVR/WebXR > presentation render loop. It's started by a presenting SendVSync, calls > GetVSync to schedule the next frame, and is ended by a SubmitFrame > call. If there was nothing drawn, it uses SubmitFrameMissing instead of the > usual SubmitFrame/SubmitFrameWithTextureHandle. > > In WebVR 1.1, submitFrame is a JS call, and the app can exit its animation > loop without calling it. WebXR had an analogous feature where SubmitFrame > was skipped if the framebuffer wasn't touched by drawing calls. This > made it hard to tell for the device side if a frame is done or not. > > WebVR 1.1 worked around this by deferring a GetVSync call until after > SubmitFrame, but this was complex: > > - // The logic here is a bit subtle. We get called from one of the following > - // four contexts: > - // > - // (a) from requestAnimationFrame if outside an animating context (i.e. the > - // first rAF call from inside a getVRDisplays() promise) > - // > - // (b) from requestAnimationFrame in an animating context if the JS code > - // calls rAF after submitFrame. > - // > - // (c) from submitFrame if that is called after rAF. > - // > - // (d) from ProcessScheduledAnimations if a rAF callback finishes without > - // submitting a frame. > - // > - // These cases are mutually exclusive which prevents duplicate GetVSync > - // calls. Case (a) only applies outside an animating context > - // (in_animation_frame_ is false), and (b,c,d) all require an animating > - // context. While in an animating context, submitFrame is called either > - // before rAF (b), after rAF (c), or not at all (d). If rAF isn't called at > - // all, there won't be future frames. > > This CL removes those special cases and just always calls RequestVSync from > requestAnimationFrame, collapsing cases (a) and (b) into an unconditional call. > Cases (c) and (d) are now no longer needed and removed. > > The layout tests now check the SubmitFrameMissing call count. > > Also added a check for a WebXR exclusive session ending in the middle of a > frame. (The layout tests revealed this since OnEndFrame no longer exits early > on a clean framebuffer.) > > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 > Change-Id: I5722097d421ca9448760e696ea379895a1320199 > Reviewed-on: https://chromium-review.googlesource.com/996614 > Reviewed-by: Ian Vollick <vollick@chromium.org> > Reviewed-by: Brandon Jones <bajones@chromium.org> > Reviewed-by: Martin Barbella <mbarbella@chromium.org> > Reviewed-by: Bill Orr <billorr@chromium.org> > Commit-Queue: Klaus Weidner <klausw@chromium.org> > Cr-Commit-Position: refs/heads/master@{#548518} Change-Id: I14b7ac8fc661cfb91a8be2b959d27091007602ee Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Reviewed-on: https://chromium-review.googlesource.com/998079Reviewed-by:Bill Orr <billorr@chromium.org> Reviewed-by:
Martin Barbella <mbarbella@chromium.org> Reviewed-by:
Ian Vollick <vollick@chromium.org> Commit-Queue: Klaus Weidner <klausw@chromium.org> Cr-Commit-Position: refs/heads/master@{#548770}
Showing
Please register or sign in to comment