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

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

Issue 1039533002: cc: Add support for sending BeginFrames for video. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@misc_video_refactoring
Patch Set: Fix comment. Created 5 years, 8 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/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_state_machine.h » ('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 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/logging.h" 10 #include "base/logging.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 state_machine_.SetChildrenNeedBeginFrames(children_need_begin_frames); 394 state_machine_.SetChildrenNeedBeginFrames(children_need_begin_frames);
395 ProcessScheduledActions(); 395 ProcessScheduledActions();
396 } 396 }
397 397
398 void Scheduler::SetAuthoritativeVSyncInterval(const base::TimeDelta& interval) { 398 void Scheduler::SetAuthoritativeVSyncInterval(const base::TimeDelta& interval) {
399 authoritative_vsync_interval_ = interval; 399 authoritative_vsync_interval_ = interval;
400 if (vsync_observer_) 400 if (vsync_observer_)
401 vsync_observer_->OnUpdateVSyncParameters(last_vsync_timebase_, interval); 401 vsync_observer_->OnUpdateVSyncParameters(last_vsync_timebase_, interval);
402 } 402 }
403 403
404 void Scheduler::SetVideoNeedsBeginFrames(bool video_needs_begin_frames) {
405 state_machine_.SetVideoNeedsBeginFrames(video_needs_begin_frames);
406 ProcessScheduledActions();
407 }
408
404 void Scheduler::OnDrawForOutputSurface() { 409 void Scheduler::OnDrawForOutputSurface() {
405 DCHECK(settings_.using_synchronous_renderer_compositor); 410 DCHECK(settings_.using_synchronous_renderer_compositor);
406 DCHECK_EQ(state_machine_.begin_impl_frame_state(), 411 DCHECK_EQ(state_machine_.begin_impl_frame_state(),
407 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); 412 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE);
408 DCHECK(!BeginImplFrameDeadlinePending()); 413 DCHECK(!BeginImplFrameDeadlinePending());
409 414
410 state_machine_.OnBeginImplFrameDeadline(); 415 state_machine_.OnBeginImplFrameDeadline();
411 ProcessScheduledActions(); 416 ProcessScheduledActions();
412 417
413 state_machine_.OnBeginImplFrameIdle(); 418 state_machine_.OnBeginImplFrameIdle();
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 } 830 }
826 831
827 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 832 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
828 return (state_machine_.commit_state() == 833 return (state_machine_.commit_state() ==
829 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 834 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
830 state_machine_.commit_state() == 835 state_machine_.commit_state() ==
831 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 836 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
832 } 837 }
833 838
834 } // namespace cc 839 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698