| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } | 287 } |
| 288 | 288 |
| 289 void Scheduler::PollForAnticipatedDrawTriggers() { | 289 void Scheduler::PollForAnticipatedDrawTriggers() { |
| 290 TRACE_EVENT0("cc", "Scheduler::PollForAnticipatedDrawTriggers"); | 290 TRACE_EVENT0("cc", "Scheduler::PollForAnticipatedDrawTriggers"); |
| 291 poll_for_draw_triggers_closure_.Cancel(); | 291 poll_for_draw_triggers_closure_.Cancel(); |
| 292 state_machine_.DidEnterPollForAnticipatedDrawTriggers(); | 292 state_machine_.DidEnterPollForAnticipatedDrawTriggers(); |
| 293 ProcessScheduledActions(); | 293 ProcessScheduledActions(); |
| 294 state_machine_.DidLeavePollForAnticipatedDrawTriggers(); | 294 state_machine_.DidLeavePollForAnticipatedDrawTriggers(); |
| 295 } | 295 } |
| 296 | 296 |
| 297 bool Scheduler::IsBeginMainFrameSent() const { |
| 298 return state_machine_.commit_state() == |
| 299 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT; |
| 300 } |
| 301 |
| 297 void Scheduler::DrawAndSwapIfPossible() { | 302 void Scheduler::DrawAndSwapIfPossible() { |
| 298 DrawSwapReadbackResult result = | 303 DrawSwapReadbackResult result = |
| 299 client_->ScheduledActionDrawAndSwapIfPossible(); | 304 client_->ScheduledActionDrawAndSwapIfPossible(); |
| 300 state_machine_.DidDrawIfPossibleCompleted(result.draw_result); | 305 state_machine_.DidDrawIfPossibleCompleted(result.draw_result); |
| 301 } | 306 } |
| 302 | 307 |
| 303 void Scheduler::DrawAndSwapForced() { | 308 void Scheduler::DrawAndSwapForced() { |
| 304 client_->ScheduledActionDrawAndSwapForced(); | 309 client_->ScheduledActionDrawAndSwapForced(); |
| 305 } | 310 } |
| 306 | 311 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 } | 424 } |
| 420 | 425 |
| 421 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 426 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 422 return (state_machine_.commit_state() == | 427 return (state_machine_.commit_state() == |
| 423 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 428 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 424 state_machine_.commit_state() == | 429 state_machine_.commit_state() == |
| 425 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 430 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 426 } | 431 } |
| 427 | 432 |
| 428 } // namespace cc | 433 } // namespace cc |
| OLD | NEW |