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

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

Issue 2158023005: cc: Remove retro frame logic from scheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 #include "cc/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_NONE), 57 SchedulerStateMachine::BEGIN_IMPL_FRAME_DEADLINE_MODE_NONE),
58 begin_impl_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE), 58 begin_impl_frame_tracker_(BEGINFRAMETRACKER_FROM_HERE),
59 state_machine_(settings), 59 state_machine_(settings),
60 inside_process_scheduled_actions_(false), 60 inside_process_scheduled_actions_(false),
61 inside_action_(SchedulerStateMachine::ACTION_NONE), 61 inside_action_(SchedulerStateMachine::ACTION_NONE),
62 weak_factory_(this) { 62 weak_factory_(this) {
63 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue()); 63 TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue());
64 DCHECK(client_); 64 DCHECK(client_);
65 DCHECK(!state_machine_.BeginFrameNeeded()); 65 DCHECK(!state_machine_.BeginFrameNeeded());
66 66
67 begin_retro_frame_closure_ =
68 base::Bind(&Scheduler::BeginRetroFrame, weak_factory_.GetWeakPtr());
69 begin_impl_frame_deadline_closure_ = base::Bind( 67 begin_impl_frame_deadline_closure_ = base::Bind(
70 &Scheduler::OnBeginImplFrameDeadline, weak_factory_.GetWeakPtr()); 68 &Scheduler::OnBeginImplFrameDeadline, weak_factory_.GetWeakPtr());
71 69
72 SetBeginFrameSource(begin_frame_source); 70 SetBeginFrameSource(begin_frame_source);
73 ProcessScheduledActions(); 71 ProcessScheduledActions();
74 } 72 }
75 73
76 Scheduler::~Scheduler() { 74 Scheduler::~Scheduler() {
77 SetBeginFrameSource(nullptr); 75 SetBeginFrameSource(nullptr);
78 } 76 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 compositor_timing_history_->WillPrepareTiles(); 191 compositor_timing_history_->WillPrepareTiles();
194 } 192 }
195 193
196 void Scheduler::DidPrepareTiles() { 194 void Scheduler::DidPrepareTiles() {
197 compositor_timing_history_->DidPrepareTiles(); 195 compositor_timing_history_->DidPrepareTiles();
198 state_machine_.DidPrepareTiles(); 196 state_machine_.DidPrepareTiles();
199 } 197 }
200 198
201 void Scheduler::DidLoseOutputSurface() { 199 void Scheduler::DidLoseOutputSurface() {
202 TRACE_EVENT0("cc", "Scheduler::DidLoseOutputSurface"); 200 TRACE_EVENT0("cc", "Scheduler::DidLoseOutputSurface");
203 begin_retro_frame_args_.clear();
204 begin_retro_frame_task_.Cancel();
205 state_machine_.DidLoseOutputSurface(); 201 state_machine_.DidLoseOutputSurface();
206 UpdateCompositorTimingHistoryRecordingEnabled(); 202 UpdateCompositorTimingHistoryRecordingEnabled();
207 ProcessScheduledActions(); 203 ProcessScheduledActions();
208 } 204 }
209 205
210 void Scheduler::DidCreateAndInitializeOutputSurface() { 206 void Scheduler::DidCreateAndInitializeOutputSurface() {
211 TRACE_EVENT0("cc", "Scheduler::DidCreateAndInitializeOutputSurface"); 207 TRACE_EVENT0("cc", "Scheduler::DidCreateAndInitializeOutputSurface");
212 DCHECK(!observing_begin_frame_source_); 208 DCHECK(!observing_begin_frame_source_);
213 DCHECK(begin_impl_frame_deadline_task_.IsCancelled()); 209 DCHECK(begin_impl_frame_deadline_task_.IsCancelled());
214 state_machine_.DidCreateAndInitializeOutputSurface(); 210 state_machine_.DidCreateAndInitializeOutputSurface();
(...skipping 29 matching lines...) Expand all
244 if (state_machine_.BeginFrameNeeded()) { 240 if (state_machine_.BeginFrameNeeded()) {
245 // Call AddObserver as soon as possible. 241 // Call AddObserver as soon as possible.
246 observing_begin_frame_source_ = true; 242 observing_begin_frame_source_ = true;
247 if (begin_frame_source_) 243 if (begin_frame_source_)
248 begin_frame_source_->AddObserver(this); 244 begin_frame_source_->AddObserver(this);
249 devtools_instrumentation::NeedsBeginFrameChanged(layer_tree_host_id_, 245 devtools_instrumentation::NeedsBeginFrameChanged(layer_tree_host_id_,
250 true); 246 true);
251 } else if (state_machine_.begin_impl_frame_state() == 247 } else if (state_machine_.begin_impl_frame_state() ==
252 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE) { 248 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE) {
253 // Call RemoveObserver in between frames only. 249 // Call RemoveObserver in between frames only.
250 missed_begin_frame_task_.Cancel();
254 observing_begin_frame_source_ = false; 251 observing_begin_frame_source_ = false;
255 if (begin_frame_source_) 252 if (begin_frame_source_)
256 begin_frame_source_->RemoveObserver(this); 253 begin_frame_source_->RemoveObserver(this);
257 BeginImplFrameNotExpectedSoon(); 254 BeginImplFrameNotExpectedSoon();
258 devtools_instrumentation::NeedsBeginFrameChanged(layer_tree_host_id_, 255 devtools_instrumentation::NeedsBeginFrameChanged(layer_tree_host_id_,
259 false); 256 false);
260 } 257 }
261 } 258 }
262
263 PostBeginRetroFrameIfNeeded();
264 } 259 }
265 260
266 void Scheduler::OnBeginFrameSourcePausedChanged(bool paused) { 261 void Scheduler::OnBeginFrameSourcePausedChanged(bool paused) {
267 if (state_machine_.begin_frame_source_paused() == paused) 262 if (state_machine_.begin_frame_source_paused() == paused)
268 return; 263 return;
269 TRACE_EVENT_INSTANT1("cc", "Scheduler::SetBeginFrameSourcePaused", 264 TRACE_EVENT_INSTANT1("cc", "Scheduler::SetBeginFrameSourcePaused",
270 TRACE_EVENT_SCOPE_THREAD, "paused", paused); 265 TRACE_EVENT_SCOPE_THREAD, "paused", paused);
271 state_machine_.SetBeginFrameSourcePaused(paused); 266 state_machine_.SetBeginFrameSourcePaused(paused);
272 ProcessScheduledActions(); 267 ProcessScheduledActions();
273 } 268 }
274 269
275 // BeginFrame is the mechanism that tells us that now is a good time to start 270 // BeginFrame is the mechanism that tells us that now is a good time to start
276 // making a frame. Usually this means that user input for the frame is complete. 271 // making a frame. Usually this means that user input for the frame is complete.
277 // If the scheduler is busy, we queue the BeginFrame to be handled later as 272 // If the scheduler is busy, we finish the previous frame before starting a new
278 // a BeginRetroFrame. 273 // one.
279 bool Scheduler::OnBeginFrameDerivedImpl(const BeginFrameArgs& args) { 274 bool Scheduler::OnBeginFrameDerivedImpl(const BeginFrameArgs& args) {
280 TRACE_EVENT1("cc,benchmark", "Scheduler::BeginFrame", "args", args.AsValue()); 275 TRACE_EVENT1("cc,benchmark", "Scheduler::BeginFrame", "args", args.AsValue());
281 276
277 if (state_machine_.begin_impl_frame_state() !=
278 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE) {
279 OnBeginImplFrameDeadline();
280 }
281
282 if (!observing_begin_frame_source_) {
283 DCHECK(!state_machine_.BeginFrameNeeded());
284 return false;
285 }
286
282 // Trace this begin frame time through the Chrome stack 287 // Trace this begin frame time through the Chrome stack
283 TRACE_EVENT_FLOW_BEGIN0( 288 TRACE_EVENT_FLOW_BEGIN0(
284 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), "BeginFrameArgs", 289 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), "BeginFrameArgs",
285 args.frame_time.ToInternalValue()); 290 args.frame_time.ToInternalValue());
286 291
287 // TODO(brianderson): Adjust deadline in the DisplayScheduler. 292 // TODO(brianderson): Adjust deadline in the DisplayScheduler.
288 BeginFrameArgs adjusted_args(args); 293 BeginFrameArgs adjusted_args(args);
289 adjusted_args.deadline -= EstimatedParentDrawTime(); 294 adjusted_args.deadline -= EstimatedParentDrawTime();
290 295
291 if (settings_.using_synchronous_renderer_compositor) { 296 if (settings_.using_synchronous_renderer_compositor) {
292 BeginImplFrameSynchronous(adjusted_args); 297 BeginImplFrameSynchronous(adjusted_args);
293 return true; 298 } else if (args.type == BeginFrameArgs::MISSED) {
294 } 299 DCHECK(missed_begin_frame_task_.IsCancelled());
295 300 missed_begin_frame_task_.Reset(
296 // We have just called SetNeedsBeginFrame(true) and the BeginFrameSource has 301 base::Bind(&Scheduler::BeginImplFrameWithDeadline,
297 // sent us the last BeginFrame we have missed. As we might not be able to 302 weak_factory_.GetWeakPtr(), adjusted_args));
298 // actually make rendering for this call, handle it like a "retro frame". 303 task_runner_->PostTask(FROM_HERE, missed_begin_frame_task_.callback());
299 // TODO(brainderson): Add a test for this functionality ASAP!
300 if (adjusted_args.type == BeginFrameArgs::MISSED) {
301 begin_retro_frame_args_.push_back(adjusted_args);
302 PostBeginRetroFrameIfNeeded();
303 return true;
304 }
305
306 bool should_defer_begin_frame =
307 !begin_retro_frame_args_.empty() ||
308 !begin_retro_frame_task_.IsCancelled() ||
309 !observing_begin_frame_source_ ||
310 (state_machine_.begin_impl_frame_state() !=
311 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE);
312
313 if (should_defer_begin_frame) {
314 begin_retro_frame_args_.push_back(adjusted_args);
315 TRACE_EVENT_INSTANT0("cc", "Scheduler::BeginFrame deferred",
316 TRACE_EVENT_SCOPE_THREAD);
317 // Queuing the frame counts as "using it", so we need to return true.
318 } else { 304 } else {
319 BeginImplFrameWithDeadline(adjusted_args); 305 BeginImplFrameWithDeadline(adjusted_args);
320 } 306 }
321 return true; 307 return true;
322 } 308 }
323 309
324 void Scheduler::SetVideoNeedsBeginFrames(bool video_needs_begin_frames) { 310 void Scheduler::SetVideoNeedsBeginFrames(bool video_needs_begin_frames) {
325 state_machine_.SetVideoNeedsBeginFrames(video_needs_begin_frames); 311 state_machine_.SetVideoNeedsBeginFrames(video_needs_begin_frames);
326 ProcessScheduledActions(); 312 ProcessScheduledActions();
327 } 313 }
328 314
329 void Scheduler::OnDrawForOutputSurface(bool resourceless_software_draw) { 315 void Scheduler::OnDrawForOutputSurface(bool resourceless_software_draw) {
330 DCHECK(settings_.using_synchronous_renderer_compositor); 316 DCHECK(settings_.using_synchronous_renderer_compositor);
331 DCHECK_EQ(state_machine_.begin_impl_frame_state(), 317 DCHECK_EQ(state_machine_.begin_impl_frame_state(),
332 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); 318 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE);
333 DCHECK(begin_impl_frame_deadline_task_.IsCancelled()); 319 DCHECK(begin_impl_frame_deadline_task_.IsCancelled());
334 320
335 state_machine_.SetResourcelessSoftwareDraw(resourceless_software_draw); 321 state_machine_.SetResourcelessSoftwareDraw(resourceless_software_draw);
336 state_machine_.OnBeginImplFrameDeadline(); 322 state_machine_.OnBeginImplFrameDeadline();
337 ProcessScheduledActions(); 323 ProcessScheduledActions();
338 324
339 state_machine_.OnBeginImplFrameIdle(); 325 state_machine_.OnBeginImplFrameIdle();
340 ProcessScheduledActions(); 326 ProcessScheduledActions();
341 state_machine_.SetResourcelessSoftwareDraw(false); 327 state_machine_.SetResourcelessSoftwareDraw(false);
342 } 328 }
343 329
344 // BeginRetroFrame is called for BeginFrames that we've deferred because 330 void Scheduler::BeginImplFrameWithDeadline(const BeginFrameArgs& args) {
345 // the scheduler was in the middle of processing a previous BeginFrame. 331 missed_begin_frame_task_.Cancel();
346 void Scheduler::BeginRetroFrame() {
347 TRACE_EVENT0("cc,benchmark", "Scheduler::BeginRetroFrame");
348 DCHECK(!settings_.using_synchronous_renderer_compositor);
349 DCHECK(!begin_retro_frame_args_.empty());
350 DCHECK(!begin_retro_frame_task_.IsCancelled());
351 DCHECK_EQ(state_machine_.begin_impl_frame_state(),
352 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE);
353 332
354 begin_retro_frame_task_.Cancel();
355
356 // Discard expired BeginRetroFrames
357 // Today, we should always end up with at most one un-expired BeginRetroFrame
358 // because deadlines will not be greater than the next frame time. We don't
359 // DCHECK though because some systems don't always have monotonic timestamps.
360 // TODO(brianderson): In the future, long deadlines could result in us not
361 // draining the queue if we don't catch up. If we consistently can't catch
362 // up, our fallback should be to lower our frame rate.
363 base::TimeTicks now = Now();
364
365 while (!begin_retro_frame_args_.empty()) {
366 const BeginFrameArgs& args = begin_retro_frame_args_.front();
367 base::TimeTicks expiration_time = args.deadline;
368 if (now <= expiration_time)
369 break;
370 TRACE_EVENT_INSTANT2(
371 "cc", "Scheduler::BeginRetroFrame discarding", TRACE_EVENT_SCOPE_THREAD,
372 "expiration_time - now", (expiration_time - now).InMillisecondsF(),
373 "BeginFrameArgs", begin_retro_frame_args_.front().AsValue());
374 begin_retro_frame_args_.pop_front();
375 if (begin_frame_source_)
376 begin_frame_source_->DidFinishFrame(this, begin_retro_frame_args_.size());
377 }
378
379 if (begin_retro_frame_args_.empty()) {
380 TRACE_EVENT_INSTANT0("cc", "Scheduler::BeginRetroFrames all expired",
381 TRACE_EVENT_SCOPE_THREAD);
382 } else {
383 BeginFrameArgs front = begin_retro_frame_args_.front();
384 begin_retro_frame_args_.pop_front();
385 BeginImplFrameWithDeadline(front);
386 }
387 }
388
389 // There could be a race between the posted BeginRetroFrame and a new
390 // BeginFrame arriving via the normal mechanism. Scheduler::BeginFrame
391 // will check if there is a pending BeginRetroFrame to ensure we handle
392 // BeginFrames in FIFO order.
393 void Scheduler::PostBeginRetroFrameIfNeeded() {
394 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"),
395 "Scheduler::PostBeginRetroFrameIfNeeded", "state", AsValue());
396 if (!observing_begin_frame_source_)
397 return;
398
399 if (begin_retro_frame_args_.empty() || !begin_retro_frame_task_.IsCancelled())
400 return;
401
402 // begin_retro_frame_args_ should always be empty for the
403 // synchronous compositor.
404 DCHECK(!settings_.using_synchronous_renderer_compositor);
405
406 if (state_machine_.begin_impl_frame_state() !=
407 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE)
408 return;
409
410 begin_retro_frame_task_.Reset(begin_retro_frame_closure_);
411
412 task_runner_->PostTask(FROM_HERE, begin_retro_frame_task_.callback());
413 }
414
415 void Scheduler::BeginImplFrameWithDeadline(const BeginFrameArgs& args) {
416 bool main_thread_is_in_high_latency_mode = 333 bool main_thread_is_in_high_latency_mode =
417 state_machine_.main_thread_missed_last_deadline(); 334 state_machine_.main_thread_missed_last_deadline();
418 TRACE_EVENT2("cc,benchmark", "Scheduler::BeginImplFrame", "args", 335 TRACE_EVENT2("cc,benchmark", "Scheduler::BeginImplFrame", "args",
419 args.AsValue(), "main_thread_missed_last_deadline", 336 args.AsValue(), "main_thread_missed_last_deadline",
420 main_thread_is_in_high_latency_mode); 337 main_thread_is_in_high_latency_mode);
421 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"), 338 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"),
422 "MainThreadLatency", main_thread_is_in_high_latency_mode); 339 "MainThreadLatency", main_thread_is_in_high_latency_mode);
423 340
424 BeginFrameArgs adjusted_args = args; 341 BeginFrameArgs adjusted_args = args;
425 adjusted_args.deadline -= compositor_timing_history_->DrawDurationEstimate(); 342 adjusted_args.deadline -= compositor_timing_history_->DrawDurationEstimate();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 374
458 if (ShouldRecoverMainLatency(adjusted_args, can_activate_before_deadline)) { 375 if (ShouldRecoverMainLatency(adjusted_args, can_activate_before_deadline)) {
459 TRACE_EVENT_INSTANT0("cc", "SkipBeginMainFrameToReduceLatency", 376 TRACE_EVENT_INSTANT0("cc", "SkipBeginMainFrameToReduceLatency",
460 TRACE_EVENT_SCOPE_THREAD); 377 TRACE_EVENT_SCOPE_THREAD);
461 state_machine_.SetSkipNextBeginMainFrameToReduceLatency(); 378 state_machine_.SetSkipNextBeginMainFrameToReduceLatency();
462 } else if (ShouldRecoverImplLatency(adjusted_args, 379 } else if (ShouldRecoverImplLatency(adjusted_args,
463 can_activate_before_deadline)) { 380 can_activate_before_deadline)) {
464 TRACE_EVENT_INSTANT0("cc", "SkipBeginImplFrameToReduceLatency", 381 TRACE_EVENT_INSTANT0("cc", "SkipBeginImplFrameToReduceLatency",
465 TRACE_EVENT_SCOPE_THREAD); 382 TRACE_EVENT_SCOPE_THREAD);
466 if (begin_frame_source_) 383 if (begin_frame_source_)
467 begin_frame_source_->DidFinishFrame(this, begin_retro_frame_args_.size()); 384 begin_frame_source_->DidFinishFrame(this, 0);
468 return; 385 return;
469 } 386 }
470 387
471 BeginImplFrame(adjusted_args); 388 BeginImplFrame(adjusted_args);
472 } 389 }
473 390
474 void Scheduler::BeginImplFrameSynchronous(const BeginFrameArgs& args) { 391 void Scheduler::BeginImplFrameSynchronous(const BeginFrameArgs& args) {
475 TRACE_EVENT1("cc,benchmark", "Scheduler::BeginImplFrame", "args", 392 TRACE_EVENT1("cc,benchmark", "Scheduler::BeginImplFrame", "args",
476 args.AsValue()); 393 args.AsValue());
477 394
478 // The main thread currently can't commit before we draw with the 395 // The main thread currently can't commit before we draw with the
479 // synchronous compositor, so never consider the BeginMainFrame fast. 396 // synchronous compositor, so never consider the BeginMainFrame fast.
480 state_machine_.SetCriticalBeginMainFrameToActivateIsFast(false); 397 state_machine_.SetCriticalBeginMainFrameToActivateIsFast(false);
481 begin_main_frame_args_ = args; 398 begin_main_frame_args_ = args;
482 begin_main_frame_args_.on_critical_path = !ImplLatencyTakesPriority(); 399 begin_main_frame_args_.on_critical_path = !ImplLatencyTakesPriority();
483 400
484 BeginImplFrame(args); 401 BeginImplFrame(args);
485 compositor_timing_history_->WillFinishImplFrame( 402 compositor_timing_history_->WillFinishImplFrame(
486 state_machine_.needs_redraw()); 403 state_machine_.needs_redraw());
487 FinishImplFrame(); 404 FinishImplFrame();
488 } 405 }
489 406
490 void Scheduler::FinishImplFrame() { 407 void Scheduler::FinishImplFrame() {
491 state_machine_.OnBeginImplFrameIdle(); 408 state_machine_.OnBeginImplFrameIdle();
492 ProcessScheduledActions(); 409 ProcessScheduledActions();
493 410
494 client_->DidFinishImplFrame(); 411 client_->DidFinishImplFrame();
495 if (begin_frame_source_) 412 if (begin_frame_source_)
496 begin_frame_source_->DidFinishFrame(this, begin_retro_frame_args_.size()); 413 begin_frame_source_->DidFinishFrame(this, 0);
497 begin_impl_frame_tracker_.Finish(); 414 begin_impl_frame_tracker_.Finish();
498 } 415 }
499 416
500 // BeginImplFrame starts a compositor frame that will wait up until a deadline 417 // BeginImplFrame starts a compositor frame that will wait up until a deadline
501 // for a BeginMainFrame+activation to complete before it times out and draws 418 // for a BeginMainFrame+activation to complete before it times out and draws
502 // any asynchronous animation and scroll/pinch updates. 419 // any asynchronous animation and scroll/pinch updates.
503 void Scheduler::BeginImplFrame(const BeginFrameArgs& args) { 420 void Scheduler::BeginImplFrame(const BeginFrameArgs& args) {
504 DCHECK_EQ(state_machine_.begin_impl_frame_state(), 421 DCHECK_EQ(state_machine_.begin_impl_frame_state(),
505 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE); 422 SchedulerStateMachine::BEGIN_IMPL_FRAME_STATE_IDLE);
506 DCHECK(begin_impl_frame_deadline_task_.IsCancelled()); 423 DCHECK(begin_impl_frame_deadline_task_.IsCancelled());
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 state_machine_.AsValueInto(state.get()); 648 state_machine_.AsValueInto(state.get());
732 state->EndDictionary(); 649 state->EndDictionary();
733 650
734 state->BeginDictionary("scheduler_state"); 651 state->BeginDictionary("scheduler_state");
735 state->SetBoolean("throttle_frame_production_", 652 state->SetBoolean("throttle_frame_production_",
736 settings_.throttle_frame_production); 653 settings_.throttle_frame_production);
737 state->SetDouble("estimated_parent_draw_time_ms", 654 state->SetDouble("estimated_parent_draw_time_ms",
738 estimated_parent_draw_time_.InMillisecondsF()); 655 estimated_parent_draw_time_.InMillisecondsF());
739 state->SetBoolean("observing_begin_frame_source", 656 state->SetBoolean("observing_begin_frame_source",
740 observing_begin_frame_source_); 657 observing_begin_frame_source_);
741 state->SetInteger("begin_retro_frame_args",
742 static_cast<int>(begin_retro_frame_args_.size()));
743 state->SetBoolean("begin_retro_frame_task",
744 !begin_retro_frame_task_.IsCancelled());
745 state->SetBoolean("begin_impl_frame_deadline_task", 658 state->SetBoolean("begin_impl_frame_deadline_task",
746 !begin_impl_frame_deadline_task_.IsCancelled()); 659 !begin_impl_frame_deadline_task_.IsCancelled());
747 state->SetString("inside_action", 660 state->SetString("inside_action",
748 SchedulerStateMachine::ActionToString(inside_action_)); 661 SchedulerStateMachine::ActionToString(inside_action_));
749 662
750 state->BeginDictionary("begin_impl_frame_args"); 663 state->BeginDictionary("begin_impl_frame_args");
751 begin_impl_frame_tracker_.AsValueInto(now, state.get()); 664 begin_impl_frame_tracker_.AsValueInto(now, state.get());
752 state->EndDictionary(); 665 state->EndDictionary();
753 666
754 state->SetString("begin_impl_frame_deadline_mode_", 667 state->SetString("begin_impl_frame_deadline_mode_",
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 } 747 }
835 748
836 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 749 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
837 return (state_machine_.begin_main_frame_state() == 750 return (state_machine_.begin_main_frame_state() ==
838 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || 751 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT ||
839 state_machine_.begin_main_frame_state() == 752 state_machine_.begin_main_frame_state() ==
840 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); 753 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED);
841 } 754 }
842 755
843 } // namespace cc 756 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698