Index: third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
index a98b7a8de59704317c8f0ffc8d6b0042e7a75bde..97eb96ef914cb21c49e865f167e633c22d4f53d8 100644 |
--- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
+++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp |
@@ -611,12 +611,22 @@ void VRDisplay::submitFrame() { |
pending_previous_frame_render_ = true; |
pending_submit_frame_ = true; |
- display_->SubmitFrame( |
- vr_frame_id_, |
- gpu::MailboxHolder(static_image->GetMailbox(), |
- static_image->GetSyncToken(), GL_TEXTURE_2D)); |
+ |
+ TRACE_EVENT_BEGIN0("gpu", "VRDisplay::GetMailbox"); |
+ auto mailbox = static_image->GetMailbox(); |
+ TRACE_EVENT_END0("gpu", "VRDisplay::GetMailbox"); |
+ // Flush to avoid black screen flashes which appear to be related to |
+ // "fence sync must be flushed before generating sync token" GL errors. |
+ context_gl_->Flush(); |
+ TRACE_EVENT_BEGIN0("gpu", "VRDisplay::GetSyncToken"); |
+ auto token = static_image->GetSyncToken(); |
mthiesse
2017/05/18 15:33:53
s/token/sync_token
klausw
2017/05/18 17:47:39
Done, this was a cherry-pick with a bad manual edi
|
+ TRACE_EVENT_END0("gpu", "VRDisplay::GetSyncToken"); |
+ TRACE_EVENT_BEGIN0("gpu", "VRDisplay::SubmitFrame"); |
+ display_->SubmitFrame(vr_frame_id_, |
+ gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D)); |
did_submit_this_frame_ = true; |
RequestVSync(); |
+ TRACE_EVENT_END0("gpu", "VRDisplay::SubmitFrame"); |
// If preserveDrawingBuffer is false, must clear now. Normally this |
// happens as part of compositing, but that's not active while |