| 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/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "ui/gl/gl_bindings.h" | 8 #include "ui/gl/gl_bindings.h" |
| 9 #include "ui/gl/gl_context.h" | 9 #include "ui/gl/gl_context.h" |
| 10 #include "ui/gl/gl_version_info.h" | 10 #include "ui/gl/gl_version_info.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 uint32_t GetDisjointCount(); | 32 uint32_t GetDisjointCount(); |
| 33 int64 CalculateTimerOffset(); | 33 int64 CalculateTimerOffset(); |
| 34 | 34 |
| 35 scoped_refptr<QueryResult> BeginElapsedTimeQuery(); | 35 scoped_refptr<QueryResult> BeginElapsedTimeQuery(); |
| 36 void EndElapsedTimeQuery(scoped_refptr<QueryResult> result); | 36 void EndElapsedTimeQuery(scoped_refptr<QueryResult> result); |
| 37 | 37 |
| 38 scoped_refptr<QueryResult> DoTimeStampQuery(); | 38 scoped_refptr<QueryResult> DoTimeStampQuery(); |
| 39 | 39 |
| 40 int64 GetCurrentCPUTime() { | 40 int64 GetCurrentCPUTime() { |
| 41 return cpu_time_for_testing_.is_null() | 41 return cpu_time_for_testing_.is_null() |
| 42 ? (base::TraceTicks::Now() - base::TraceTicks()).InMicroseconds() | 42 ? (base::TimeTicks::Now() - base::TimeTicks()).InMicroseconds() |
| 43 : cpu_time_for_testing_.Run(); | 43 : cpu_time_for_testing_.Run(); |
| 44 } | 44 } |
| 45 void SetCpuTimeForTesting(const base::Callback<int64(void)>& cpu_time) { | 45 void SetCpuTimeForTesting(const base::Callback<int64(void)>& cpu_time) { |
| 46 cpu_time_for_testing_ = cpu_time; | 46 cpu_time_for_testing_ = cpu_time; |
| 47 } | 47 } |
| 48 | 48 |
| 49 void UpdateQueryResults(); | 49 void UpdateQueryResults(); |
| 50 | 50 |
| 51 int64_t GetMaxTimeStamp() { return max_time_stamp_; } | 51 int64_t GetMaxTimeStamp() { return max_time_stamp_; } |
| 52 void UpdateMaxTimeStamp(int64_t value) { | 52 void UpdateMaxTimeStamp(int64_t value) { |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 | 624 |
| 625 void GPUTimingClient::ForceTimeElapsedQuery() { | 625 void GPUTimingClient::ForceTimeElapsedQuery() { |
| 626 DCHECK(gpu_timing_); | 626 DCHECK(gpu_timing_); |
| 627 gpu_timing_->ForceTimeElapsedQuery(); | 627 gpu_timing_->ForceTimeElapsedQuery(); |
| 628 } | 628 } |
| 629 | 629 |
| 630 GPUTimingClient::~GPUTimingClient() { | 630 GPUTimingClient::~GPUTimingClient() { |
| 631 } | 631 } |
| 632 | 632 |
| 633 } // namespace gfx | 633 } // namespace gfx |
| OLD | NEW |