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

Side by Side Diff: cc/scheduler/scheduler_state_machine.cc

Issue 775143003: cc: Implement unified BeginFrame on aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unittest Created 5 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/scheduler/scheduler_state_machine.h" 5 #include "cc/scheduler/scheduler_state_machine.h"
6 6
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 // actually ready. 764 // actually ready.
765 bool SchedulerStateMachine::SupportsProactiveBeginFrame() const { 765 bool SchedulerStateMachine::SupportsProactiveBeginFrame() const {
766 // It is undesirable to proactively request BeginFrames if we are 766 // It is undesirable to proactively request BeginFrames if we are
767 // using a synchronous compositor because we *must* draw for every 767 // using a synchronous compositor because we *must* draw for every
768 // BeginFrame, which could cause duplicate draws. 768 // BeginFrame, which could cause duplicate draws.
769 return !settings_.using_synchronous_renderer_compositor; 769 return !settings_.using_synchronous_renderer_compositor;
770 } 770 }
771 771
772 void SchedulerStateMachine::SetChildrenNeedBeginFrames( 772 void SchedulerStateMachine::SetChildrenNeedBeginFrames(
773 bool children_need_begin_frames) { 773 bool children_need_begin_frames) {
774 DCHECK(settings_.forward_begin_frames_to_children);
775 children_need_begin_frames_ = children_need_begin_frames; 774 children_need_begin_frames_ = children_need_begin_frames;
776 } 775 }
777 776
778 void SchedulerStateMachine::SetDeferCommits(bool defer_commits) { 777 void SchedulerStateMachine::SetDeferCommits(bool defer_commits) {
779 defer_commits_ = defer_commits; 778 defer_commits_ = defer_commits;
780 } 779 }
781 780
782 // These are the cases where we definitely (or almost definitely) have a 781 // These are the cases where we definitely (or almost definitely) have a
783 // new frame to animate and/or draw and can draw. 782 // new frame to animate and/or draw and can draw.
784 bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const { 783 bool SchedulerStateMachine::BeginFrameNeededToAnimateOrDraw() const {
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 static_cast<int>(begin_impl_frame_state_), 1131 static_cast<int>(begin_impl_frame_state_),
1133 static_cast<int>(commit_state_), 1132 static_cast<int>(commit_state_),
1134 has_pending_tree_ ? 'T' : 'F', 1133 has_pending_tree_ ? 'T' : 'F',
1135 pending_tree_is_ready_for_activation_ ? 'T' : 'F', 1134 pending_tree_is_ready_for_activation_ ? 'T' : 'F',
1136 active_tree_needs_first_draw_ ? 'T' : 'F', 1135 active_tree_needs_first_draw_ ? 'T' : 'F',
1137 max_pending_swaps_, 1136 max_pending_swaps_,
1138 pending_swaps_); 1137 pending_swaps_);
1139 } 1138 }
1140 1139
1141 } // namespace cc 1140 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698