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

Side by Side Diff: cc/trees/proxy_impl.cc

Issue 2712983003: [cc] Set BeginFrame sequence numbers on CompositorFrames from Scheduler. (Closed)
Patch Set: fix comment + test. Created 3 years, 9 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 | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "cc/trees/proxy_impl.h" 5 #include "cc/trees/proxy_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 // request completes, and we signal completion here. If CanDraw() is false, we 586 // request completes, and we signal completion here. If CanDraw() is false, we
587 // will indicate success=false to the caller, but we must still signal 587 // will indicate success=false to the caller, but we must still signal
588 // completion to avoid deadlock. 588 // completion to avoid deadlock.
589 589
590 // We guard PrepareToDraw() with CanDraw() because it always returns a valid 590 // We guard PrepareToDraw() with CanDraw() because it always returns a valid
591 // frame, so can only be used when such a frame is possible. Since 591 // frame, so can only be used when such a frame is possible. Since
592 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on 592 // DrawLayers() depends on the result of PrepareToDraw(), it is guarded on
593 // CanDraw() as well. 593 // CanDraw() as well.
594 594
595 LayerTreeHostImpl::FrameData frame; 595 LayerTreeHostImpl::FrameData frame;
596 frame.begin_frame_ack = scheduler_->CurrentBeginFrameAckForActiveTree();
596 bool draw_frame = false; 597 bool draw_frame = false;
597 598
598 DrawResult result; 599 DrawResult result;
599 if (layer_tree_host_impl_->CanDraw()) { 600 if (layer_tree_host_impl_->CanDraw()) {
600 result = layer_tree_host_impl_->PrepareToDraw(&frame); 601 result = layer_tree_host_impl_->PrepareToDraw(&frame);
601 draw_frame = forced_draw || result == DRAW_SUCCESS; 602 draw_frame = forced_draw || result == DRAW_SUCCESS;
602 } else { 603 } else {
603 result = DRAW_ABORTED_CANT_DRAW; 604 result = DRAW_ABORTED_CANT_DRAW;
604 } 605 }
605 606
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() { 641 ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() {
641 DCHECK(IsMainThreadBlocked() && commit_completion_event_); 642 DCHECK(IsMainThreadBlocked() && commit_completion_event_);
642 return main_thread_blocked_commit_vars_unsafe_; 643 return main_thread_blocked_commit_vars_unsafe_;
643 } 644 }
644 645
645 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() { 646 base::SingleThreadTaskRunner* ProxyImpl::MainThreadTaskRunner() {
646 return task_runner_provider_->MainThreadTaskRunner(); 647 return task_runner_provider_->MainThreadTaskRunner();
647 } 648 }
648 649
649 } // namespace cc 650 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698