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 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "cc/debug/devtools_instrumentation.h" | 11 #include "cc/debug/devtools_instrumentation.h" |
12 #include "cc/debug/traced_value.h" | 12 #include "cc/debug/traced_value.h" |
13 #include "ui/gfx/frame_time.h" | 13 #include "ui/gfx/frame_time.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 Scheduler::Scheduler(SchedulerClient* client, | 17 Scheduler::Scheduler(SchedulerClient* client, |
18 const SchedulerSettings& scheduler_settings, | 18 const SchedulerSettings& scheduler_settings, |
19 int layer_tree_host_id) | 19 int layer_tree_host_id) |
20 : settings_(scheduler_settings), | 20 : settings_(scheduler_settings), |
21 client_(client), | 21 client_(client), |
22 layer_tree_host_id_(layer_tree_host_id), | 22 layer_tree_host_id_(layer_tree_host_id), |
23 last_set_needs_begin_impl_frame_(false), | 23 last_set_needs_begin_impl_frame_(false), |
24 state_machine_(scheduler_settings), | 24 state_machine_(scheduler_settings), |
25 inside_process_scheduled_actions_(false), | 25 inside_process_scheduled_actions_(false), |
26 inside_action_(SchedulerStateMachine::ACTION_NONE), | 26 inside_action_(SchedulerStateMachine::ACTION_NONE), |
27 weak_factory_(this) { | 27 weak_factory_(this) { |
28 DCHECK(client_); | 28 DCHECK(client_); |
29 DCHECK(!state_machine_.BeginImplFrameNeeded()); | 29 DCHECK(!state_machine_.BeginImplFrameNeeded()); |
| 30 if (settings_.main_frame_before_activation_enabled) { |
| 31 DCHECK(settings_.main_frame_before_draw_enabled); |
| 32 } |
30 } | 33 } |
31 | 34 |
32 Scheduler::~Scheduler() {} | 35 Scheduler::~Scheduler() {} |
33 | 36 |
34 void Scheduler::SetCanStart() { | 37 void Scheduler::SetCanStart() { |
35 state_machine_.SetCanStart(); | 38 state_machine_.SetCanStart(); |
36 ProcessScheduledActions(); | 39 ProcessScheduledActions(); |
37 } | 40 } |
38 | 41 |
39 void Scheduler::SetVisible(bool visible) { | 42 void Scheduler::SetVisible(bool visible) { |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 } | 441 } |
439 | 442 |
440 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 443 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
441 return (state_machine_.commit_state() == | 444 return (state_machine_.commit_state() == |
442 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 445 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
443 state_machine_.commit_state() == | 446 state_machine_.commit_state() == |
444 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 447 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
445 } | 448 } |
446 | 449 |
447 } // namespace cc | 450 } // namespace cc |
OLD | NEW |