| 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/frame_rate_controller.h" | 5 #include "cc/scheduler/frame_rate_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "cc/scheduler/delay_based_time_source.h" | 12 #include "cc/scheduler/delay_based_time_source.h" |
| 13 #include "cc/scheduler/time_source.h" | 13 #include "cc/scheduler/time_source.h" |
| 14 #include "ui/gfx/frame_time.h" |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 | 17 |
| 17 class FrameRateControllerTimeSourceAdapter : public TimeSourceClient { | 18 class FrameRateControllerTimeSourceAdapter : public TimeSourceClient { |
| 18 public: | 19 public: |
| 19 static scoped_ptr<FrameRateControllerTimeSourceAdapter> Create( | 20 static scoped_ptr<FrameRateControllerTimeSourceAdapter> Create( |
| 20 FrameRateController* frame_rate_controller) { | 21 FrameRateController* frame_rate_controller) { |
| 21 return make_scoped_ptr( | 22 return make_scoped_ptr( |
| 22 new FrameRateControllerTimeSourceAdapter(frame_rate_controller)); | 23 new FrameRateControllerTimeSourceAdapter(frame_rate_controller)); |
| 23 } | 24 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 if (is_time_source_throttling_) | 159 if (is_time_source_throttling_) |
| 159 return time_source_->NextTickTime(); | 160 return time_source_->NextTickTime(); |
| 160 | 161 |
| 161 return base::TimeTicks(); | 162 return base::TimeTicks(); |
| 162 } | 163 } |
| 163 | 164 |
| 164 base::TimeTicks FrameRateController::LastTickTime() { | 165 base::TimeTicks FrameRateController::LastTickTime() { |
| 165 if (is_time_source_throttling_) | 166 if (is_time_source_throttling_) |
| 166 return time_source_->LastTickTime(); | 167 return time_source_->LastTickTime(); |
| 167 | 168 |
| 168 return base::TimeTicks::Now(); | 169 return gfx::FrameTime::Now(); |
| 169 } | 170 } |
| 170 | 171 |
| 171 } // namespace cc | 172 } // namespace cc |
| OLD | NEW |