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

Side by Side Diff: gpu/gles2_conform_support/egl/display.cc

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 #include "gpu/gles2_conform_support/egl/display.h" 5 #include "gpu/gles2_conform_support/egl/display.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // We do not support more than one window surface. 153 // We do not support more than one window surface.
154 return EGL_NO_SURFACE; 154 return EGL_NO_SURFACE;
155 } 155 }
156 156
157 { 157 {
158 gpu::TransferBufferManager* manager = 158 gpu::TransferBufferManager* manager =
159 new gpu::TransferBufferManager(nullptr); 159 new gpu::TransferBufferManager(nullptr);
160 transfer_buffer_manager_ = manager; 160 transfer_buffer_manager_ = manager;
161 manager->Initialize(); 161 manager->Initialize();
162 } 162 }
163 scoped_ptr<gpu::CommandBufferService> command_buffer( 163 std::unique_ptr<gpu::CommandBufferService> command_buffer(
164 new gpu::CommandBufferService(transfer_buffer_manager_.get())); 164 new gpu::CommandBufferService(transfer_buffer_manager_.get()));
165 if (!command_buffer->Initialize()) 165 if (!command_buffer->Initialize())
166 return NULL; 166 return NULL;
167 167
168 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( 168 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup(
169 gpu_preferences_, NULL, NULL, 169 gpu_preferences_, NULL, NULL,
170 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), 170 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_),
171 new gpu::gles2::FramebufferCompletenessCache, NULL, NULL, NULL, true)); 171 new gpu::gles2::FramebufferCompletenessCache, NULL, NULL, NULL, true));
172 172
173 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); 173 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get()));
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 gpu::gles2::DisallowedFeatures(), 221 gpu::gles2::DisallowedFeatures(),
222 attribs)) { 222 attribs)) {
223 return EGL_NO_SURFACE; 223 return EGL_NO_SURFACE;
224 } 224 }
225 225
226 command_buffer->SetPutOffsetChangeCallback(base::Bind( 226 command_buffer->SetPutOffsetChangeCallback(base::Bind(
227 &gpu::CommandExecutor::PutChanged, base::Unretained(executor_.get()))); 227 &gpu::CommandExecutor::PutChanged, base::Unretained(executor_.get())));
228 command_buffer->SetGetBufferChangeCallback(base::Bind( 228 command_buffer->SetGetBufferChangeCallback(base::Bind(
229 &gpu::CommandExecutor::SetGetBuffer, base::Unretained(executor_.get()))); 229 &gpu::CommandExecutor::SetGetBuffer, base::Unretained(executor_.get())));
230 230
231 scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( 231 std::unique_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper(
232 new gpu::gles2::GLES2CmdHelper(command_buffer.get())); 232 new gpu::gles2::GLES2CmdHelper(command_buffer.get()));
233 if (!cmd_helper->Initialize(kCommandBufferSize)) 233 if (!cmd_helper->Initialize(kCommandBufferSize))
234 return NULL; 234 return NULL;
235 235
236 scoped_ptr<gpu::TransferBuffer> transfer_buffer(new gpu::TransferBuffer( 236 std::unique_ptr<gpu::TransferBuffer> transfer_buffer(
237 cmd_helper.get())); 237 new gpu::TransferBuffer(cmd_helper.get()));
238 238
239 command_buffer_.reset(command_buffer.release()); 239 command_buffer_.reset(command_buffer.release());
240 transfer_buffer_.reset(transfer_buffer.release()); 240 transfer_buffer_.reset(transfer_buffer.release());
241 gles2_cmd_helper_.reset(cmd_helper.release()); 241 gles2_cmd_helper_.reset(cmd_helper.release());
242 surface_.reset(new Surface(win)); 242 surface_.reset(new Surface(win));
243 243
244 return surface_.get(); 244 return surface_.get();
245 } 245 }
246 246
247 void Display::DestroySurface(EGLSurface surface) { 247 void Display::DestroySurface(EGLSurface surface) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 void Display::SignalSyncToken(const gpu::SyncToken& sync_token, 394 void Display::SignalSyncToken(const gpu::SyncToken& sync_token,
395 const base::Closure& callback) { 395 const base::Closure& callback) {
396 NOTIMPLEMENTED(); 396 NOTIMPLEMENTED();
397 } 397 }
398 398
399 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { 399 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) {
400 return false; 400 return false;
401 } 401 }
402 402
403 } // namespace egl 403 } // namespace egl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698