Chromium Code Reviews| 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; | |
|
no sievers
2015/04/30 23:49:05
nit: no indent
David Yen
2015/05/01 21:20:38
Done.
| |
| 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 24 matching lines...) Expand all Loading... | |
| 46 void InitializeBase(DriverGL* driver); | 51 void InitializeBase(DriverGL* driver); |
| 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, base::CommandLine* command_line = nullptr); |
|
Zhenyao Mo
2015/04/30 22:40:51
default values are against coding style. Otherwise
David Yen
2015/05/01 21:20:37
Done.
| |
| 57 | 62 |
| 58 private: | 63 private: |
| 64 void glGetIntegervFn(GLenum pname, GLint* params) override; | |
| 65 const GLubyte* glGetStringFn(GLenum name) override; | |
| 66 const GLubyte* glGetStringiFn(GLenum name, GLuint index) override; | |
| 67 | |
| 59 void glFinishFn() override; | 68 void glFinishFn() override; |
| 60 void glFlushFn() override; | 69 void glFlushFn() override; |
| 70 | |
| 71 // Filtered GL_EXTENSIONS we return to glGetString(i) calls. | |
| 72 bool extensions_filtered_ = false; | |
| 73 std::vector<std::string> disabled_extensions_; | |
| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 | 127 |
| 113 // The current virtual context. | 128 // The current virtual context. |
| 114 GLContext* current_context_; | 129 GLContext* current_context_; |
| 115 | 130 |
| 116 // The supported extensions being advertised for this virtual context. | 131 // The supported extensions being advertised for this virtual context. |
| 117 std::string extensions_; | 132 std::string extensions_; |
| 118 }; | 133 }; |
| 119 | 134 |
| 120 class GL_EXPORT ScopedSetGLToRealGLApi { | 135 class GL_EXPORT ScopedSetGLToRealGLApi { |
| 121 public: | 136 public: |
| 122 ScopedSetGLToRealGLApi(); | 137 ScopedSetGLToRealGLApi(GLApi* set_api = nullptr); |
|
no sievers
2015/04/30 23:49:05
Instead of changing this (which is supposed to set
David Yen
2015/05/01 21:20:37
No longer relevant, so removed.
| |
| 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 |