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

Unified Diff: third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js

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/LayoutTests/vr/resources/mock-vr-service.js
diff --git a/third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js b/third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js
index 53806a08cc9c733285ea14094fd57ceddf4a2625..2846e8d5b10834e100cc46bb5130446d8d39d2cc 100644
--- a/third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js
+++ b/third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js
@@ -24,10 +24,26 @@ let mockVRService = loadMojoModules(
}
}
- requestPresent(secureOrigin) {
+ requestPresent(secureOrigin, submitFrameClient) {
+ this.submitFrameClient_ = submitFrameClient;
return Promise.resolve({success: true});
}
+ submitFrame(frameId, mailboxHolder) {
+ // Trigger the submit completion callbacks here. WARNING: The
+ // Javascript-based mojo mocks are *not* re-entrant. In the current
+ // default implementation, Javascript calls display.submitFrame, and the
+ // corresponding C++ code uses a reentrant mojo call that waits for
+ // onSubmitFrameTransferred to indicate completion. This never finishes
+ // when using the mocks since the incoming calls are queued until the
+ // current execution context finishes. As a workaround, use the alternate
+ // "WebVRExperimentalRendering" mode which works without reentrant calls,
+ // the code only checks for completion on the *next* frame, see the
+ // corresponding option setting in RuntimeEnabledFeatures.json5.
+ this.submitFrameClient_.onSubmitFrameTransferred();
+ this.submitFrameClient_.onSubmitFrameRendered();
+ }
+
setPose(pose) {
if (pose == null) {
this.vsync_provider_.pose_ = null;
@@ -37,7 +53,9 @@ let mockVRService = loadMojoModules(
}
}
- getVRVSyncProvider(request) { this.vsync_provider_.bind(request); }
+ getVRVSyncProvider(request) {
+ this.vsync_provider_.bind(request);
+ }
forceActivate(reason) {
this.displayClient_.onActivate(reason);

Powered by Google App Engine
This is Rietveld 408576698