| 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_EGL_API_IMPLEMENTATION_H_ | 5 #ifndef UI_GL_GL_EGL_API_IMPLEMENTATION_H_ |
| 6 #define UI_GL_GL_EGL_API_IMPLEMENTATION_H_ | 6 #define UI_GL_GL_EGL_API_IMPLEMENTATION_H_ |
| 7 | 7 |
| 8 #include <vector> |
| 9 |
| 8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 9 #include "gl_bindings.h" | 11 #include "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 gfx { | 17 namespace gfx { |
| 13 | 18 |
| 14 class GLContext; | 19 class GLContext; |
| 15 struct GLWindowSystemBindingInfo; | 20 struct GLWindowSystemBindingInfo; |
| 16 | 21 |
| 17 void InitializeStaticGLBindingsEGL(); | 22 void InitializeStaticGLBindingsEGL(); |
| 23 void InitializeDynamicGLBindingsEGL(GLContext* context); |
| 18 void InitializeDebugGLBindingsEGL(); | 24 void InitializeDebugGLBindingsEGL(); |
| 19 void ClearGLBindingsEGL(); | 25 void ClearGLBindingsEGL(); |
| 20 bool GetGLWindowSystemBindingInfoEGL(GLWindowSystemBindingInfo* info); | 26 bool GetGLWindowSystemBindingInfoEGL(GLWindowSystemBindingInfo* info); |
| 21 | 27 |
| 22 class GL_EXPORT EGLApiBase : public EGLApi { | 28 class GL_EXPORT EGLApiBase : public EGLApi { |
| 23 public: | 29 public: |
| 24 // Include the auto-generated part of this class. We split this because | 30 // Include the auto-generated part of this class. We split this because |
| 25 // it means we can easily edit the non-auto generated parts right here in | 31 // it means we can easily edit the non-auto generated parts right here in |
| 26 // this file instead of having to edit some template or the code generator. | 32 // this file instead of having to edit some template or the code generator. |
| 27 #include "gl_bindings_api_autogen_egl.h" | 33 #include "gl_bindings_api_autogen_egl.h" |
| 28 | 34 |
| 29 protected: | 35 protected: |
| 30 EGLApiBase(); | 36 EGLApiBase(); |
| 31 ~EGLApiBase() override; | 37 ~EGLApiBase() override; |
| 32 void InitializeBase(DriverEGL* driver); | 38 void InitializeBase(DriverEGL* driver); |
| 33 | 39 |
| 34 DriverEGL* driver_; | 40 DriverEGL* driver_; |
| 35 }; | 41 }; |
| 36 | 42 |
| 37 class GL_EXPORT RealEGLApi : public EGLApiBase { | 43 class GL_EXPORT RealEGLApi : public EGLApiBase { |
| 38 public: | 44 public: |
| 39 RealEGLApi(); | 45 RealEGLApi(); |
| 40 ~RealEGLApi() override; | 46 ~RealEGLApi() override; |
| 41 void Initialize(DriverEGL* driver); | 47 void Initialize(DriverEGL* driver); |
| 48 void InitializeWithCommandLine(DriverEGL* driver, |
| 49 base::CommandLine* command_line); |
| 50 |
| 51 void InitializeWithContext(); |
| 52 |
| 53 const char* eglQueryStringFn(EGLDisplay dpy, EGLint name) override; |
| 54 |
| 55 private: |
| 56 void InitializeFilteredExtensions(); |
| 57 |
| 58 // Filtered EGL_EXTENSIONS we return to eglQueryStringFn() calls. |
| 59 std::vector<std::string> disabled_exts_; |
| 60 std::string filtered_exts_; |
| 42 }; | 61 }; |
| 43 | 62 |
| 44 | 63 |
| 45 // Inserts a TRACE for every EGL call. | 64 // Inserts a TRACE for every EGL call. |
| 46 class GL_EXPORT TraceEGLApi : public EGLApi { | 65 class GL_EXPORT TraceEGLApi : public EGLApi { |
| 47 public: | 66 public: |
| 48 TraceEGLApi(EGLApi* egl_api) : egl_api_(egl_api) { } | 67 TraceEGLApi(EGLApi* egl_api) : egl_api_(egl_api) { } |
| 49 ~TraceEGLApi() override; | 68 ~TraceEGLApi() override; |
| 50 | 69 |
| 51 // Include the auto-generated part of this class. We split this because | 70 // Include the auto-generated part of this class. We split this because |
| 52 // it means we can easily edit the non-auto generated parts right here in | 71 // it means we can easily edit the non-auto generated parts right here in |
| 53 // this file instead of having to edit some template or the code generator. | 72 // this file instead of having to edit some template or the code generator. |
| 54 #include "gl_bindings_api_autogen_egl.h" | 73 #include "gl_bindings_api_autogen_egl.h" |
| 55 | 74 |
| 56 private: | 75 private: |
| 57 EGLApi* egl_api_; | 76 EGLApi* egl_api_; |
| 58 }; | 77 }; |
| 59 | 78 |
| 60 } // namespace gfx | 79 } // namespace gfx |
| 61 | 80 |
| 62 #endif // UI_GL_GL_EGL_API_IMPLEMENTATION_H_ | 81 #endif // UI_GL_GL_EGL_API_IMPLEMENTATION_H_ |
| 63 | 82 |
| 64 | 83 |
| 65 | 84 |
| OLD | NEW |