| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 void Scheduler::SetNeedsRedraw() { | 217 void Scheduler::SetNeedsRedraw() { |
| 218 state_machine_.SetNeedsRedraw(); | 218 state_machine_.SetNeedsRedraw(); |
| 219 ProcessScheduledActions(); | 219 ProcessScheduledActions(); |
| 220 } | 220 } |
| 221 | 221 |
| 222 void Scheduler::SetNeedsAnimate() { | 222 void Scheduler::SetNeedsAnimate() { |
| 223 state_machine_.SetNeedsAnimate(); | 223 state_machine_.SetNeedsAnimate(); |
| 224 ProcessScheduledActions(); | 224 ProcessScheduledActions(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void Scheduler::SetNeedsManageTiles() { | 227 void Scheduler::SetNeedsPrepareTiles() { |
| 228 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES)); | 228 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_PREPARE_TILES)); |
| 229 state_machine_.SetNeedsManageTiles(); | 229 state_machine_.SetNeedsPrepareTiles(); |
| 230 ProcessScheduledActions(); | 230 ProcessScheduledActions(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void Scheduler::SetMaxSwapsPending(int max) { | 233 void Scheduler::SetMaxSwapsPending(int max) { |
| 234 state_machine_.SetMaxSwapsPending(max); | 234 state_machine_.SetMaxSwapsPending(max); |
| 235 } | 235 } |
| 236 | 236 |
| 237 void Scheduler::DidSwapBuffers() { | 237 void Scheduler::DidSwapBuffers() { |
| 238 state_machine_.DidSwapBuffers(); | 238 state_machine_.DidSwapBuffers(); |
| 239 | 239 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 259 state_machine_.NotifyReadyToCommit(); | 259 state_machine_.NotifyReadyToCommit(); |
| 260 ProcessScheduledActions(); | 260 ProcessScheduledActions(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 void Scheduler::BeginMainFrameAborted(bool did_handle) { | 263 void Scheduler::BeginMainFrameAborted(bool did_handle) { |
| 264 TRACE_EVENT0("cc", "Scheduler::BeginMainFrameAborted"); | 264 TRACE_EVENT0("cc", "Scheduler::BeginMainFrameAborted"); |
| 265 state_machine_.BeginMainFrameAborted(did_handle); | 265 state_machine_.BeginMainFrameAborted(did_handle); |
| 266 ProcessScheduledActions(); | 266 ProcessScheduledActions(); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void Scheduler::DidManageTiles() { | 269 void Scheduler::DidPrepareTiles() { |
| 270 state_machine_.DidManageTiles(); | 270 state_machine_.DidPrepareTiles(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void Scheduler::DidLoseOutputSurface() { | 273 void Scheduler::DidLoseOutputSurface() { |
| 274 TRACE_EVENT0("cc", "Scheduler::DidLoseOutputSurface"); | 274 TRACE_EVENT0("cc", "Scheduler::DidLoseOutputSurface"); |
| 275 state_machine_.DidLoseOutputSurface(); | 275 state_machine_.DidLoseOutputSurface(); |
| 276 if (frame_source_->NeedsBeginFrames()) | 276 if (frame_source_->NeedsBeginFrames()) |
| 277 frame_source_->SetNeedsBeginFrames(false); | 277 frame_source_->SetNeedsBeginFrames(false); |
| 278 begin_retro_frame_args_.clear(); | 278 begin_retro_frame_args_.clear(); |
| 279 ProcessScheduledActions(); | 279 ProcessScheduledActions(); |
| 280 } | 280 } |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED: | 704 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_FORCED: |
| 705 client_->ScheduledActionDrawAndSwapForced(); | 705 client_->ScheduledActionDrawAndSwapForced(); |
| 706 break; | 706 break; |
| 707 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT: | 707 case SchedulerStateMachine::ACTION_DRAW_AND_SWAP_ABORT: |
| 708 // No action is actually performed, but this allows the state machine to | 708 // No action is actually performed, but this allows the state machine to |
| 709 // advance out of its waiting to draw state without actually drawing. | 709 // advance out of its waiting to draw state without actually drawing. |
| 710 break; | 710 break; |
| 711 case SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION: | 711 case SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_CREATION: |
| 712 client_->ScheduledActionBeginOutputSurfaceCreation(); | 712 client_->ScheduledActionBeginOutputSurfaceCreation(); |
| 713 break; | 713 break; |
| 714 case SchedulerStateMachine::ACTION_MANAGE_TILES: | 714 case SchedulerStateMachine::ACTION_PREPARE_TILES: |
| 715 client_->ScheduledActionManageTiles(); | 715 client_->ScheduledActionPrepareTiles(); |
| 716 break; | 716 break; |
| 717 } | 717 } |
| 718 } while (action != SchedulerStateMachine::ACTION_NONE); | 718 } while (action != SchedulerStateMachine::ACTION_NONE); |
| 719 | 719 |
| 720 SetupNextBeginFrameIfNeeded(); | 720 SetupNextBeginFrameIfNeeded(); |
| 721 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); | 721 client_->DidAnticipatedDrawTimeChange(AnticipatedDrawTime()); |
| 722 | 722 |
| 723 RescheduleBeginImplFrameDeadlineIfNeeded(); | 723 RescheduleBeginImplFrameDeadlineIfNeeded(); |
| 724 } | 724 } |
| 725 | 725 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 } | 804 } |
| 805 | 805 |
| 806 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 806 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 807 return (state_machine_.commit_state() == | 807 return (state_machine_.commit_state() == |
| 808 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 808 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 809 state_machine_.commit_state() == | 809 state_machine_.commit_state() == |
| 810 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 810 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 811 } | 811 } |
| 812 | 812 |
| 813 } // namespace cc | 813 } // namespace cc |
| OLD | NEW |