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

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

Issue 27710005: cc: Use HighResNow as timebase if it is fast and reliable (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix DCHECK Created 7 years, 2 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
« no previous file with comments | « cc/scheduler/delay_based_time_source.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
OLDNEW
« no previous file with comments | « cc/scheduler/delay_based_time_source.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698