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

Unified Diff: cc/trees/thread_proxy.cc

Issue 1184863004: cc: Move timing history to the Scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add cc:: 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
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | components/view_manager/surfaces/surfaces_scheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 0af1382332a2621e8c2afa16cd8d72e49b041c81..248e6aea88f1be109316eadce45fa448b36b78ad 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -20,7 +20,7 @@
#include "cc/output/swap_promise.h"
#include "cc/quads/draw_quad.h"
#include "cc/scheduler/commit_earlyout_reason.h"
-#include "cc/scheduler/delay_based_time_source.h"
+#include "cc/scheduler/compositor_timing_history.h"
#include "cc/scheduler/scheduler.h"
#include "cc/trees/blocking_task_runner.h"
#include "cc/trees/layer_tree_host.h"
@@ -112,8 +112,8 @@ ThreadProxy::CompositorThreadOnly::CompositorThreadOnly(
base::Bind(&ThreadProxy::RenewTreePriority, base::Unretained(proxy)),
base::TimeDelta::FromMilliseconds(
kSmoothnessTakesPriorityExpirationDelay * 1000)),
- timing_history(rendering_stats_instrumentation),
external_begin_frame_source(external_begin_frame_source.Pass()),
+ rendering_stats_instrumentation(rendering_stats_instrumentation),
weak_factory(proxy) {
}
@@ -665,7 +665,6 @@ void ThreadProxy::ScheduledActionSendBeginMainFrame() {
base::Passed(&begin_main_frame_state)));
devtools_instrumentation::DidRequestMainThreadFrame(
impl().layer_tree_host_id);
- impl().timing_history.DidBeginMainFrame();
}
void ThreadProxy::SendBeginMainFrameNotExpectedSoon() {
@@ -920,8 +919,6 @@ void ThreadProxy::ScheduledActionCommit() {
SetInputThrottledUntilCommitOnImplThread(false);
impl().next_frame_is_newly_committed_frame = true;
-
- impl().timing_history.DidCommit();
}
void ThreadProxy::ScheduledActionActivateSyncTree() {
@@ -945,7 +942,6 @@ DrawResult ThreadProxy::DrawSwapInternal(bool forced_draw) {
DCHECK(IsImplThread());
DCHECK(impl().layer_tree_host_impl.get());
- impl().timing_history.DidStartDrawing();
base::AutoReset<bool> mark_inside(&impl().inside_draw, true);
if (impl().layer_tree_host_impl->pending_tree()) {
@@ -997,9 +993,6 @@ DrawResult ThreadProxy::DrawSwapInternal(bool forced_draw) {
base::Bind(&ThreadProxy::DidCommitAndDrawFrame, main_thread_weak_ptr_));
}
- if (result == DRAW_SUCCESS)
- impl().timing_history.DidFinishDrawing();
-
DCHECK_NE(INVALID_RESULT, result);
return result;
}
@@ -1033,18 +1026,6 @@ void ThreadProxy::ScheduledActionInvalidateOutputSurface() {
impl().layer_tree_host_impl->output_surface()->Invalidate();
}
-base::TimeDelta ThreadProxy::DrawDurationEstimate() {
- return impl().timing_history.DrawDurationEstimate();
-}
-
-base::TimeDelta ThreadProxy::BeginMainFrameToCommitDurationEstimate() {
- return impl().timing_history.BeginMainFrameToCommitDurationEstimate();
-}
-
-base::TimeDelta ThreadProxy::CommitToActivateDurationEstimate() {
- return impl().timing_history.CommitToActivateDurationEstimate();
-}
-
void ThreadProxy::DidFinishImplFrame() {
impl().layer_tree_host_impl->DidFinishImplFrame();
}
@@ -1079,11 +1060,18 @@ void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) {
DCHECK(IsImplThread());
impl().layer_tree_host_impl =
layer_tree_host()->CreateLayerTreeHostImpl(this);
+
SchedulerSettings scheduler_settings(
layer_tree_host()->settings().ToSchedulerSettings());
+
+ scoped_ptr<CompositorTimingHistory> compositor_timing_history(
+ new CompositorTimingHistory(impl().rendering_stats_instrumentation));
+
impl().scheduler = Scheduler::Create(
this, scheduler_settings, impl().layer_tree_host_id,
- ImplThreadTaskRunner(), impl().external_begin_frame_source.get());
+ ImplThreadTaskRunner(), impl().external_begin_frame_source.get(),
+ compositor_timing_history.Pass());
+
impl().scheduler->SetVisible(impl().layer_tree_host_impl->visible());
impl_thread_weak_ptr_ = impl().weak_factory.GetWeakPtr();
completion->Signal();
@@ -1246,7 +1234,6 @@ void ThreadProxy::DidActivateSyncTree() {
impl().completion_event_for_commit_held_on_tree_activation = NULL;
}
- impl().timing_history.DidActivateSyncTree();
impl().last_processed_begin_main_frame_args =
impl().last_begin_main_frame_args;
}
« no previous file with comments | « cc/trees/thread_proxy.h ('k') | components/view_manager/surfaces/surfaces_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698