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

Side by Side Diff: ui/gl/gl_surface_wgl.cc

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/gl_surface_ozone.cc ('k') | ui/gl/gl_surface_win.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 "ui/gl/gl_surface_wgl.h" 5 #include "ui/gl/gl_surface_wgl.h"
6 6
7 #include <memory>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h"
9 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
10 #include "ui/gl/gl_bindings.h" 11 #include "ui/gl/gl_bindings.h"
11 #include "ui/gl/gl_gl_api_implementation.h" 12 #include "ui/gl/gl_gl_api_implementation.h"
12 #include "ui/gl/gl_wgl_api_implementation.h" 13 #include "ui/gl/gl_wgl_api_implementation.h"
13 14
14 namespace gfx { 15 namespace gfx {
15 16
16 namespace { 17 namespace {
17 const PIXELFORMATDESCRIPTOR kPixelFormatDescriptor = { 18 const PIXELFORMATDESCRIPTOR kPixelFormatDescriptor = {
18 sizeof(kPixelFormatDescriptor), // Size of structure. 19 sizeof(kPixelFormatDescriptor), // Size of structure.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 void* GLSurfaceWGL::GetDisplay() { 157 void* GLSurfaceWGL::GetDisplay() {
157 return GetDisplayDC(); 158 return GetDisplayDC();
158 } 159 }
159 160
160 bool GLSurfaceWGL::InitializeOneOff() { 161 bool GLSurfaceWGL::InitializeOneOff() {
161 static bool initialized = false; 162 static bool initialized = false;
162 if (initialized) 163 if (initialized)
163 return true; 164 return true;
164 165
165 DCHECK(g_display == NULL); 166 DCHECK(g_display == NULL);
166 scoped_ptr<DisplayWGL> wgl_display(new DisplayWGL); 167 std::unique_ptr<DisplayWGL> wgl_display(new DisplayWGL);
167 if (!wgl_display->Init()) 168 if (!wgl_display->Init())
168 return false; 169 return false;
169 170
170 g_display = wgl_display.release(); 171 g_display = wgl_display.release();
171 initialized = true; 172 initialized = true;
172 return true; 173 return true;
173 } 174 }
174 175
175 void GLSurfaceWGL::InitializeOneOffForTesting() { 176 void GLSurfaceWGL::InitializeOneOffForTesting() {
176 if (g_display == NULL) { 177 if (g_display == NULL) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 360
360 gfx::Size PbufferGLSurfaceWGL::GetSize() { 361 gfx::Size PbufferGLSurfaceWGL::GetSize() {
361 return size_; 362 return size_;
362 } 363 }
363 364
364 void* PbufferGLSurfaceWGL::GetHandle() { 365 void* PbufferGLSurfaceWGL::GetHandle() {
365 return device_context_; 366 return device_context_;
366 } 367 }
367 368
368 } // namespace gfx 369 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gl/gl_surface_ozone.cc ('k') | ui/gl/gl_surface_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698