Add custom_tabs_client to third_party.
[chromium-blink-merge.git] / ui / gl / gl_egl_api_implementation.h
blob46f5f842961de97fc5fe7ab6c897fd3653823e69
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 <vector>
10 #include "base/compiler_specific.h"
11 #include "gl_bindings.h"
12 #include "ui/gl/gl_export.h"
14 namespace base {
15 class CommandLine;
17 namespace gfx {
19 class GLContext;
20 struct GLWindowSystemBindingInfo;
22 void InitializeStaticGLBindingsEGL();
23 void InitializeDebugGLBindingsEGL();
24 void ClearGLBindingsEGL();
25 bool GetGLWindowSystemBindingInfoEGL(GLWindowSystemBindingInfo* info);
27 class GL_EXPORT EGLApiBase : public EGLApi {
28 public:
29 // Include the auto-generated part of this class. We split this because
30 // it means we can easily edit the non-auto generated parts right here in
31 // this file instead of having to edit some template or the code generator.
32 #include "gl_bindings_api_autogen_egl.h"
34 protected:
35 EGLApiBase();
36 ~EGLApiBase() override;
37 void InitializeBase(DriverEGL* driver);
39 DriverEGL* driver_;
42 class GL_EXPORT RealEGLApi : public EGLApiBase {
43 public:
44 RealEGLApi();
45 ~RealEGLApi() override;
46 void Initialize(DriverEGL* driver);
47 void InitializeWithCommandLine(DriverEGL* driver,
48 base::CommandLine* command_line);
49 void InitializeFilteredExtensions();
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::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_