| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 GLShareGroup* GLContext::share_group() { | 163 GLShareGroup* GLContext::share_group() { |
| 164 return share_group_.get(); | 164 return share_group_.get(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 bool GLContext::LosesAllContextsOnContextLost() { | 167 bool GLContext::LosesAllContextsOnContextLost() { |
| 168 switch (GetGLImplementation()) { | 168 switch (GetGLImplementation()) { |
| 169 case kGLImplementationDesktopGL: | 169 case kGLImplementationDesktopGL: |
| 170 return false; | 170 return false; |
| 171 case kGLImplementationEGLGLES2: | 171 case kGLImplementationEGLGLES2: |
| 172 case kGLImplementationSwiftShaderGL: |
| 172 return true; | 173 return true; |
| 173 case kGLImplementationOSMesaGL: | 174 case kGLImplementationOSMesaGL: |
| 174 case kGLImplementationAppleGL: | 175 case kGLImplementationAppleGL: |
| 175 return false; | 176 return false; |
| 176 case kGLImplementationMockGL: | 177 case kGLImplementationMockGL: |
| 177 case kGLImplementationStubGL: | 178 case kGLImplementationStubGL: |
| 178 return false; | 179 return false; |
| 179 default: | 180 default: |
| 180 NOTREACHED(); | 181 NOTREACHED(); |
| 181 return true; | 182 return true; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 333 |
| 333 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context, | 334 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context, |
| 334 GLSurface* compatible_surface, | 335 GLSurface* compatible_surface, |
| 335 const GLContextAttribs& attribs) { | 336 const GLContextAttribs& attribs) { |
| 336 if (!context->Initialize(compatible_surface, attribs)) | 337 if (!context->Initialize(compatible_surface, attribs)) |
| 337 return nullptr; | 338 return nullptr; |
| 338 return context; | 339 return context; |
| 339 } | 340 } |
| 340 | 341 |
| 341 } // namespace gl | 342 } // namespace gl |
| OLD | NEW |