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

Side by Side Diff: cc/scheduler/scheduler.cc

Issue 60353002: cc: add DevTools instrumentation for impl-side frames (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Insturment tree activation instead of commit for linking main thread frames to imple-side ones Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 #include "cc/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "cc/debug/devtools_instrumentation.h"
11 #include "cc/debug/traced_value.h" 12 #include "cc/debug/traced_value.h"
12 #include "ui/gfx/frame_time.h" 13 #include "ui/gfx/frame_time.h"
13 14
14 namespace cc { 15 namespace cc {
15 16
16 Scheduler::Scheduler(SchedulerClient* client, 17 Scheduler::Scheduler(SchedulerClient* client,
17 const SchedulerSettings& scheduler_settings) 18 const SchedulerSettings& scheduler_settings,
19 int layer_tree_host_id)
18 : settings_(scheduler_settings), 20 : settings_(scheduler_settings),
19 client_(client), 21 client_(client),
22 layer_tree_host_id_(layer_tree_host_id),
20 last_set_needs_begin_impl_frame_(false), 23 last_set_needs_begin_impl_frame_(false),
21 state_machine_(scheduler_settings), 24 state_machine_(scheduler_settings),
22 inside_process_scheduled_actions_(false), 25 inside_process_scheduled_actions_(false),
23 inside_action_(SchedulerStateMachine::ACTION_NONE), 26 inside_action_(SchedulerStateMachine::ACTION_NONE),
24 weak_factory_(this) { 27 weak_factory_(this) {
25 DCHECK(client_); 28 DCHECK(client_);
26 DCHECK(!state_machine_.BeginImplFrameNeeded()); 29 DCHECK(!state_machine_.BeginImplFrameNeeded());
27 } 30 }
28 31
29 Scheduler::~Scheduler() {} 32 Scheduler::~Scheduler() {}
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 state_machine_.MainThreadIsInHighLatencyMode() && 197 state_machine_.MainThreadIsInHighLatencyMode() &&
195 CanCommitAndActivateBeforeDeadline()); 198 CanCommitAndActivateBeforeDeadline());
196 } 199 }
197 200
198 ProcessScheduledActions(); 201 ProcessScheduledActions();
199 202
200 if (!state_machine_.HasInitializedOutputSurface()) 203 if (!state_machine_.HasInitializedOutputSurface())
201 return; 204 return;
202 205
203 state_machine_.OnBeginImplFrameDeadlinePending(); 206 state_machine_.OnBeginImplFrameDeadlinePending();
204 207 devtools_instrumentation::didBeginFrame(layer_tree_host_id_);
205 if (settings_.using_synchronous_renderer_compositor) { 208 if (settings_.using_synchronous_renderer_compositor) {
206 // The synchronous renderer compositor has to make its GL calls 209 // The synchronous renderer compositor has to make its GL calls
207 // within this call to BeginImplFrame. 210 // within this call to BeginImplFrame.
208 // TODO(brianderson): Have the OutputSurface initiate the deadline tasks 211 // TODO(brianderson): Have the OutputSurface initiate the deadline tasks
209 // so the sychronous renderer compositor can take advantage of splitting 212 // so the sychronous renderer compositor can take advantage of splitting
210 // up the BeginImplFrame and deadline as well. 213 // up the BeginImplFrame and deadline as well.
211 OnBeginImplFrameDeadline(); 214 OnBeginImplFrameDeadline();
212 } else if (!settings_.deadline_scheduling_enabled) { 215 } else if (!settings_.deadline_scheduling_enabled) {
213 // We emulate the old non-deadline scheduler here by posting the 216 // We emulate the old non-deadline scheduler here by posting the
214 // deadline task without any delay. 217 // deadline task without any delay.
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 // impl thread's deadline. 363 // impl thread's deadline.
361 base::TimeTicks estimated_draw_time = 364 base::TimeTicks estimated_draw_time =
362 last_begin_impl_frame_args_.frame_time + 365 last_begin_impl_frame_args_.frame_time +
363 client_->BeginMainFrameToCommitDurationEstimate() + 366 client_->BeginMainFrameToCommitDurationEstimate() +
364 client_->CommitToActivateDurationEstimate(); 367 client_->CommitToActivateDurationEstimate();
365 368
366 return estimated_draw_time < last_begin_impl_frame_args_.deadline; 369 return estimated_draw_time < last_begin_impl_frame_args_.deadline;
367 } 370 }
368 371
369 } // namespace cc 372 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698