Removed unused icon resources from app_list.
[chromium-blink-merge.git] / ui / gfx / frame_time.h
blobdd00fbfdd5ddfa908cdacc35ae9535a4070e1617
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.
5 #ifndef UI_GFX_FRAME_TIME_H
6 #define UI_GFX_FRAME_TIME_H
8 #include "base/time/time.h"
9 #include "base/logging.h"
11 namespace gfx {
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 if (TimestampsAreHighRes())
19 return base::TimeTicks::HighResNow();
20 return base::TimeTicks::Now();
23 #if defined(OS_WIN)
24 static base::TimeTicks FromQPCValue(LONGLONG qpc_value) {
25 DCHECK(TimestampsAreHighRes());
26 return base::TimeTicks::FromQPCValue(qpc_value);
28 #endif
30 static bool TimestampsAreHighRes() {
31 #if defined(OS_WIN)
32 return base::TimeTicks::IsHighResClockWorking();
33 #else
34 return false;
35 #endif
41 #endif // UI_GFX_FRAME_TIME_H