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

Unified Diff: cc/test/scheduler_test_common.h

Issue 1184863004: cc: Move timing history to the Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, add include Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: cc/test/scheduler_test_common.h
diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h
index d45019c8e6362b2538f1ff5ab5213fa6b507d3ba..81df2b8c1c0e5ade684a4d66407f3a69188191d5 100644
--- a/cc/test/scheduler_test_common.h
+++ b/cc/test/scheduler_test_common.h
@@ -17,6 +17,8 @@
namespace cc {
+class RenderingStatsInstrumentation;
+
class FakeTimeSourceClient : public TimeSourceClient {
public:
FakeTimeSourceClient() : tick_called_(false) {}
@@ -163,17 +165,14 @@ class TestScheduler : public Scheduler {
const SchedulerSettings& scheduler_settings,
int layer_tree_host_id,
const scoped_refptr<OrderedSimpleTaskRunner>& task_runner,
- scoped_ptr<BeginFrameSource> external_begin_frame_source) {
+ scoped_ptr<BeginFrameSource> external_begin_frame_source,
+ RenderingStatsInstrumentation* rendering_stats_instrumentation) {
TestSchedulerFrameSourcesConstructor frame_sources_constructor(
task_runner.get(), now_src);
return make_scoped_ptr(new TestScheduler(
- now_src,
- client,
- scheduler_settings,
- layer_tree_host_id,
- task_runner,
- &frame_sources_constructor,
- external_begin_frame_source.Pass()));
+ now_src, client, scheduler_settings, layer_tree_host_id, task_runner,
+ &frame_sources_constructor, external_begin_frame_source.Pass(),
+ rendering_stats_instrumentation));
}
// Extra test helper functionality
@@ -192,6 +191,14 @@ class TestScheduler : public Scheduler {
return begin_impl_frame_tracker_.Interval();
}
+ void SetDrawDurationEstimate(base::TimeDelta duration);
+ void SetBeginMainFrameToCommitDurationEstimate(base::TimeDelta duration);
+ void SetCommitToActivateDurationEstimate(base::TimeDelta duration);
+
+ base::TimeDelta DrawDurationEstimate() const override;
+ base::TimeDelta BeginMainFrameToCommitDurationEstimate() const override;
+ base::TimeDelta CommitToActivateDurationEstimate() const override;
+
protected:
// Overridden from Scheduler.
base::TimeTicks Now() const override;
@@ -203,10 +210,15 @@ class TestScheduler : public Scheduler {
int layer_tree_host_id,
const scoped_refptr<OrderedSimpleTaskRunner>& test_task_runner,
TestSchedulerFrameSourcesConstructor* frame_sources_constructor,
- scoped_ptr<BeginFrameSource> external_begin_frame_source);
+ scoped_ptr<BeginFrameSource> external_begin_frame_source,
+ RenderingStatsInstrumentation* rendering_stats_instrumentation);
// Not owned.
base::SimpleTestTickClock* now_src_;
+
+ base::TimeDelta draw_duration_;
+ base::TimeDelta begin_main_frame_to_commit_duration_;
+ base::TimeDelta commit_to_activate_duration_;
};
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698