| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 | 554 |
| 555 begin_impl_frame_args_ = args; | 555 begin_impl_frame_args_ = args; |
| 556 begin_impl_frame_args_.deadline -= client_->DrawDurationEstimate(); | 556 begin_impl_frame_args_.deadline -= client_->DrawDurationEstimate(); |
| 557 | 557 |
| 558 if (!state_machine_.impl_latency_takes_priority() && | 558 if (!state_machine_.impl_latency_takes_priority() && |
| 559 main_thread_is_in_high_latency_mode && | 559 main_thread_is_in_high_latency_mode && |
| 560 CanCommitAndActivateBeforeDeadline()) { | 560 CanCommitAndActivateBeforeDeadline()) { |
| 561 state_machine_.SetSkipNextBeginMainFrameToReduceLatency(); | 561 state_machine_.SetSkipNextBeginMainFrameToReduceLatency(); |
| 562 } | 562 } |
| 563 | 563 |
| 564 client_->WillBeginImplFrame(begin_impl_frame_args_); | |
| 565 state_machine_.OnBeginImplFrame(begin_impl_frame_args_); | 564 state_machine_.OnBeginImplFrame(begin_impl_frame_args_); |
| 566 devtools_instrumentation::DidBeginFrame(layer_tree_host_id_); | 565 devtools_instrumentation::DidBeginFrame(layer_tree_host_id_); |
| 566 client_->WillBeginImplFrame(begin_impl_frame_args_); |
| 567 | 567 |
| 568 ProcessScheduledActions(); | 568 ProcessScheduledActions(); |
| 569 | 569 |
| 570 state_machine_.OnBeginImplFrameDeadlinePending(); | 570 state_machine_.OnBeginImplFrameDeadlinePending(); |
| 571 | 571 |
| 572 if (settings_.using_synchronous_renderer_compositor) { | 572 if (settings_.using_synchronous_renderer_compositor) { |
| 573 // The synchronous renderer compositor has to make its GL calls | 573 // The synchronous renderer compositor has to make its GL calls |
| 574 // within this call. | 574 // within this call. |
| 575 // TODO(brianderson): Have the OutputSurface initiate the deadline tasks | 575 // TODO(brianderson): Have the OutputSurface initiate the deadline tasks |
| 576 // so the synchronous renderer compositor can take advantage of splitting | 576 // so the synchronous renderer compositor can take advantage of splitting |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 } | 810 } |
| 811 | 811 |
| 812 bool Scheduler::IsBeginMainFrameSentOrStarted() const { | 812 bool Scheduler::IsBeginMainFrameSentOrStarted() const { |
| 813 return (state_machine_.commit_state() == | 813 return (state_machine_.commit_state() == |
| 814 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || | 814 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || |
| 815 state_machine_.commit_state() == | 815 state_machine_.commit_state() == |
| 816 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); | 816 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); |
| 817 } | 817 } |
| 818 | 818 |
| 819 } // namespace cc | 819 } // namespace cc |
| OLD | NEW |