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

Unified Diff: third_party/WebKit/Source/modules/vr/VRDisplay.h

Issue 2888313002: WebVR: Defer GetVSync calls until the current frame is submitted. (Closed)
Patch Set: Rebase on crrev.com/2891033002#ps80001 (ps5) Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/vr/VRDisplay.h
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.h b/third_party/WebKit/Source/modules/vr/VRDisplay.h
index 3391f95743ff370958f2bcfb013d567964e79119..68fe6a6f6d19ebdcdbb13a8ab1bfaf4b4c47e7ad 100644
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.h
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.h
@@ -147,6 +147,13 @@ class VRDisplay final : public EventTargetWithInlineData,
void ProcessScheduledAnimations(double timestamp);
void ProcessScheduledWindowAnimations(double timestamp);
+ // In order to help the VR device with scheduling, never request a new VSync
+ // until the current frame is either submitted or abandoned. If vrDisplay.rAF
+ // is called earlier, defer the GetVSync until vrDisplay.submitFrame is
+ // called. If the rAF callback exits without submitting a frame, call it at
+ // that time.
+ void RequestVSync();
+
Member<NavigatorVR> navigator_vr_;
unsigned display_id_ = 0;
String display_name_;
@@ -185,6 +192,7 @@ class VRDisplay final : public EventTargetWithInlineData,
bool pending_vrdisplay_raf_ = false;
bool pending_vsync_ = false;
bool in_animation_frame_ = false;
+ bool did_submit_this_frame_ = false;
bool in_display_activate_ = false;
bool display_blurred_ = false;
double timebase_ = -1;
« no previous file with comments | « third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js ('k') | third_party/WebKit/Source/modules/vr/VRDisplay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698