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 #ifndef UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 5 #ifndef UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
6 #define UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 6 #define UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 // Implemenents the GL API by calling directly into the driver. | 56 // Implemenents the GL API by calling directly into the driver. |
57 class GL_EXPORT RealGLApi : public GLApiBase { | 57 class GL_EXPORT RealGLApi : public GLApiBase { |
58 public: | 58 public: |
59 RealGLApi(); | 59 RealGLApi(); |
60 ~RealGLApi() override; | 60 ~RealGLApi() override; |
61 void Initialize(DriverGL* driver); | 61 void Initialize(DriverGL* driver); |
62 void InitializeWithCommandLine(DriverGL* driver, | 62 void InitializeWithCommandLine(DriverGL* driver, |
63 base::CommandLine* command_line); | 63 base::CommandLine* command_line); |
64 | 64 |
65 void InitializeWithContext(); | |
66 | |
67 void glGetIntegervFn(GLenum pname, GLint* params) override; | 65 void glGetIntegervFn(GLenum pname, GLint* params) override; |
68 const GLubyte* glGetStringFn(GLenum name) override; | 66 const GLubyte* glGetStringFn(GLenum name) override; |
69 const GLubyte* glGetStringiFn(GLenum name, GLuint index) override; | 67 const GLubyte* glGetStringiFn(GLenum name, GLuint index) override; |
70 | 68 |
| 69 void InitializeFilteredExtensions(); |
| 70 |
71 private: | 71 private: |
72 void InitializeFilteredExtensions(); | |
73 void glFinishFn() override; | 72 void glFinishFn() override; |
74 void glFlushFn() override; | 73 void glFlushFn() override; |
75 | 74 |
76 // Filtered GL_EXTENSIONS we return to glGetString(i) calls. | 75 // Filtered GL_EXTENSIONS we return to glGetString(i) calls. |
77 std::vector<std::string> disabled_exts_; | 76 std::vector<std::string> disabled_exts_; |
78 std::vector<std::string> filtered_exts_; | 77 std::vector<std::string> filtered_exts_; |
79 std::string filtered_exts_str_; | 78 std::string filtered_exts_str_; |
| 79 |
| 80 #if DCHECK_IS_ON() |
| 81 bool filtered_exts_initialized_; |
| 82 #endif |
80 }; | 83 }; |
81 | 84 |
82 // Inserts a TRACE for every GL call. | 85 // Inserts a TRACE for every GL call. |
83 class TraceGLApi : public GLApi { | 86 class TraceGLApi : public GLApi { |
84 public: | 87 public: |
85 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } | 88 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } |
86 ~TraceGLApi() override; | 89 ~TraceGLApi() override; |
87 | 90 |
88 // Include the auto-generated part of this class. We split this because | 91 // Include the auto-generated part of this class. We split this because |
89 // it means we can easily edit the non-auto generated parts right here in | 92 // it means we can easily edit the non-auto generated parts right here in |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 ScopedSetGLToRealGLApi(); | 144 ScopedSetGLToRealGLApi(); |
142 ~ScopedSetGLToRealGLApi(); | 145 ~ScopedSetGLToRealGLApi(); |
143 | 146 |
144 private: | 147 private: |
145 GLApi* old_gl_api_; | 148 GLApi* old_gl_api_; |
146 }; | 149 }; |
147 | 150 |
148 } // namespace gfx | 151 } // namespace gfx |
149 | 152 |
150 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 153 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
OLD | NEW |