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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { | 92 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { |
93 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); | 93 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); |
94 ProcessScheduledActions(); | 94 ProcessScheduledActions(); |
95 } | 95 } |
96 | 96 |
97 void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) { | 97 void Scheduler::SetSmoothnessTakesPriority(bool smoothness_takes_priority) { |
98 state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority); | 98 state_machine_.SetSmoothnessTakesPriority(smoothness_takes_priority); |
99 ProcessScheduledActions(); | 99 ProcessScheduledActions(); |
100 } | 100 } |
101 | 101 |
102 void Scheduler::SetMainThreadNeedsLayerTextures() { | |
103 state_machine_.SetMainThreadNeedsLayerTextures(); | |
104 ProcessScheduledActions(); | |
105 } | |
106 | |
107 void Scheduler::NotifyReadyToCommit() { | 102 void Scheduler::NotifyReadyToCommit() { |
108 TRACE_EVENT0("cc", "Scheduler::NotifyReadyToCommit"); | 103 TRACE_EVENT0("cc", "Scheduler::NotifyReadyToCommit"); |
109 state_machine_.NotifyReadyToCommit(); | 104 state_machine_.NotifyReadyToCommit(); |
110 ProcessScheduledActions(); | 105 ProcessScheduledActions(); |
111 } | 106 } |
112 | 107 |
113 void Scheduler::BeginMainFrameAborted(bool did_handle) { | 108 void Scheduler::BeginMainFrameAborted(bool did_handle) { |
114 TRACE_EVENT0("cc", "Scheduler::BeginMainFrameAborted"); | 109 TRACE_EVENT0("cc", "Scheduler::BeginMainFrameAborted"); |
115 state_machine_.BeginMainFrameAborted(did_handle); | 110 state_machine_.BeginMainFrameAborted(did_handle); |
116 ProcessScheduledActions(); | 111 ProcessScheduledActions(); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT: | 389 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT: |
395 // No action is actually performed, but this allows the state machine to | 390 // No action is actually performed, but this allows the state machine to |
396 // advance out of its waiting to draw state without actually drawing. | 391 // advance out of its waiting to draw state without actually drawing. |
397 break; | 392 break; |
398 case SchedulerStateMachine::ACTION_DRAW_AND_READBACK: | 393 case SchedulerStateMachine::ACTION_DRAW_AND_READBACK: |
399 DrawAndReadback(); | 394 DrawAndReadback(); |
400 break; | 395 break; |
401 case SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION: | 396 case SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION: |
402 client_->ScheduledActionBeginOutputSurfaceCreation(); | 397 client_->ScheduledActionBeginOutputSurfaceCreation(); |
403 break; | 398 break; |
404 case SchedulerStateMachine::ACTION_ACQUIRE_LAYER_TEXTURES_FOR_MAIN_THREAD: | |
405 client_->ScheduledActionAcquireLayerTexturesForMainThread(); | |
406 break; | |
407 case SchedulerStateMachine::ACTION_MANAGE_TILES: | 399 case SchedulerStateMachine::ACTION_MANAGE_TILES: |
408 client_->ScheduledActionManageTiles(); | 400 client_->ScheduledActionManageTiles(); |
409 break; | 401 break; |
410 } | 402 } |
411 } while (action != SchedulerStateMachine::ACTION_NONE); | 403 } while (action != SchedulerStateMachine::ACTION_NONE); |
412 | 404 |
413 SetupNextBeginImplFrameIfNeeded(); | 405 SetupNextBeginImplFrameIfNeeded(); |
414 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); | 406 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); |
415 | 407 |
416 if (state_machine_.ShouldTriggerBeginImplFrameDeadlineEarly()) { | 408 if (state_machine_.ShouldTriggerBeginImplFrameDeadlineEarly()) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 } | 466 } |
475 | 467 |
476 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 468 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
477 return (state_machine_.commit_state() == | 469 return (state_machine_.commit_state() == |
478 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 470 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
479 state_machine_.commit_state() == | 471 state_machine_.commit_state() == |
480 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 472 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
481 } | 473 } |
482 | 474 |
483 } // namespace cc | 475 } // namespace cc |
OLD | NEW |