| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |