| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/scheduler/renderer_scheduler_impl.h" | 5 #include "content/renderer/scheduler/renderer_scheduler_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
| 9 #include "cc/output/begin_frame_args.h" | 9 #include "cc/output/begin_frame_args.h" |
| 10 #include "content/renderer/scheduler/renderer_task_queue_selector.h" | 10 #include "content/renderer/scheduler/renderer_task_queue_selector.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return; | 88 return; |
| 89 base::AutoLock lock(incoming_signals_lock_); | 89 base::AutoLock lock(incoming_signals_lock_); |
| 90 if (last_input_time_.is_null()) { | 90 if (last_input_time_.is_null()) { |
| 91 // Update scheduler policy if should start a new compositor policy mode. | 91 // Update scheduler policy if should start a new compositor policy mode. |
| 92 base::subtle::Release_Store(&policy_may_need_update_, 1); | 92 base::subtle::Release_Store(&policy_may_need_update_, 1); |
| 93 PostUpdatePolicyOnControlRunner(base::TimeDelta()); | 93 PostUpdatePolicyOnControlRunner(base::TimeDelta()); |
| 94 } | 94 } |
| 95 last_input_time_ = Now(); | 95 last_input_time_ = Now(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void RendererSchedulerImpl::DidAnimate() { |
| 99 DidReceiveInputEvent(); |
| 100 } |
| 101 |
| 98 bool RendererSchedulerImpl::ShouldYieldForHighPriorityWork() { | 102 bool RendererSchedulerImpl::ShouldYieldForHighPriorityWork() { |
| 99 main_thread_checker_.CalledOnValidThread(); | 103 main_thread_checker_.CalledOnValidThread(); |
| 100 if (!task_queue_manager_) | 104 if (!task_queue_manager_) |
| 101 return false; | 105 return false; |
| 102 | 106 |
| 103 return SchedulerPolicy() == COMPOSITOR_PRIORITY_POLICY && | 107 return SchedulerPolicy() == COMPOSITOR_PRIORITY_POLICY && |
| 104 !task_queue_manager_->IsQueueEmpty(COMPOSITOR_TASK_QUEUE); | 108 !task_queue_manager_->IsQueueEmpty(COMPOSITOR_TASK_QUEUE); |
| 105 } | 109 } |
| 106 | 110 |
| 107 base::TimeTicks RendererSchedulerImpl::CurrentIdleTaskDeadline() const { | 111 base::TimeTicks RendererSchedulerImpl::CurrentIdleTaskDeadline() const { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 177 |
| 174 void RendererSchedulerImpl::EndIdlePeriod() { | 178 void RendererSchedulerImpl::EndIdlePeriod() { |
| 175 renderer_task_queue_selector_->DisableQueue(IDLE_TASK_QUEUE); | 179 renderer_task_queue_selector_->DisableQueue(IDLE_TASK_QUEUE); |
| 176 } | 180 } |
| 177 | 181 |
| 178 base::TimeTicks RendererSchedulerImpl::Now() const { | 182 base::TimeTicks RendererSchedulerImpl::Now() const { |
| 179 return gfx::FrameTime::Now(); | 183 return gfx::FrameTime::Now(); |
| 180 } | 184 } |
| 181 | 185 |
| 182 } // namespace content | 186 } // namespace content |
| OLD | NEW |