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

Side by Side Diff: ui/gfx/frame_time.h

Issue 1143433005: Remove gfx::FrameTime for a single clock source (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handling patch for mac files Created 5 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_FRAME_TIME_H
6 #define UI_GFX_FRAME_TIME_H
7
8 #include "base/time/time.h"
9 #include "base/logging.h"
10
11 namespace gfx {
12
13 // FrameTime::Now() should be used to get timestamps with a timebase that
14 // is consistent across the graphics stack.
15 class FrameTime {
16 public:
17 static base::TimeTicks Now() {
18 return base::TimeTicks::Now();
19 }
20
21 #if defined(OS_WIN)
22 static base::TimeTicks FromQPCValue(LONGLONG qpc_value) {
23 DCHECK(TimestampsAreHighRes());
24 return base::TimeTicks::FromQPCValue(qpc_value);
25 }
26 #endif
27
28 static bool TimestampsAreHighRes() {
29 #if defined(OS_WIN)
30 return base::TimeTicks::IsHighResolution();
31 #else
32 // TODO(miu): Mac/Linux always provide high-resolution timestamps. Consider
33 // returning base::TimeTicks::IsHighResolution() for all platforms.
34 return false;
35 #endif
36 }
37 };
38
39 }
40
41 #endif // UI_GFX_FRAME_TIME_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698