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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
726 bool Scheduler::WillDrawIfNeeded() const { | |
727 return !state_machine_.PendingDrawsShouldBeAborted(); | |
728 } | |
729 | |
730 scoped_refptr<base::debug::ConvertableToTraceFormat> Scheduler::AsValue() | 726 scoped_refptr<base::debug::ConvertableToTraceFormat> Scheduler::AsValue() |
731 const { | 727 const { |
732 scoped_refptr<base::debug::TracedValue> state = | 728 scoped_refptr<base::debug::TracedValue> state = |
733 new base::debug::TracedValue(); | 729 new base::debug::TracedValue(); |
734 AsValueInto(state.get()); | 730 AsValueInto(state.get()); |
735 return state; | 731 return state; |
736 } | 732 } |
737 | 733 |
738 void Scheduler::AsValueInto(base::debug::TracedValue* state) const { | 734 void Scheduler::AsValueInto(base::debug::TracedValue* state) const { |
739 state->BeginDictionary("state_machine"); | 735 state->BeginDictionary("state_machine"); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 } | 800 } |
805 | 801 |
806 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 802 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
807 return (state_machine_.commit_state() == | 803 return (state_machine_.commit_state() == |
808 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 804 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
809 state_machine_.commit_state() == | 805 state_machine_.commit_state() == |
810 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 806 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
811 } | 807 } |
812 | 808 |
813 } // namespace cc | 809 } // namespace cc |
OLD | NEW |