OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "gpu/perftests/measurements.h" | 5 #include "gpu/perftests/measurements.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "testing/perf/perf_test.h" | 8 #include "testing/perf/perf_test.h" |
9 #include "ui/gl/gpu_timing.h" | 9 #include "ui/gl/gpu_timing.h" |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 int64 gpu_time = -1; | 90 int64 gpu_time = -1; |
91 if (gpu_timer_.get() != nullptr && gpu_timer_->IsAvailable()) { | 91 if (gpu_timer_.get() != nullptr && gpu_timer_->IsAvailable()) { |
92 gpu_time = gpu_timer_->GetDeltaElapsed(); | 92 gpu_time = gpu_timer_->GetDeltaElapsed(); |
93 } | 93 } |
94 return Measurement(name, wall_time_, cpu_time_, | 94 return Measurement(name, wall_time_, cpu_time_, |
95 base::TimeDelta::FromMicroseconds(gpu_time)); | 95 base::TimeDelta::FromMicroseconds(gpu_time)); |
96 } | 96 } |
97 | 97 |
98 MeasurementTimers::~MeasurementTimers() { | 98 MeasurementTimers::~MeasurementTimers() { |
| 99 if (gpu_timer_.get()) { |
| 100 gpu_timer_->Destroy(true); |
| 101 } |
99 } | 102 } |
100 | 103 |
101 } // namespace gpu | 104 } // namespace gpu |
OLD | NEW |