Extension syncing: Introduce a NeedsSync pref
[chromium-blink-merge.git] / ui / gl / gl_egl_api_implementation.h
blobd09255f0eb666f4a8a24c2576f9519f70b6c9a7a
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
3 // found in the LICENSE file.
5 #ifndef UI_GL_GL_EGL_API_IMPLEMENTATION_H_
6 #define UI_GL_GL_EGL_API_IMPLEMENTATION_H_
8 #include <map>
9 #include <vector>
11 #include "base/compiler_specific.h"
12 #include "gl_bindings.h"
13 #include "ui/gl/gl_export.h"
15 namespace base {
16 class CommandLine;
18 namespace gfx {
20 class GLContext;
21 struct GLWindowSystemBindingInfo;
23 void InitializeStaticGLBindingsEGL();
24 void InitializeDebugGLBindingsEGL();
25 void ClearGLBindingsEGL();
26 bool GetGLWindowSystemBindingInfoEGL(GLWindowSystemBindingInfo* info);
28 class GL_EXPORT EGLApiBase : public EGLApi {
29 public:
30 // Include the auto-generated part of this class. We split this because
31 // it means we can easily edit the non-auto generated parts right here in
32 // this file instead of having to edit some template or the code generator.
33 #include "gl_bindings_api_autogen_egl.h"
35 protected:
36 EGLApiBase();
37 ~EGLApiBase() override;
38 void InitializeBase(DriverEGL* driver);
40 DriverEGL* driver_;
43 class GL_EXPORT RealEGLApi : public EGLApiBase {
44 public:
45 RealEGLApi();
46 ~RealEGLApi() override;
47 void Initialize(DriverEGL* driver);
48 void InitializeWithCommandLine(DriverEGL* driver,
49 base::CommandLine* command_line);
51 const char* eglQueryStringFn(EGLDisplay dpy, EGLint name) override;
53 private:
54 // Filtered EGL_EXTENSIONS we return to eglQueryStringFn() calls.
55 std::vector<std::string> disabled_exts_;
56 std::map<EGLDisplay, std::string> filtered_exts_;
60 // Inserts a TRACE for every EGL call.
61 class GL_EXPORT TraceEGLApi : public EGLApi {
62 public:
63 TraceEGLApi(EGLApi* egl_api) : egl_api_(egl_api) { }
64 ~TraceEGLApi() override;
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
68 // this file instead of having to edit some template or the code generator.
69 #include "gl_bindings_api_autogen_egl.h"
71 private:
72 EGLApi* egl_api_;
75 } // namespace gfx
77 #endif // UI_GL_GL_EGL_API_IMPLEMENTATION_H_