Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: ui/gl/gpu_timing.h

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gpu_switching_manager.h ('k') | ui/gl/gpu_timing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <queue> 11 #include <queue>
12 12
13 #include "base/callback.h" 13 #include "base/callback.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "ui/gl/gl_export.h" 15 #include "ui/gl/gl_export.h"
17 16
18 // The gpu_timing classes handles the abstraction of GL GPU Timing extensions 17 // The gpu_timing classes handles the abstraction of GL GPU Timing extensions
19 // into a common set of functions. Currently the different timer extensions that 18 // into a common set of functions. Currently the different timer extensions that
20 // are supported are EXT_timer_query, ARB_timer_query and 19 // are supported are EXT_timer_query, ARB_timer_query and
21 // EXT_disjoint_timer_query. 20 // EXT_disjoint_timer_query.
22 // 21 //
23 // Explanation of Classes: 22 // Explanation of Classes:
24 // GPUTiming - GPU Timing is a private class which is only owned by the 23 // GPUTiming - GPU Timing is a private class which is only owned by the
25 // underlying GLContextReal class. This class handles any GL Context level 24 // underlying GLContextReal class. This class handles any GL Context level
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 DISALLOW_COPY_AND_ASSIGN(GPUTimer); 121 DISALLOW_COPY_AND_ASSIGN(GPUTimer);
123 }; 122 };
124 123
125 // GPUTimingClient contains all the gl timing logic that is not specific 124 // GPUTimingClient contains all the gl timing logic that is not specific
126 // to a single GPUTimer. 125 // to a single GPUTimer.
127 class GL_EXPORT GPUTimingClient 126 class GL_EXPORT GPUTimingClient
128 : public base::RefCounted<GPUTimingClient> { 127 : public base::RefCounted<GPUTimingClient> {
129 public: 128 public:
130 explicit GPUTimingClient(GPUTimingImpl* gpu_timing = nullptr); 129 explicit GPUTimingClient(GPUTimingImpl* gpu_timing = nullptr);
131 130
132 scoped_ptr<GPUTimer> CreateGPUTimer(bool prefer_elapsed_time); 131 std::unique_ptr<GPUTimer> CreateGPUTimer(bool prefer_elapsed_time);
133 bool IsAvailable(); 132 bool IsAvailable();
134 133
135 const char* GetTimerTypeName() const; 134 const char* GetTimerTypeName() const;
136 135
137 // CheckAndResetTimerErrors has to be called before reading timestamps 136 // CheckAndResetTimerErrors has to be called before reading timestamps
138 // from GPUTimers instances and after making sure all the timers 137 // from GPUTimers instances and after making sure all the timers
139 // were available. 138 // were available.
140 // If the returned value is false, all the previous timers should be 139 // If the returned value is false, all the previous timers should be
141 // discarded. 140 // discarded.
142 bool CheckAndResetTimerErrors(); 141 bool CheckAndResetTimerErrors();
(...skipping 13 matching lines...) Expand all
156 GPUTimingImpl* gpu_timing_; 155 GPUTimingImpl* gpu_timing_;
157 GPUTiming::TimerType timer_type_ = GPUTiming::kTimerTypeInvalid; 156 GPUTiming::TimerType timer_type_ = GPUTiming::kTimerTypeInvalid;
158 uint32_t disjoint_counter_ = 0; 157 uint32_t disjoint_counter_ = 0;
159 158
160 DISALLOW_COPY_AND_ASSIGN(GPUTimingClient); 159 DISALLOW_COPY_AND_ASSIGN(GPUTimingClient);
161 }; 160 };
162 161
163 } // namespace gfx 162 } // namespace gfx
164 163
165 #endif // UI_GL_GPU_TIMING_H_ 164 #endif // UI_GL_GPU_TIMING_H_
OLDNEW
« no previous file with comments | « ui/gl/gpu_switching_manager.h ('k') | ui/gl/gpu_timing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698