Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / gl / gl_glx_api_implementation.h
blob3dab151d42c7551eb2e111cd07185cb27d8e7b65
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_GLX_API_IMPLEMENTATION_H_
6 #define UI_GL_GL_GLX_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 InitializeStaticGLBindingsGLX();
23 void InitializeDebugGLBindingsGLX();
24 void ClearGLBindingsGLX();
25 bool GetGLWindowSystemBindingInfoGLX(GLWindowSystemBindingInfo* info);
27 class GL_EXPORT GLXApiBase : public GLXApi {
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_glx.h"
34 protected:
35 GLXApiBase();
36 ~GLXApiBase() override;
37 void InitializeBase(DriverGLX* driver);
39 DriverGLX* driver_;
42 class GL_EXPORT RealGLXApi : public GLXApiBase {
43 public:
44 RealGLXApi();
45 ~RealGLXApi() override;
46 void Initialize(DriverGLX* driver);
47 void InitializeWithCommandLine(DriverGLX* driver,
48 base::CommandLine* command_line);
50 const char* glXQueryExtensionsStringFn(Display* dpy, int screen) override;
51 private:
53 std::vector<std::string> disabled_exts_;
54 std::string filtered_exts_;
57 // Inserts a TRACE for every GLX call.
58 class GL_EXPORT TraceGLXApi : public GLXApi {
59 public:
60 TraceGLXApi(GLXApi* glx_api) : glx_api_(glx_api) { }
61 ~TraceGLXApi() override;
63 // Include the auto-generated part of this class. We split this because
64 // it means we can easily edit the non-auto generated parts right here in
65 // this file instead of having to edit some template or the code generator.
66 #include "gl_bindings_api_autogen_glx.h"
68 private:
69 GLXApi* glx_api_;
72 } // namespace gfx
74 #endif // UI_GL_GL_GLX_API_IMPLEMENTATION_H_