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" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 state_machine_.SetNeedsRedraw(); | 72 state_machine_.SetNeedsRedraw(); |
73 ProcessScheduledActions(); | 73 ProcessScheduledActions(); |
74 } | 74 } |
75 | 75 |
76 void Scheduler::SetNeedsManageTiles() { | 76 void Scheduler::SetNeedsManageTiles() { |
77 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES)); | 77 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES)); |
78 state_machine_.SetNeedsManageTiles(); | 78 state_machine_.SetNeedsManageTiles(); |
79 ProcessScheduledActions(); | 79 ProcessScheduledActions(); |
80 } | 80 } |
81 | 81 |
| 82 void Scheduler::SetMaxSwapsPending(int max) { |
| 83 state_machine_.SetMaxSwapsPending(max); |
| 84 } |
| 85 |
| 86 void Scheduler::DidSwapBuffers() { state_machine_.DidSwapBuffers(); } |
| 87 |
82 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { | 88 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { |
83 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); | 89 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); |
84 ProcessScheduledActions(); | 90 ProcessScheduledActions(); |
85 } | 91 } |
86 | 92 |
| 93 void Scheduler::OnSwapBuffersComplete() { |
| 94 state_machine_.OnSwapBuffersComplete(); |
| 95 ProcessScheduledActions(); |
| 96 } |
| 97 |
87 void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) { | 98 void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) { |
88 state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority); | 99 state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority); |
89 ProcessScheduledActions(); | 100 ProcessScheduledActions(); |
90 } | 101 } |
91 | 102 |
92 void Scheduler::SetMainThreadNeedsLayerTextures() { | 103 void Scheduler::SetMainThreadNeedsLayerTextures() { |
93 state_machine_.SetMainThreadNeedsLayerTextures(); | 104 state_machine_.SetMainThreadNeedsLayerTextures(); |
94 ProcessScheduledActions(); | 105 ProcessScheduledActions(); |
95 } | 106 } |
96 | 107 |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 452 } |
442 | 453 |
443 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 454 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
444 return (state_machine_.commit_state() == | 455 return (state_machine_.commit_state() == |
445 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 456 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
446 state_machine_.commit_state() == | 457 state_machine_.commit_state() == |
447 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 458 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
448 } | 459 } |
449 | 460 |
450 } // namespace cc | 461 } // namespace cc |
OLD | NEW |