Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: cc/test/scheduler_test_common.h

Issue 1133673004: cc: Heuristic for Renderer latency recovery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add SchedulerStateMachine::SwapThrottled Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 external_begin_frame_source.Pass())); 175 external_begin_frame_source.Pass()));
176 } 176 }
177 177
178 // Extra test helper functionality 178 // Extra test helper functionality
179 bool IsBeginRetroFrameArgsEmpty() const { 179 bool IsBeginRetroFrameArgsEmpty() const {
180 return begin_retro_frame_args_.empty(); 180 return begin_retro_frame_args_.empty();
181 } 181 }
182 182
183 bool CanStart() const { return state_machine_.CanStartForTesting(); } 183 bool CanStart() const { return state_machine_.CanStartForTesting(); }
184 184
185 bool NeedsCommit() const { return state_machine_.needs_commit(); }
186
185 BeginFrameSource& frame_source() { return *frame_source_; } 187 BeginFrameSource& frame_source() { return *frame_source_; }
186 bool FrameProductionThrottled() { return throttle_frame_production_; } 188 bool FrameProductionThrottled() { return throttle_frame_production_; }
187 BeginFrameArgs begin_impl_frame_args() { return begin_impl_frame_args_; } 189 BeginFrameArgs begin_impl_frame_args() { return begin_impl_frame_args_; }
188 190
191 bool MainThreadIsInHighLatencyMode() const {
192 return state_machine_.MainThreadIsInHighLatencyMode();
193 }
194
189 ~TestScheduler() override; 195 ~TestScheduler() override;
190 196
191 void NotifyReadyToCommitThenActivateIfNeeded() { 197 void NotifyReadyToCommitThenActivateIfNeeded() {
192 NotifyReadyToCommit(); 198 NotifyReadyToCommit();
193 if (settings_.impl_side_painting) { 199 if (settings_.impl_side_painting) {
194 NotifyReadyToActivate(); 200 NotifyReadyToActivate();
195 } 201 }
196 } 202 }
197 203
198 protected: 204 protected:
199 // Overridden from Scheduler. 205 // Overridden from Scheduler.
200 base::TimeTicks Now() const override; 206 base::TimeTicks Now() const override;
201 207
202 private: 208 private:
203 TestScheduler( 209 TestScheduler(
204 scoped_refptr<TestNowSource> now_src, 210 scoped_refptr<TestNowSource> now_src,
205 SchedulerClient* client, 211 SchedulerClient* client,
206 const SchedulerSettings& scheduler_settings, 212 const SchedulerSettings& scheduler_settings,
207 int layer_tree_host_id, 213 int layer_tree_host_id,
208 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner, 214 const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner,
209 TestSchedulerFrameSourcesConstructor* frame_sources_constructor, 215 TestSchedulerFrameSourcesConstructor* frame_sources_constructor,
210 scoped_ptr<BeginFrameSource> external_begin_frame_source); 216 scoped_ptr<BeginFrameSource> external_begin_frame_source);
211 217
212 scoped_refptr<TestNowSource> now_src_; 218 scoped_refptr<TestNowSource> now_src_;
213 }; 219 };
214 220
215 } // namespace cc 221 } // namespace cc
216 222
217 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_ 223 #endif // CC_TEST_SCHEDULER_TEST_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698