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

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

Issue 816543004: Update from https://crrev.com/308996 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 state_machine_.SetImplLatencyTakesPriority(impl_latency_takes_priority); 253 state_machine_.SetImplLatencyTakesPriority(impl_latency_takes_priority);
254 ProcessScheduledActions(); 254 ProcessScheduledActions();
255 } 255 }
256 256
257 void Scheduler::NotifyReadyToCommit() { 257 void Scheduler::NotifyReadyToCommit() {
258 TRACE_EVENT0("cc", "Scheduler::NotifyReadyToCommit"); 258 TRACE_EVENT0("cc", "Scheduler::NotifyReadyToCommit");
259 state_machine_.NotifyReadyToCommit(); 259 state_machine_.NotifyReadyToCommit();
260 ProcessScheduledActions(); 260 ProcessScheduledActions();
261 } 261 }
262 262
263 void Scheduler::BeginMainFrameAborted(bool did_handle) { 263 void Scheduler::BeginMainFrameAborted(CommitEarlyOutReason reason) {
264 TRACE_EVENT0("cc", "Scheduler::BeginMainFrameAborted"); 264 TRACE_EVENT1("cc", "Scheduler::BeginMainFrameAborted", "reason",
265 state_machine_.BeginMainFrameAborted(did_handle); 265 CommitEarlyOutReasonToString(reason));
266 state_machine_.BeginMainFrameAborted(reason);
266 ProcessScheduledActions(); 267 ProcessScheduledActions();
267 } 268 }
268 269
269 void Scheduler::DidPrepareTiles() { 270 void Scheduler::DidPrepareTiles() {
270 state_machine_.DidPrepareTiles(); 271 state_machine_.DidPrepareTiles();
271 } 272 }
272 273
273 void Scheduler::DidLoseOutputSurface() { 274 void Scheduler::DidLoseOutputSurface() {
274 TRACE_EVENT0("cc", "Scheduler::DidLoseOutputSurface"); 275 TRACE_EVENT0("cc", "Scheduler::DidLoseOutputSurface");
275 state_machine_.DidLoseOutputSurface(); 276 state_machine_.DidLoseOutputSurface();
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 // Queuing the frame counts as "using it", so we need to return true. 440 // Queuing the frame counts as "using it", so we need to return true.
440 } else { 441 } else {
441 BeginImplFrame(adjusted_args); 442 BeginImplFrame(adjusted_args);
442 } 443 }
443 return true; 444 return true;
444 } 445 }
445 446
446 void Scheduler::SetChildrenNeedBeginFrames(bool children_need_begin_frames) { 447 void Scheduler::SetChildrenNeedBeginFrames(bool children_need_begin_frames) {
447 DCHECK(settings_.forward_begin_frames_to_children); 448 DCHECK(settings_.forward_begin_frames_to_children);
448 state_machine_.SetChildrenNeedBeginFrames(children_need_begin_frames); 449 state_machine_.SetChildrenNeedBeginFrames(children_need_begin_frames);
449 DCHECK_EQ(state_machine_.NextAction(), SchedulerStateMachine::ACTION_NONE); 450 ProcessScheduledActions();
450 } 451 }
451 452
452 // BeginRetroFrame is called for BeginFrames that we've deferred because 453 // BeginRetroFrame is called for BeginFrames that we've deferred because
453 // the scheduler was in the middle of processing a previous BeginFrame. 454 // the scheduler was in the middle of processing a previous BeginFrame.
454 void Scheduler::BeginRetroFrame() { 455 void Scheduler::BeginRetroFrame() {
455 TRACE_EVENT0("cc", "Scheduler::BeginRetroFrame"); 456 TRACE_EVENT0("cc", "Scheduler::BeginRetroFrame");
456 DCHECK(!settings_.using_synchronous_renderer_compositor); 457 DCHECK(!settings_.using_synchronous_renderer_compositor);
457 DCHECK(begin_retro_frame_posted_); 458 DCHECK(begin_retro_frame_posted_);
458 begin_retro_frame_posted_ = false; 459 begin_retro_frame_posted_ = false;
459 460
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 } 801 }
801 802
802 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 803 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
803 return (state_machine_.commit_state() == 804 return (state_machine_.commit_state() ==
804 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 805 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
805 state_machine_.commit_state() == 806 state_machine_.commit_state() ==
806 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 807 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
807 } 808 }
808 809
809 } // namespace cc 810 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698