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/debug/trace_event_argument.h" | 10 #include "base/debug/trace_event_argument.h" |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 ProcessScheduledActions(); | 600 ProcessScheduledActions(); |
601 state_machine_.DidLeavePollForAnticipatedDrawTriggers(); | 601 state_machine_.DidLeavePollForAnticipatedDrawTriggers(); |
602 } | 602 } |
603 | 603 |
604 void Scheduler::PollToAdvanceCommitState() { | 604 void Scheduler::PollToAdvanceCommitState() { |
605 TRACE_EVENT0("cc", "Scheduler::PollToAdvanceCommitState"); | 605 TRACE_EVENT0("cc", "Scheduler::PollToAdvanceCommitState"); |
606 advance_commit_state_task_.Cancel(); | 606 advance_commit_state_task_.Cancel(); |
607 ProcessScheduledActions(); | 607 ProcessScheduledActions(); |
608 } | 608 } |
609 | 609 |
610 bool Scheduler::IsBeginMainFrameSent() const { | |
611 return state_machine_.commit_state() == | |
612 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT; | |
613 } | |
614 | |
615 void Scheduler::DrawAndSwapIfPossible() { | 610 void Scheduler::DrawAndSwapIfPossible() { |
616 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); | 611 DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible(); |
617 state_machine_.DidDrawIfPossibleCompleted(result); | 612 state_machine_.DidDrawIfPossibleCompleted(result); |
618 } | 613 } |
619 | 614 |
620 void Scheduler::ProcessScheduledActions() { | 615 void Scheduler::ProcessScheduledActions() { |
621 // We do not allow ProcessScheduledActions to be recursive. | 616 // We do not allow ProcessScheduledActions to be recursive. |
622 // The top-level call will iteratively execute the next action for us anyway. | 617 // The top-level call will iteratively execute the next action for us anyway. |
623 if (inside_process_scheduled_actions_) | 618 if (inside_process_scheduled_actions_) |
624 return; | 619 return; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 } | 753 } |
759 | 754 |
760 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 755 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
761 return (state_machine_.commit_state() == | 756 return (state_machine_.commit_state() == |
762 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 757 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
763 state_machine_.commit_state() == | 758 state_machine_.commit_state() == |
764 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 759 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
765 } | 760 } |
766 | 761 |
767 } // namespace cc | 762 } // namespace cc |
OLD | NEW |