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

Unified Diff: cc/scheduler/scheduler.cc

Issue 1460923002: cc: CompositorTimingHistory throughput UMAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@didDraw
Patch Set: Remove debug TRACE_EVENTS Created 5 years, 1 month 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/scheduler/scheduler.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/scheduler/scheduler.cc
diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc
index 085ed59cc787b98e0f645bfff3535e54122970d8..1c840a40314093e9f33e22e3fc02618fe2ec1ee8 100644
--- a/cc/scheduler/scheduler.cc
+++ b/cc/scheduler/scheduler.cc
@@ -276,6 +276,15 @@ base::TimeTicks Scheduler::LastBeginImplFrameTime() {
return begin_impl_frame_tracker_.Current().frame_time;
}
+void Scheduler::BeginImplFrameNotExpectedSoon() {
+ compositor_timing_history_->BeginImplFrameNotExpectedSoon();
+
+ // Tying this to SendBeginMainFrameNotExpectedSoon will have some
+ // false negatives, but we want to avoid running long idle tasks when
+ // we are actually active.
+ client_->SendBeginMainFrameNotExpectedSoon();
+}
+
void Scheduler::SetupNextBeginFrameIfNeeded() {
// Never call SetNeedsBeginFrames if the frame source already has the right
// value.
@@ -289,7 +298,7 @@ void Scheduler::SetupNextBeginFrameIfNeeded() {
SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE) {
// Call SetNeedsBeginFrames(false) in between frames only.
frame_source_->SetNeedsBeginFrames(false);
- client_->SendBeginMainFrameNotExpectedSoon();
+ BeginImplFrameNotExpectedSoon();
devtools_instrumentation::NeedsBeginFrameChanged(layer_tree_host_id_,
false);
}
@@ -531,6 +540,8 @@ void Scheduler::BeginImplFrameSynchronous(const BeginFrameArgs& args) {
begin_main_frame_args_.on_critical_path = !ImplLatencyTakesPriority();
BeginImplFrame(args);
+ compositor_timing_history_->WillFinishImplFrame(
+ state_machine_.needs_redraw());
FinishImplFrame();
}
@@ -555,6 +566,8 @@ void Scheduler::BeginImplFrame(const BeginFrameArgs& args) {
begin_impl_frame_tracker_.Start(args);
state_machine_.OnBeginImplFrame();
devtools_instrumentation::DidBeginFrame(layer_tree_host_id_);
+ compositor_timing_history_->WillBeginImplFrame(
+ state_machine_.NewActiveTreeLikely());
client_->WillBeginImplFrame(begin_impl_frame_tracker_.Current());
ProcessScheduledActions();
@@ -640,25 +653,31 @@ void Scheduler::OnBeginImplFrameDeadline() {
tracked_objects::ScopedTracker tracking_profile1(
FROM_HERE_WITH_EXPLICIT_FUNCTION(
"461509 Scheduler::OnBeginImplFrameDeadline1"));
+ compositor_timing_history_->WillFinishImplFrame(
+ state_machine_.needs_redraw());
state_machine_.OnBeginImplFrameDeadline();
ProcessScheduledActions();
FinishImplFrame();
}
void Scheduler::DrawAndSwapIfPossible() {
- state_machine_.WillDraw();
+ bool drawing_with_new_active_tree =
+ state_machine_.active_tree_needs_first_draw();
compositor_timing_history_->WillDraw();
+ state_machine_.WillDraw();
DrawResult result = client_->ScheduledActionDrawAndSwapIfPossible();
- compositor_timing_history_->DidDraw();
state_machine_.DidDraw(result);
+ compositor_timing_history_->DidDraw(drawing_with_new_active_tree);
}
void Scheduler::DrawAndSwapForced() {
- state_machine_.WillDraw();
+ bool drawing_with_new_active_tree =
+ state_machine_.active_tree_needs_first_draw();
compositor_timing_history_->WillDraw();
+ state_machine_.WillDraw();
DrawResult result = client_->ScheduledActionDrawAndSwapForced();
- compositor_timing_history_->DidDraw();
state_machine_.DidDraw(result);
+ compositor_timing_history_->DidDraw(drawing_with_new_active_tree);
}
void Scheduler::SetDeferCommits(bool defer_commits) {
« no previous file with comments | « cc/scheduler/scheduler.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698