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 |
14 namespace base { | |
15 class CommandLine; | |
16 } | |
12 namespace gpu { | 17 namespace gpu { |
13 namespace gles2 { | 18 namespace gles2 { |
14 class GLES2Decoder; | 19 class GLES2Decoder; |
15 } | 20 } |
16 } | 21 } |
17 namespace gfx { | 22 namespace gfx { |
18 | 23 |
19 class GLContext; | 24 class GLContext; |
20 class GLSurface; | 25 class GLSurface; |
21 struct GLVersionInfo; | 26 struct GLVersionInfo; |
(...skipping 25 matching lines...) Expand all Loading... | |
47 | 52 |
48 DriverGL* driver_; | 53 DriverGL* driver_; |
49 }; | 54 }; |
50 | 55 |
51 // Implemenents the GL API by calling directly into the driver. | 56 // Implemenents the GL API by calling directly into the driver. |
52 class RealGLApi : public GLApiBase { | 57 class RealGLApi : public GLApiBase { |
53 public: | 58 public: |
54 RealGLApi(); | 59 RealGLApi(); |
55 ~RealGLApi() override; | 60 ~RealGLApi() override; |
56 void Initialize(DriverGL* driver); | 61 void Initialize(DriverGL* driver); |
62 void InitializeWithCommandLine(DriverGL* driver, | |
63 base::CommandLine* command_line); | |
no sievers
2015/05/01 21:55:00
So somebody has to call this in the production cod
David Yen
2015/05/01 22:34:38
In Initialize() it defaults to using the process c
no sievers
2015/05/01 22:48:35
My bad. I missed that Initialize() calls this with
David Yen
2015/05/01 22:59:35
I actually prefer the more descriptive name, but h
| |
64 | |
65 void glGetIntegervFn(GLenum pname, GLint* params) override; | |
66 const GLubyte* glGetStringFn(GLenum name) override; | |
67 const GLubyte* glGetStringiFn(GLenum name, GLuint index) override; | |
57 | 68 |
58 private: | 69 private: |
59 void glFinishFn() override; | 70 void glFinishFn() override; |
60 void glFlushFn() override; | 71 void glFlushFn() override; |
72 | |
73 // Filtered GL_EXTENSIONS we return to glGetString(i) calls. | |
74 std::vector<std::string> filtered_exts_; | |
75 std::string filtered_exts_str_; | |
61 }; | 76 }; |
62 | 77 |
63 // Inserts a TRACE for every GL call. | 78 // Inserts a TRACE for every GL call. |
64 class TraceGLApi : public GLApi { | 79 class TraceGLApi : public GLApi { |
65 public: | 80 public: |
66 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } | 81 TraceGLApi(GLApi* gl_api) : gl_api_(gl_api) { } |
67 ~TraceGLApi() override; | 82 ~TraceGLApi() override; |
68 | 83 |
69 // Include the auto-generated part of this class. We split this because | 84 // 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 | 85 // 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(); | 137 ScopedSetGLToRealGLApi(); |
123 ~ScopedSetGLToRealGLApi(); | 138 ~ScopedSetGLToRealGLApi(); |
124 | 139 |
125 private: | 140 private: |
126 GLApi* old_gl_api_; | 141 GLApi* old_gl_api_; |
127 }; | 142 }; |
128 | 143 |
129 } // namespace gfx | 144 } // namespace gfx |
130 | 145 |
131 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 146 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
OLD | NEW |