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

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

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/gfx/image/image.cc ('k') | ui/message_center/message_center_impl_unittest.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_context.h" 5 #include "ui/gl/gl_context.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 std::string delimited_name(name); 104 std::string delimited_name(name);
105 delimited_name += " "; 105 delimited_name += " ";
106 106
107 return extensions.find(delimited_name) != std::string::npos; 107 return extensions.find(delimited_name) != std::string::npos;
108 } 108 }
109 109
110 const GLVersionInfo* GLContext::GetVersionInfo() { 110 const GLVersionInfo* GLContext::GetVersionInfo() {
111 if (!version_info_) { 111 if (!version_info_) {
112 std::string version = GetGLVersion(); 112 std::string version = GetGLVersion();
113 std::string renderer = GetGLRenderer(); 113 std::string renderer = GetGLRenderer();
114 version_info_ = base::WrapUnique(new GLVersionInfo( 114 version_info_ = base::MakeUnique<GLVersionInfo>(
115 version.c_str(), renderer.c_str(), GetExtensions().c_str())); 115 version.c_str(), renderer.c_str(), GetExtensions().c_str());
116 } 116 }
117 return version_info_.get(); 117 return version_info_.get();
118 } 118 }
119 119
120 GLShareGroup* GLContext::share_group() { 120 GLShareGroup* GLContext::share_group() {
121 return share_group_.get(); 121 return share_group_.get();
122 } 122 }
123 123
124 bool GLContext::LosesAllContextsOnContextLost() { 124 bool GLContext::LosesAllContextsOnContextLost() {
125 switch (GetGLImplementation()) { 125 switch (GetGLImplementation()) {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context, 274 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context,
275 GLSurface* compatible_surface, 275 GLSurface* compatible_surface,
276 GpuPreference gpu_preference) { 276 GpuPreference gpu_preference) {
277 if (!context->Initialize(compatible_surface, gpu_preference)) 277 if (!context->Initialize(compatible_surface, gpu_preference))
278 return nullptr; 278 return nullptr;
279 return context; 279 return context;
280 } 280 }
281 281
282 } // namespace gl 282 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gfx/image/image.cc ('k') | ui/message_center/message_center_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698