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

Unified Diff: chrome/browser/android/vr_shell/vr_shell_gl.cc

Issue 2897583002: WebVR unstuffing: delay "rendered" notification (Closed)
Patch Set: Rebase 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/vr_shell_gl.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc
index bce31e603bd51ab49567774335607577eb5454c1..14a22becd74bfc2730231dd912f501a23375bc54 100644
--- a/chrome/browser/android/vr_shell/vr_shell_gl.cc
+++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -425,15 +425,6 @@ void VrShellGl::OnWebVRFrameAvailable() {
TRACE_EVENT1("gpu", "VrShellGl::OnWebVRFrameAvailable", "frame", frame_index);
pending_frames_.pop();
- // It is legal for the WebVR client to submit a new frame now, since
- // we've consumed the image. TODO(klausw): would timing be better if
- // we move the "rendered" notification after draw, or suppress
- // the next vsync until that's done?
-
- if (submit_client_) {
- submit_client_->OnSubmitFrameRendered();
- }
-
DrawFrame(frame_index);
}
@@ -1074,6 +1065,14 @@ void VrShellGl::DrawFrame(int16_t frame_index) {
surface_->SwapBuffers();
}
+ // Report rendering completion to WebVR so that it's permitted to submit
+ // a fresh frame. We could do this earlier, as soon as the frame got pulled
+ // off the transfer surface, but that appears to result in overstuffed
+ // buffers.
+ if (submit_client_) {
+ submit_client_->OnSubmitFrameRendered();
+ }
+
#if DCHECK_IS_ON()
// After saving the timestamp, fps will be available via GetFPS().
// TODO(vollick): enable rendering of this framerate in a HUD.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698