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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "ui/gl/gl_bindings.h" | 12 #include "ui/gl/gl_bindings.h" |
| 13 #include "ui/gl/gl_export.h" | 13 #include "ui/gl/gl_export.h" |
| 14 #include "ui/gl/gl_workarounds.h" | |
| 14 | 15 |
| 15 namespace base { | 16 namespace base { |
| 16 class CommandLine; | 17 class CommandLine; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace gl { | 20 namespace gl { |
| 20 | 21 |
| 21 struct GLVersionInfo; | 22 struct GLVersionInfo; |
| 22 | 23 |
| 23 GL_EXPORT void InitializeStaticGLBindingsGL(); | 24 GL_EXPORT void InitializeStaticGLBindingsGL(); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 GLsizei width, | 97 GLsizei width, |
| 97 GLsizei height) override; | 98 GLsizei height) override; |
| 98 | 99 |
| 99 void glRenderbufferStorageMultisampleFn(GLenum target, | 100 void glRenderbufferStorageMultisampleFn(GLenum target, |
| 100 GLsizei samples, | 101 GLsizei samples, |
| 101 GLenum internalformat, | 102 GLenum internalformat, |
| 102 GLsizei width, | 103 GLsizei width, |
| 103 GLsizei height) override; | 104 GLsizei height) override; |
| 104 | 105 |
| 105 void glClearFn(GLbitfield mask) override; | 106 void glClearFn(GLbitfield mask) override; |
| 107 void glClearColorFn(GLclampf red, | |
| 108 GLclampf green, | |
| 109 GLclampf blue, | |
| 110 GLclampf alpha) override; | |
| 106 void glDrawArraysFn(GLenum mode, GLint first, GLsizei count) override; | 111 void glDrawArraysFn(GLenum mode, GLint first, GLsizei count) override; |
| 107 void glDrawElementsFn(GLenum mode, | 112 void glDrawElementsFn(GLenum mode, |
| 108 GLsizei count, | 113 GLsizei count, |
| 109 GLenum type, | 114 GLenum type, |
| 110 const void* indices) override; | 115 const void* indices) override; |
| 111 | 116 |
| 112 void glClearDepthFn(GLclampd depth) override; | 117 void glClearDepthFn(GLclampd depth) override; |
| 113 void glDepthRangeFn(GLclampd z_near, GLclampd z_far) override; | 118 void glDepthRangeFn(GLclampd z_near, GLclampd z_far) override; |
| 114 | 119 |
| 115 void InitializeFilteredExtensions(); | 120 void InitializeFilteredExtensions(); |
| 121 void setGLWorkarounds(const GLWorkarounds& workarounds); | |
|
Zhenyao Mo
2017/07/12 17:00:15
You need to either name it SetGLWorkarounds() or s
jiajia.qin
2017/07/12 18:29:44
Done. Rename to set_gl_workarounds()
| |
| 116 void set_version(std::unique_ptr<GLVersionInfo> version); | 122 void set_version(std::unique_ptr<GLVersionInfo> version); |
| 117 | 123 |
| 118 private: | 124 private: |
| 119 // Filtered GL_EXTENSIONS we return to glGetString(i) calls. | 125 // Filtered GL_EXTENSIONS we return to glGetString(i) calls. |
| 120 std::vector<std::string> disabled_exts_; | 126 std::vector<std::string> disabled_exts_; |
| 121 std::vector<std::string> filtered_exts_; | 127 std::vector<std::string> filtered_exts_; |
| 122 std::string filtered_exts_str_; | 128 std::string filtered_exts_str_; |
| 123 | 129 |
| 130 GLWorkarounds gl_workarounds_; | |
| 124 std::unique_ptr<GLVersionInfo> version_; | 131 std::unique_ptr<GLVersionInfo> version_; |
| 125 | 132 |
| 126 #if DCHECK_IS_ON() | 133 #if DCHECK_IS_ON() |
| 127 bool filtered_exts_initialized_; | 134 bool filtered_exts_initialized_; |
| 128 #endif | 135 #endif |
| 129 }; | 136 }; |
| 130 | 137 |
| 131 // Inserts a TRACE for every GL call. | 138 // Inserts a TRACE for every GL call. |
| 132 class TraceGLApi : public GLApi { | 139 class TraceGLApi : public GLApi { |
| 133 public: | 140 public: |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 | 173 |
| 167 // Include the auto-generated part of this class. We split this because | 174 // Include the auto-generated part of this class. We split this because |
| 168 // it means we can easily edit the non-auto generated parts right here in | 175 // it means we can easily edit the non-auto generated parts right here in |
| 169 // this file instead of having to edit some template or the code generator. | 176 // this file instead of having to edit some template or the code generator. |
| 170 #include "gl_bindings_api_autogen_gl.h" | 177 #include "gl_bindings_api_autogen_gl.h" |
| 171 }; | 178 }; |
| 172 | 179 |
| 173 } // namespace gl | 180 } // namespace gl |
| 174 | 181 |
| 175 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ | 182 #endif // UI_GL_GL_GL_API_IMPLEMENTATION_H_ |
| OLD | NEW |