OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "ui/gl/gpu_timing.h" | 5 #include "ui/gl/gpu_timing.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
11 #include "ui/gl/gl_context.h" | 11 #include "ui/gl/gl_context.h" |
12 #include "ui/gl/gl_version_info.h" | 12 #include "ui/gl/gl_version_info.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gl { |
15 | 15 |
16 class TimeElapsedTimerQuery; | 16 class TimeElapsedTimerQuery; |
17 class TimerQuery; | 17 class TimerQuery; |
18 | 18 |
19 int64_t NanoToMicro(uint64_t nano_seconds) { | 19 int64_t NanoToMicro(uint64_t nano_seconds) { |
20 const uint64_t up = nano_seconds + base::Time::kNanosecondsPerMicrosecond / 2; | 20 const uint64_t up = nano_seconds + base::Time::kNanosecondsPerMicrosecond / 2; |
21 return static_cast<int64_t>(up / base::Time::kNanosecondsPerMicrosecond); | 21 return static_cast<int64_t>(up / base::Time::kNanosecondsPerMicrosecond); |
22 } | 22 } |
23 | 23 |
24 int32_t QueryTimestampBits() { | 24 int32_t QueryTimestampBits() { |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 } | 659 } |
660 | 660 |
661 void GPUTimingClient::ForceTimeElapsedQuery() { | 661 void GPUTimingClient::ForceTimeElapsedQuery() { |
662 DCHECK(gpu_timing_); | 662 DCHECK(gpu_timing_); |
663 gpu_timing_->ForceTimeElapsedQuery(); | 663 gpu_timing_->ForceTimeElapsedQuery(); |
664 } | 664 } |
665 | 665 |
666 GPUTimingClient::~GPUTimingClient() { | 666 GPUTimingClient::~GPUTimingClient() { |
667 } | 667 } |
668 | 668 |
669 } // namespace gfx | 669 } // namespace gl |
OLD | NEW |