| 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 <map> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "gl_bindings.h" | 12 #include "gl_bindings.h" |
| 12 #include "ui/gl/gl_export.h" | 13 #include "ui/gl/gl_export.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 class CommandLine; | 16 class CommandLine; |
| 16 } | 17 } |
| 17 namespace gfx { | 18 namespace gfx { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 39 DriverEGL* driver_; | 40 DriverEGL* driver_; |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 class GL_EXPORT RealEGLApi : public EGLApiBase { | 43 class GL_EXPORT RealEGLApi : public EGLApiBase { |
| 43 public: | 44 public: |
| 44 RealEGLApi(); | 45 RealEGLApi(); |
| 45 ~RealEGLApi() override; | 46 ~RealEGLApi() override; |
| 46 void Initialize(DriverEGL* driver); | 47 void Initialize(DriverEGL* driver); |
| 47 void InitializeWithCommandLine(DriverEGL* driver, | 48 void InitializeWithCommandLine(DriverEGL* driver, |
| 48 base::CommandLine* command_line); | 49 base::CommandLine* command_line); |
| 49 void InitializeFilteredExtensions(); | |
| 50 | 50 |
| 51 const char* eglQueryStringFn(EGLDisplay dpy, EGLint name) override; | 51 const char* eglQueryStringFn(EGLDisplay dpy, EGLint name) override; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // Filtered EGL_EXTENSIONS we return to eglQueryStringFn() calls. | 54 // Filtered EGL_EXTENSIONS we return to eglQueryStringFn() calls. |
| 55 std::vector<std::string> disabled_exts_; | 55 std::vector<std::string> disabled_exts_; |
| 56 std::string filtered_exts_; | 56 std::map<EGLDisplay, std::string> filtered_exts_; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 | 59 |
| 60 // Inserts a TRACE for every EGL call. | 60 // Inserts a TRACE for every EGL call. |
| 61 class GL_EXPORT TraceEGLApi : public EGLApi { | 61 class GL_EXPORT TraceEGLApi : public EGLApi { |
| 62 public: | 62 public: |
| 63 TraceEGLApi(EGLApi* egl_api) : egl_api_(egl_api) { } | 63 TraceEGLApi(EGLApi* egl_api) : egl_api_(egl_api) { } |
| 64 ~TraceEGLApi() override; | 64 ~TraceEGLApi() override; |
| 65 | 65 |
| 66 // Include the auto-generated part of this class. We split this because | 66 // Include the auto-generated part of this class. We split this because |
| 67 // it means we can easily edit the non-auto generated parts right here in | 67 // it means we can easily edit the non-auto generated parts right here in |
| 68 // this file instead of having to edit some template or the code generator. | 68 // this file instead of having to edit some template or the code generator. |
| 69 #include "gl_bindings_api_autogen_egl.h" | 69 #include "gl_bindings_api_autogen_egl.h" |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 EGLApi* egl_api_; | 72 EGLApi* egl_api_; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace gfx | 75 } // namespace gfx |
| 76 | 76 |
| 77 #endif // UI_GL_GL_EGL_API_IMPLEMENTATION_H_ | 77 #endif // UI_GL_GL_EGL_API_IMPLEMENTATION_H_ |
| 78 | 78 |
| 79 | 79 |
| 80 | 80 |
| OLD | NEW |