Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 346 bool Scheduler::OnBeginFrameMixInDelegate(const BeginFrameArgs& args) { | 346 bool Scheduler::OnBeginFrameMixInDelegate(const BeginFrameArgs& args) { |
| 347 TRACE_EVENT1("cc,benchmark", "Scheduler::BeginFrame", "args", args.AsValue()); | 347 TRACE_EVENT1("cc,benchmark", "Scheduler::BeginFrame", "args", args.AsValue()); |
| 348 | 348 |
| 349 // Trace this begin frame time through the Chrome stack | 349 // Trace this begin frame time through the Chrome stack |
| 350 TRACE_EVENT_FLOW_BEGIN0( | 350 TRACE_EVENT_FLOW_BEGIN0( |
| 351 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), "BeginFrameArgs", | 351 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), "BeginFrameArgs", |
| 352 args.frame_time.ToInternalValue()); | 352 args.frame_time.ToInternalValue()); |
| 353 | 353 |
| 354 // TODO(brianderson): Adjust deadline in the DisplayScheduler. | 354 // TODO(brianderson): Adjust deadline in the DisplayScheduler. |
| 355 BeginFrameArgs adjusted_args(args); | 355 BeginFrameArgs adjusted_args(args); |
| 356 adjusted_args.deadline -= EstimatedParentDrawTime(); | 356 adjusted_args.deadline -= EstimatedParentDrawTime(); |
|
Sami
2015/06/08 11:47:53
Another option would be to communicate this throug
| |
| 357 adjusted_args.on_critical_path = MainThreadOnCriticalPath(); | |
| 357 | 358 |
| 358 // Deliver BeginFrames to children. | 359 // Deliver BeginFrames to children. |
| 359 // TODO(brianderson): Move this responsibility to the DisplayScheduler. | 360 // TODO(brianderson): Move this responsibility to the DisplayScheduler. |
| 360 if (state_machine_.children_need_begin_frames()) | 361 if (state_machine_.children_need_begin_frames()) |
| 361 client_->SendBeginFramesToChildren(adjusted_args); | 362 client_->SendBeginFramesToChildren(adjusted_args); |
| 362 | 363 |
| 363 if (settings_.using_synchronous_renderer_compositor) { | 364 if (settings_.using_synchronous_renderer_compositor) { |
| 364 BeginImplFrameSynchronous(adjusted_args); | 365 BeginImplFrameSynchronous(adjusted_args); |
| 365 return true; | 366 return true; |
| 366 } | 367 } |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 820 } | 821 } |
| 821 | 822 |
| 822 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 823 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 823 return (state_machine_.commit_state() == | 824 return (state_machine_.commit_state() == |
| 824 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 825 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 825 state_machine_.commit_state() == | 826 state_machine_.commit_state() == |
| 826 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 827 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 827 } | 828 } |
| 828 | 829 |
| 829 } // namespace cc | 830 } // namespace cc |
| OLD | NEW |