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

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: rebase on master 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 | « gpu/gles2_conform_support/egl/display.h ('k') | gpu/gles2_conform_support/egl/egl.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) 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // We do not support more than one window surface. 155 // We do not support more than one window surface.
156 return EGL_NO_SURFACE; 156 return EGL_NO_SURFACE;
157 } 157 }
158 158
159 { 159 {
160 gpu::TransferBufferManager* manager = 160 gpu::TransferBufferManager* manager =
161 new gpu::TransferBufferManager(nullptr); 161 new gpu::TransferBufferManager(nullptr);
162 transfer_buffer_manager_ = manager; 162 transfer_buffer_manager_ = manager;
163 manager->Initialize(); 163 manager->Initialize();
164 } 164 }
165 scoped_ptr<gpu::CommandBufferService> command_buffer( 165 std::unique_ptr<gpu::CommandBufferService> command_buffer(
166 new gpu::CommandBufferService(transfer_buffer_manager_.get())); 166 new gpu::CommandBufferService(transfer_buffer_manager_.get()));
167 if (!command_buffer->Initialize()) 167 if (!command_buffer->Initialize())
168 return NULL; 168 return NULL;
169 169
170 scoped_refptr<gpu::gles2::FeatureInfo> feature_info( 170 scoped_refptr<gpu::gles2::FeatureInfo> feature_info(
171 new gpu::gles2::FeatureInfo(gpu_driver_bug_workarounds_)); 171 new gpu::gles2::FeatureInfo(gpu_driver_bug_workarounds_));
172 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup( 172 scoped_refptr<gpu::gles2::ContextGroup> group(new gpu::gles2::ContextGroup(
173 gpu_preferences_, NULL, NULL, 173 gpu_preferences_, NULL, NULL,
174 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_), 174 new gpu::gles2::ShaderTranslatorCache(gpu_preferences_),
175 new gpu::gles2::FramebufferCompletenessCache, feature_info, NULL, NULL, 175 new gpu::gles2::FramebufferCompletenessCache, feature_info, NULL, NULL,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 gpu::gles2::DisallowedFeatures(), 226 gpu::gles2::DisallowedFeatures(),
227 attribs)) { 227 attribs)) {
228 return EGL_NO_SURFACE; 228 return EGL_NO_SURFACE;
229 } 229 }
230 230
231 command_buffer->SetPutOffsetChangeCallback(base::Bind( 231 command_buffer->SetPutOffsetChangeCallback(base::Bind(
232 &gpu::CommandExecutor::PutChanged, base::Unretained(executor_.get()))); 232 &gpu::CommandExecutor::PutChanged, base::Unretained(executor_.get())));
233 command_buffer->SetGetBufferChangeCallback(base::Bind( 233 command_buffer->SetGetBufferChangeCallback(base::Bind(
234 &gpu::CommandExecutor::SetGetBuffer, base::Unretained(executor_.get()))); 234 &gpu::CommandExecutor::SetGetBuffer, base::Unretained(executor_.get())));
235 235
236 scoped_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper( 236 std::unique_ptr<gpu::gles2::GLES2CmdHelper> cmd_helper(
237 new gpu::gles2::GLES2CmdHelper(command_buffer.get())); 237 new gpu::gles2::GLES2CmdHelper(command_buffer.get()));
238 if (!cmd_helper->Initialize(kCommandBufferSize)) 238 if (!cmd_helper->Initialize(kCommandBufferSize))
239 return NULL; 239 return NULL;
240 240
241 scoped_ptr<gpu::TransferBuffer> transfer_buffer(new gpu::TransferBuffer( 241 std::unique_ptr<gpu::TransferBuffer> transfer_buffer(
242 cmd_helper.get())); 242 new gpu::TransferBuffer(cmd_helper.get()));
243 243
244 command_buffer_.reset(command_buffer.release()); 244 command_buffer_.reset(command_buffer.release());
245 transfer_buffer_.reset(transfer_buffer.release()); 245 transfer_buffer_.reset(transfer_buffer.release());
246 gles2_cmd_helper_.reset(cmd_helper.release()); 246 gles2_cmd_helper_.reset(cmd_helper.release());
247 surface_.reset(new Surface(win)); 247 surface_.reset(new Surface(win));
248 248
249 return surface_.get(); 249 return surface_.get();
250 } 250 }
251 251
252 void Display::DestroySurface(EGLSurface surface) { 252 void Display::DestroySurface(EGLSurface surface) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 void Display::SignalSyncToken(const gpu::SyncToken& sync_token, 403 void Display::SignalSyncToken(const gpu::SyncToken& sync_token,
404 const base::Closure& callback) { 404 const base::Closure& callback) {
405 NOTIMPLEMENTED(); 405 NOTIMPLEMENTED();
406 } 406 }
407 407
408 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { 408 bool Display::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) {
409 return false; 409 return false;
410 } 410 }
411 411
412 } // namespace egl 412 } // namespace egl
OLDNEW
« no previous file with comments | « gpu/gles2_conform_support/egl/display.h ('k') | gpu/gles2_conform_support/egl/egl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698