| 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 weak_factory_(this) { | 61 weak_factory_(this) { |
| 62 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue()); | 62 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue()); |
| 63 DCHECK(client_); | 63 DCHECK(client_); |
| 64 DCHECK(!state_machine_.BeginFrameNeeded()); | 64 DCHECK(!state_machine_.BeginFrameNeeded()); |
| 65 | 65 |
| 66 begin_retro_frame_closure_ = | 66 begin_retro_frame_closure_ = |
| 67 base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr()); | 67 base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr()); |
| 68 begin_impl_frame_deadline_closure_ = base::Bind( | 68 begin_impl_frame_deadline_closure_ = base::Bind( |
| 69 &Scheduler::OnBeginImplFrameDeadline, weak_factory_.GetWeakPtr()); | 69 &Scheduler::OnBeginImplFrameDeadline, weak_factory_.GetWeakPtr()); |
| 70 | 70 |
| 71 begin_frame_source_->SetClientReady(); | |
| 72 ProcessScheduledActions(); | 71 ProcessScheduledActions(); |
| 73 } | 72 } |
| 74 | 73 |
| 75 Scheduler::~Scheduler() { | 74 Scheduler::~Scheduler() { |
| 76 if (observing_begin_frame_source_) | 75 if (observing_begin_frame_source_) |
| 77 begin_frame_source_->RemoveObserver(this); | 76 begin_frame_source_->RemoveObserver(this); |
| 78 } | 77 } |
| 79 | 78 |
| 80 base::TimeTicks Scheduler::Now() const { | 79 base::TimeTicks Scheduler::Now() const { |
| 81 base::TimeTicks now = base::TimeTicks::Now(); | 80 base::TimeTicks now = base::TimeTicks::Now(); |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 } | 851 } |
| 853 | 852 |
| 854 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 853 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 855 return (state_machine_.begin_main_frame_state() == | 854 return (state_machine_.begin_main_frame_state() == |
| 856 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || | 855 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || |
| 857 state_machine_.begin_main_frame_state() == | 856 state_machine_.begin_main_frame_state() == |
| 858 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); | 857 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); |
| 859 } | 858 } |
| 860 | 859 |
| 861 } // namespace cc | 860 } // namespace cc |
| OLD | NEW |