| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file implements the ViewGLContext and PbufferGLContext classes. | 5 // This file implements the ViewGLContext and PbufferGLContext classes. |
| 6 | 6 |
| 7 #include "app/gfx/gl/gl_context.h" | 7 #include "app/gfx/gl/gl_context.h" |
| 8 | 8 |
| 9 extern "C" { | 9 extern "C" { |
| 10 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 ::XFree(x); | 181 ::XFree(x); |
| 182 } | 182 } |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 bool GLContext::InitializeOneOff() { | 185 bool GLContext::InitializeOneOff() { |
| 186 static bool initialized = false; | 186 static bool initialized = false; |
| 187 if (initialized) | 187 if (initialized) |
| 188 return true; | 188 return true; |
| 189 | 189 |
| 190 static const GLImplementation kAllowedGLImplementations[] = { | 190 static const GLImplementation kAllowedGLImplementations[] = { |
| 191 kGLImplementationDesktopGL, |
| 191 kGLImplementationEGLGLES2, | 192 kGLImplementationEGLGLES2, |
| 192 kGLImplementationDesktopGL, | |
| 193 kGLImplementationOSMesaGL | 193 kGLImplementationOSMesaGL |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 if (!InitializeBestGLBindings( | 196 if (!InitializeBestGLBindings( |
| 197 kAllowedGLImplementations, | 197 kAllowedGLImplementations, |
| 198 kAllowedGLImplementations + arraysize(kAllowedGLImplementations))) { | 198 kAllowedGLImplementations + arraysize(kAllowedGLImplementations))) { |
| 199 LOG(ERROR) << "InitializeBestGLBindings failed."; | 199 LOG(ERROR) << "InitializeBestGLBindings failed."; |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| 202 | 202 |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 } | 822 } |
| 823 case kGLImplementationMockGL: | 823 case kGLImplementationMockGL: |
| 824 return new StubGLContext; | 824 return new StubGLContext; |
| 825 default: | 825 default: |
| 826 NOTREACHED(); | 826 NOTREACHED(); |
| 827 return NULL; | 827 return NULL; |
| 828 } | 828 } |
| 829 } | 829 } |
| 830 | 830 |
| 831 } // namespace gfx | 831 } // namespace gfx |
| OLD | NEW |