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

Side by Side Diff: gpu/command_buffer/tests/gl_manager.h

Issue 1859703002: convert //gpu to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: undo part of clang-format 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ 5 #ifndef GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ 6 #define GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory>
12
11 #include "base/containers/scoped_ptr_hash_map.h" 13 #include "base/containers/scoped_ptr_hash_map.h"
12 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "gpu/command_buffer/client/gpu_control.h" 15 #include "gpu/command_buffer/client/gpu_control.h"
15 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 16 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
16 #include "gpu/command_buffer/service/feature_info.h" 17 #include "gpu/command_buffer/service/feature_info.h"
17 #include "gpu/command_buffer/service/gpu_preferences.h" 18 #include "gpu/command_buffer/service/gpu_preferences.h"
18 #include "ui/gfx/geometry/size.h" 19 #include "ui/gfx/geometry/size.h"
19 #include "ui/gfx/gpu_memory_buffer.h" 20 #include "ui/gfx/gpu_memory_buffer.h"
20 21
21 namespace base { 22 namespace base {
22 class CommandLine; 23 class CommandLine;
23 } 24 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool lose_context_when_out_of_memory; 72 bool lose_context_when_out_of_memory;
72 // Whether or not it's ok to lose the context. 73 // Whether or not it's ok to lose the context.
73 bool context_lost_allowed; 74 bool context_lost_allowed;
74 gles2::ContextType context_type; 75 gles2::ContextType context_type;
75 // Force shader name hashing for all context types. 76 // Force shader name hashing for all context types.
76 bool force_shader_name_hashing; 77 bool force_shader_name_hashing;
77 }; 78 };
78 GLManager(); 79 GLManager();
79 ~GLManager() override; 80 ~GLManager() override;
80 81
81 scoped_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer( 82 std::unique_ptr<gfx::GpuMemoryBuffer> CreateGpuMemoryBuffer(
82 const gfx::Size& size, 83 const gfx::Size& size,
83 gfx::BufferFormat format); 84 gfx::BufferFormat format);
84 85
85 void Initialize(const Options& options); 86 void Initialize(const Options& options);
86 void InitializeWithCommandLine(const Options& options, 87 void InitializeWithCommandLine(const Options& options,
87 base::CommandLine* command_line); 88 base::CommandLine* command_line);
88 void Destroy(); 89 void Destroy();
89 90
90 bool IsInitialized() const { return gles2_implementation() != nullptr; } 91 bool IsInitialized() const { return gles2_implementation() != nullptr; }
91 92
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 void OnFenceSyncRelease(uint64_t release); 155 void OnFenceSyncRelease(uint64_t release);
155 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id, 156 bool OnWaitFenceSync(gpu::CommandBufferNamespace namespace_id,
156 gpu::CommandBufferId command_buffer_id, 157 gpu::CommandBufferId command_buffer_id,
157 uint64_t release); 158 uint64_t release);
158 159
159 gpu::GpuPreferences gpu_preferences_; 160 gpu::GpuPreferences gpu_preferences_;
160 161
161 SyncPointManager* sync_point_manager_; // Non-owning. 162 SyncPointManager* sync_point_manager_; // Non-owning.
162 163
163 scoped_refptr<SyncPointOrderData> sync_point_order_data_; 164 scoped_refptr<SyncPointOrderData> sync_point_order_data_;
164 scoped_ptr<SyncPointClient> sync_point_client_; 165 std::unique_ptr<SyncPointClient> sync_point_client_;
165 scoped_refptr<gles2::MailboxManager> mailbox_manager_; 166 scoped_refptr<gles2::MailboxManager> mailbox_manager_;
166 scoped_refptr<gfx::GLShareGroup> share_group_; 167 scoped_refptr<gfx::GLShareGroup> share_group_;
167 scoped_ptr<CommandBufferService> command_buffer_; 168 std::unique_ptr<CommandBufferService> command_buffer_;
168 scoped_ptr<gles2::GLES2Decoder> decoder_; 169 std::unique_ptr<gles2::GLES2Decoder> decoder_;
169 scoped_ptr<CommandExecutor> executor_; 170 std::unique_ptr<CommandExecutor> executor_;
170 scoped_refptr<gfx::GLSurface> surface_; 171 scoped_refptr<gfx::GLSurface> surface_;
171 scoped_refptr<gfx::GLContext> context_; 172 scoped_refptr<gfx::GLContext> context_;
172 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; 173 std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_;
173 scoped_ptr<TransferBuffer> transfer_buffer_; 174 std::unique_ptr<TransferBuffer> transfer_buffer_;
174 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; 175 std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_;
175 bool context_lost_allowed_; 176 bool context_lost_allowed_;
176 bool pause_commands_; 177 bool pause_commands_;
177 uint32_t paused_order_num_; 178 uint32_t paused_order_num_;
178 179
179 const CommandBufferId command_buffer_id_; 180 const CommandBufferId command_buffer_id_;
180 uint64_t next_fence_sync_release_; 181 uint64_t next_fence_sync_release_;
181 182
182 bool use_iosurface_memory_buffers_ = false; 183 bool use_iosurface_memory_buffers_ = false;
183 184
184 // Used on Android to virtualize GL for all contexts. 185 // Used on Android to virtualize GL for all contexts.
185 static int use_count_; 186 static int use_count_;
186 static scoped_refptr<gfx::GLShareGroup>* base_share_group_; 187 static scoped_refptr<gfx::GLShareGroup>* base_share_group_;
187 static scoped_refptr<gfx::GLSurface>* base_surface_; 188 static scoped_refptr<gfx::GLSurface>* base_surface_;
188 static scoped_refptr<gfx::GLContext>* base_context_; 189 static scoped_refptr<gfx::GLContext>* base_context_;
189 }; 190 };
190 191
191 } // namespace gpu 192 } // namespace gpu
192 193
193 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_ 194 #endif // GPU_COMMAND_BUFFER_TESTS_GL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698