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

Side by Side Diff: third_party/WebKit/Source/modules/vr/VRDisplay.cpp

Issue 2891033002: WebVR: flush before requesting sync token for mailbox (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/vr/VRDisplay.h" 5 #include "modules/vr/VRDisplay.h"
6 6
7 #include "core/css/StylePropertySet.h" 7 #include "core/css/StylePropertySet.h"
8 #include "core/dom/DOMException.h" 8 #include "core/dom/DOMException.h"
9 #include "core/dom/FrameRequestCallback.h" 9 #include "core/dom/FrameRequestCallback.h"
10 #include "core/dom/ScriptedAnimationController.h" 10 #include "core/dom/ScriptedAnimationController.h"
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 while (pending_previous_frame_render_) { 604 while (pending_previous_frame_render_) {
605 if (!submit_frame_client_binding_.WaitForIncomingMethodCall()) { 605 if (!submit_frame_client_binding_.WaitForIncomingMethodCall()) {
606 DLOG(ERROR) << "Failed to receive SubmitFrame response"; 606 DLOG(ERROR) << "Failed to receive SubmitFrame response";
607 break; 607 break;
608 } 608 }
609 } 609 }
610 } 610 }
611 611
612 pending_previous_frame_render_ = true; 612 pending_previous_frame_render_ = true;
613 pending_submit_frame_ = true; 613 pending_submit_frame_ = true;
614 display_->SubmitFrame( 614
615 vr_frame_id_, 615 TRACE_EVENT_BEGIN0("gpu", "VRDisplay::GetMailbox");
616 gpu::MailboxHolder(static_image->GetMailbox(), 616 auto mailbox = static_image->GetMailbox();
617 static_image->GetSyncToken(), GL_TEXTURE_2D)); 617 TRACE_EVENT_END0("gpu", "VRDisplay::GetMailbox");
618 // Flush to avoid black screen flashes which appear to be related to
619 // "fence sync must be flushed before generating sync token" GL errors.
620 context_gl_->Flush();
621 TRACE_EVENT_BEGIN0("gpu", "VRDisplay::GetSyncToken");
622 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
623 TRACE_EVENT_END0("gpu", "VRDisplay::GetSyncToken");
624 TRACE_EVENT_BEGIN0("gpu", "VRDisplay::SubmitFrame");
625 display_->SubmitFrame(vr_frame_id_,
626 gpu::MailboxHolder(mailbox, sync_token, GL_TEXTURE_2D));
618 did_submit_this_frame_ = true; 627 did_submit_this_frame_ = true;
619 RequestVSync(); 628 RequestVSync();
629 TRACE_EVENT_END0("gpu", "VRDisplay::SubmitFrame");
620 630
621 // If preserveDrawingBuffer is false, must clear now. Normally this 631 // If preserveDrawingBuffer is false, must clear now. Normally this
622 // happens as part of compositing, but that's not active while 632 // happens as part of compositing, but that's not active while
623 // presenting, so run the responsible code directly. 633 // presenting, so run the responsible code directly.
624 rendering_context_->MarkCompositedAndClearBackbufferIfNeeded(); 634 rendering_context_->MarkCompositedAndClearBackbufferIfNeeded();
625 635
626 // If we're not deferring the wait for transferring the mailbox, 636 // If we're not deferring the wait for transferring the mailbox,
627 // we need to wait for it now to prevent the image going out of 637 // we need to wait for it now to prevent the image going out of
628 // scope before its mailbox is retrieved. 638 // scope before its mailbox is retrieved.
629 if (!wait_for_previous_transfer_to_finish) { 639 if (!wait_for_previous_transfer_to_finish) {
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 visitor->Trace(stage_parameters_); 907 visitor->Trace(stage_parameters_);
898 visitor->Trace(eye_parameters_left_); 908 visitor->Trace(eye_parameters_left_);
899 visitor->Trace(eye_parameters_right_); 909 visitor->Trace(eye_parameters_right_);
900 visitor->Trace(layer_); 910 visitor->Trace(layer_);
901 visitor->Trace(rendering_context_); 911 visitor->Trace(rendering_context_);
902 visitor->Trace(scripted_animation_controller_); 912 visitor->Trace(scripted_animation_controller_);
903 visitor->Trace(pending_present_resolvers_); 913 visitor->Trace(pending_present_resolvers_);
904 } 914 }
905 915
906 } // namespace blink 916 } // namespace blink
OLDNEW
« 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