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 #ifndef UI_GFX_GL_GL_IMPLEMENTATION_H_ | 5 #ifndef UI_GFX_GL_GL_IMPLEMENTATION_H_ |
6 #define UI_GFX_GL_GL_IMPLEMENTATION_H_ | 6 #define UI_GFX_GL_GL_IMPLEMENTATION_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/native_library.h" | 11 #include "base/native_library.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "ui/gfx/gl/gl_switches.h" |
13 | 14 |
14 namespace gfx { | 15 namespace gfx { |
15 | 16 |
16 // The GL implementation currently in use. | 17 // The GL implementation currently in use. |
17 enum GLImplementation { | 18 enum GLImplementation { |
18 kGLImplementationNone, | 19 kGLImplementationNone, |
19 kGLImplementationDesktopGL, | 20 kGLImplementationDesktopGL, |
20 kGLImplementationOSMesaGL, | 21 kGLImplementationOSMesaGL, |
21 kGLImplementationEGLGLES2, | 22 kGLImplementationEGLGLES2, |
22 kGLImplementationMockGL | 23 kGLImplementationMockGL |
23 }; | 24 }; |
24 | 25 |
25 // The GL implementation names that can be passed to --use-gl. | |
26 extern const char kGLImplementationDesktopName[]; | |
27 extern const char kGLImplementationOSMesaName[]; | |
28 extern const char kGLImplementationEGLName[]; | |
29 extern const char kGLImplementationMockName[]; | |
30 | |
31 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
32 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); | 27 typedef void* (WINAPI *GLGetProcAddressProc)(const char* name); |
33 #else | 28 #else |
34 typedef void* (*GLGetProcAddressProc)(const char* name); | 29 typedef void* (*GLGetProcAddressProc)(const char* name); |
35 #endif | 30 #endif |
36 | 31 |
37 // Initialize a particular GL implementation. | 32 // Initialize a particular GL implementation. |
38 bool InitializeGLBindings(GLImplementation implementation); | 33 bool InitializeGLBindings(GLImplementation implementation); |
39 | 34 |
40 // Initialize Debug logging wrappers for GL bindings. | 35 // Initialize Debug logging wrappers for GL bindings. |
(...skipping 24 matching lines...) Expand all Loading... |
65 | 60 |
66 // Set an additional function that will be called to find GL entry points. | 61 // Set an additional function that will be called to find GL entry points. |
67 void SetGLGetProcAddressProc(GLGetProcAddressProc proc); | 62 void SetGLGetProcAddressProc(GLGetProcAddressProc proc); |
68 | 63 |
69 // Find an entry point in the current GL implementation. | 64 // Find an entry point in the current GL implementation. |
70 void* GetGLProcAddress(const char* name); | 65 void* GetGLProcAddress(const char* name); |
71 | 66 |
72 } // namespace gfx | 67 } // namespace gfx |
73 | 68 |
74 #endif // UI_GFX_GL_GL_IMPLEMENTATION_H_ | 69 #endif // UI_GFX_GL_GL_IMPLEMENTATION_H_ |
OLD | NEW |