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> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "ui/gl/gl_bindings.h" | 11 #include "ui/gl/gl_bindings.h" |
10 #include "ui/gl/gl_export.h" | 12 #include "ui/gl/gl_export.h" |
11 | 13 |
12 namespace gpu { | 14 namespace gpu { |
13 namespace gles2 { | 15 namespace gles2 { |
14 class GLES2Decoder; | 16 class GLES2Decoder; |
15 } | 17 } |
16 } | 18 } |
17 namespace gfx { | 19 namespace gfx { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 }; | 51 }; |
50 | 52 |
51 // Implemenents the GL API by calling directly into the driver. | 53 // Implemenents the GL API by calling directly into the driver. |
52 class RealGLApi : public GLApiBase { | 54 class RealGLApi : public GLApiBase { |
53 public: | 55 public: |
54 RealGLApi(); | 56 RealGLApi(); |
55 ~RealGLApi() override; | 57 ~RealGLApi() override; |
56 void Initialize(DriverGL* driver); | 58 void Initialize(DriverGL* driver); |
57 | 59 |
58 private: | 60 private: |
| 61 void glGetIntegervFn(GLenum pname, GLint* params) override; |
| 62 const GLubyte* glGetStringFn(GLenum name) override; |
| 63 const GLubyte* glGetStringiFn(GLenum name, GLuint index) override; |
| 64 |
59 void glFinishFn() override; | 65 void glFinishFn() override; |
60 void glFlushFn() override; | 66 void glFlushFn() override; |
| 67 |
| 68 // Filtered GL_EXTENSIONS we return to glGetString(i) calls. |
| 69 bool extensions_filtered_ = false; |
| 70 std::vector<std::string> disabled_extensions_; |
| 71 std::vector<std::string> filtered_exts_; |
| 72 std::string filtered_exts_str_; |
61 }; | 73 }; |
62 | 74 |
63 // Inserts a TRACE for every GL call. | 75 // Inserts a TRACE for every GL call. |
64 class TraceGLApi : public GLApi { | 76 class TraceGLApi : public GLApi { |
65 public: | 77 public: |
66 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } | 78 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } |
67 ~TraceGLApi() override; | 79 ~TraceGLApi() override; |
68 | 80 |
69 // Include the auto-generated part of this class. We split this because | 81 // Include the auto-generated part of this class. We split this because |
70 // it means we can easily edit the non-auto generated parts right here in | 82 // 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... |
122 ScopedSetGLToRealGLApi(); | 134 ScopedSetGLToRealGLApi(); |
123 ~ScopedSetGLToRealGLApi(); | 135 ~ScopedSetGLToRealGLApi(); |
124 | 136 |
125 private: | 137 private: |
126 GLApi* old_gl_api_; | 138 GLApi* old_gl_api_; |
127 }; | 139 }; |
128 | 140 |
129 } // namespace gfx | 141 } // namespace gfx |
130 | 142 |
131 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 143 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
OLD | NEW |