| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gfx/gl/gl_implementation.h" | 5 #include "ui/gfx/gl/gl_implementation.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "ui/gfx/gl/gl_switches.h" | |
| 14 | 13 |
| 15 namespace gfx { | 14 namespace gfx { |
| 16 | 15 |
| 17 const char kGLImplementationDesktopName[] = "desktop"; | |
| 18 const char kGLImplementationOSMesaName[] = "osmesa"; | |
| 19 const char kGLImplementationEGLName[] = "egl"; | |
| 20 const char kGLImplementationMockName[] = "mock"; | |
| 21 | |
| 22 namespace { | 16 namespace { |
| 23 | 17 |
| 24 const struct { | 18 const struct { |
| 25 const char* name; | 19 const char* name; |
| 26 GLImplementation implementation; | 20 GLImplementation implementation; |
| 27 } kGLImplementationNamePairs[] = { | 21 } kGLImplementationNamePairs[] = { |
| 28 { kGLImplementationDesktopName, kGLImplementationDesktopGL }, | 22 { kGLImplementationDesktopName, kGLImplementationDesktopGL }, |
| 29 { kGLImplementationOSMesaName, kGLImplementationOSMesaGL }, | 23 { kGLImplementationOSMesaName, kGLImplementationOSMesaGL }, |
| 30 { kGLImplementationEGLName, kGLImplementationEGLGLES2 }, | 24 { kGLImplementationEGLName, kGLImplementationEGLGLES2 }, |
| 31 { kGLImplementationMockName, kGLImplementationMockGL } | 25 { kGLImplementationMockName, kGLImplementationMockGL } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 if (g_get_proc_address) { | 137 if (g_get_proc_address) { |
| 144 void* proc = g_get_proc_address(name); | 138 void* proc = g_get_proc_address(name); |
| 145 if (proc) | 139 if (proc) |
| 146 return proc; | 140 return proc; |
| 147 } | 141 } |
| 148 | 142 |
| 149 return NULL; | 143 return NULL; |
| 150 } | 144 } |
| 151 | 145 |
| 152 } // namespace gfx | 146 } // namespace gfx |
| OLD | NEW |