| OLD | NEW |
| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 begin_impl_frame_deadline_mode_( | 61 begin_impl_frame_deadline_mode_( |
| 62 SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_NONE), | 62 SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_NONE), |
| 63 begin_impl_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE), | 63 begin_impl_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE), |
| 64 state_machine_(settings), | 64 state_machine_(settings), |
| 65 inside_process_scheduled_actions_(false), | 65 inside_process_scheduled_actions_(false), |
| 66 inside_action_(SchedulerStateMachine::ACTION_NONE), | 66 inside_action_(SchedulerStateMachine::ACTION_NONE), |
| 67 weak_factory_(this) { | 67 weak_factory_(this) { |
| 68 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue()); | 68 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue()); |
| 69 DCHECK(client_); | 69 DCHECK(client_); |
| 70 DCHECK(!state_machine_.BeginFrameNeeded()); | 70 DCHECK(!state_machine_.BeginFrameNeeded()); |
| 71 DCHECK_IMPLIES(settings_.use_external_begin_frame_source, | 71 DCHECK(!settings_.use_external_begin_frame_source || external_frame_source_); |
| 72 external_frame_source_); | 72 DCHECK(settings_.use_external_begin_frame_source || synthetic_frame_source_); |
| 73 DCHECK_IMPLIES(!settings_.use_external_begin_frame_source, | |
| 74 synthetic_frame_source_); | |
| 75 DCHECK(unthrottled_frame_source_); | 73 DCHECK(unthrottled_frame_source_); |
| 76 | 74 |
| 77 begin_retro_frame_closure_ = | 75 begin_retro_frame_closure_ = |
| 78 base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr()); | 76 base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr()); |
| 79 begin_impl_frame_deadline_closure_ = base::Bind( | 77 begin_impl_frame_deadline_closure_ = base::Bind( |
| 80 &Scheduler::OnBeginImplFrameDeadline, weak_factory_.GetWeakPtr()); | 78 &Scheduler::OnBeginImplFrameDeadline, weak_factory_.GetWeakPtr()); |
| 81 | 79 |
| 82 frame_source_->AddObserver(this); | 80 frame_source_->AddObserver(this); |
| 83 frame_source_->AddSource(primary_frame_source()); | 81 frame_source_->AddSource(primary_frame_source()); |
| 84 primary_frame_source()->SetClientReady(); | 82 primary_frame_source()->SetClientReady(); |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 } | 743 } |
| 746 | 744 |
| 747 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 745 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 748 return (state_machine_.commit_state() == | 746 return (state_machine_.commit_state() == |
| 749 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 747 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 750 state_machine_.commit_state() == | 748 state_machine_.commit_state() == |
| 751 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 749 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 752 } | 750 } |
| 753 | 751 |
| 754 } // namespace cc | 752 } // namespace cc |
| OLD | NEW |