| 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 #ifndef UI_GL_GPU_TIMING_H_ | 5 #ifndef UI_GL_GPU_TIMING_H_ |
| 6 #define UI_GL_GPU_TIMING_H_ | 6 #define UI_GL_GPU_TIMING_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/gl/gl_export.h" | 10 #include "ui/gl/gl_export.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 uint32_t disjoint_counter_ = 0; | 69 uint32_t disjoint_counter_ = 0; |
| 70 DISALLOW_COPY_AND_ASSIGN(GPUTiming); | 70 DISALLOW_COPY_AND_ASSIGN(GPUTiming); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 // Class to compute the amount of time it takes to fully | 73 // Class to compute the amount of time it takes to fully |
| 74 // complete a set of GL commands | 74 // complete a set of GL commands |
| 75 class GL_EXPORT GPUTimer { | 75 class GL_EXPORT GPUTimer { |
| 76 public: | 76 public: |
| 77 ~GPUTimer(); | 77 ~GPUTimer(); |
| 78 | 78 |
| 79 // Destroy the timer object. This must be explicitly called before destroying |
| 80 // this object. |
| 81 void Destroy(bool have_context); |
| 82 |
| 79 void Start(); | 83 void Start(); |
| 80 void End(); | 84 void End(); |
| 81 bool IsAvailable(); | 85 bool IsAvailable(); |
| 82 | 86 |
| 83 void GetStartEndTimestamps(int64* start, int64* end); | 87 void GetStartEndTimestamps(int64* start, int64* end); |
| 84 int64 GetDeltaElapsed(); | 88 int64 GetDeltaElapsed(); |
| 85 | 89 |
| 86 private: | 90 private: |
| 87 friend class GPUTimingClient; | 91 friend class GPUTimingClient; |
| 88 | 92 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 uint32_t disjoint_counter_ = 0; | 139 uint32_t disjoint_counter_ = 0; |
| 136 bool offset_valid_ = false; | 140 bool offset_valid_ = false; |
| 137 base::Callback<int64(void)> cpu_time_for_testing_; | 141 base::Callback<int64(void)> cpu_time_for_testing_; |
| 138 | 142 |
| 139 DISALLOW_COPY_AND_ASSIGN(GPUTimingClient); | 143 DISALLOW_COPY_AND_ASSIGN(GPUTimingClient); |
| 140 }; | 144 }; |
| 141 | 145 |
| 142 } // namespace gfx | 146 } // namespace gfx |
| 143 | 147 |
| 144 #endif // UI_GL_GPU_TIMING_H_ | 148 #endif // UI_GL_GPU_TIMING_H_ |
| OLD | NEW |