| 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 #ifndef CC_TEST_SCHEDULER_TEST_COMMON_H_ | 5 #ifndef CC_TEST_SCHEDULER_TEST_COMMON_H_ |
| 6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_ | 6 #define CC_TEST_SCHEDULER_TEST_COMMON_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool begin_frames_expected() const { | 143 bool begin_frames_expected() const { |
| 144 return begin_frame_source_ && observing_begin_frame_source_; | 144 return begin_frame_source_ && observing_begin_frame_source_; |
| 145 } | 145 } |
| 146 | 146 |
| 147 int current_frame_number() const { | 147 int current_frame_number() const { |
| 148 return state_machine_.current_frame_number(); | 148 return state_machine_.current_frame_number(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool needs_impl_side_invalidation() const { |
| 152 return state_machine_.needs_impl_side_invalidation(); |
| 153 } |
| 154 |
| 151 ~TestScheduler() override; | 155 ~TestScheduler() override; |
| 152 | 156 |
| 153 base::TimeDelta BeginImplFrameInterval() { | 157 base::TimeDelta BeginImplFrameInterval() { |
| 154 return begin_impl_frame_tracker_.Interval(); | 158 return begin_impl_frame_tracker_.Interval(); |
| 155 } | 159 } |
| 156 | 160 |
| 157 // Note: This setting will be overriden on the next BeginFrame in the | 161 // Note: This setting will be overriden on the next BeginFrame in the |
| 158 // scheduler. To control the value it gets on the next BeginFrame | 162 // scheduler. To control the value it gets on the next BeginFrame |
| 159 // Pass in a fake CompositorTimingHistory that indicates BeginMainFrame | 163 // Pass in a fake CompositorTimingHistory that indicates BeginMainFrame |
| 160 // to Activation is fast. | 164 // to Activation is fast. |
| 161 void SetCriticalBeginMainFrameToActivateIsFast(bool is_fast) { | 165 void SetCriticalBeginMainFrameToActivateIsFast(bool is_fast) { |
| 162 state_machine_.SetCriticalBeginMainFrameToActivateIsFast(is_fast); | 166 state_machine_.SetCriticalBeginMainFrameToActivateIsFast(is_fast); |
| 163 } | 167 } |
| 164 | 168 |
| 165 protected: | 169 protected: |
| 166 // Overridden from Scheduler. | 170 // Overridden from Scheduler. |
| 167 base::TimeTicks Now() const override; | 171 base::TimeTicks Now() const override; |
| 168 | 172 |
| 169 private: | 173 private: |
| 170 base::SimpleTestTickClock* now_src_; | 174 base::SimpleTestTickClock* now_src_; |
| 171 | 175 |
| 172 DISALLOW_COPY_AND_ASSIGN(TestScheduler); | 176 DISALLOW_COPY_AND_ASSIGN(TestScheduler); |
| 173 }; | 177 }; |
| 174 | 178 |
| 175 } // namespace cc | 179 } // namespace cc |
| 176 | 180 |
| 177 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ | 181 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ |
| OLD | NEW |