Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
[gecko.git] / gfx / gl / GLContextGLX.h
blob4f0328380ff13d44707ffe213d5f8e09531fbc0b
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim: set ts=8 sts=4 et sw=4 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GLCONTEXTGLX_H_
8 #define GLCONTEXTGLX_H_
10 #include "GLContext.h"
11 #include "GLXLibrary.h"
13 namespace mozilla {
14 namespace gl {
16 class GLContextGLX : public GLContext
18 public:
19 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GLContextGLX)
20 static already_AddRefed<GLContextGLX>
21 CreateGLContext(const SurfaceCaps& caps,
22 GLContextGLX* shareContext,
23 bool isOffscreen,
24 Display* display,
25 GLXDrawable drawable,
26 GLXFBConfig cfg,
27 bool deleteDrawable,
28 gfxXlibSurface* pixmap = nullptr);
30 ~GLContextGLX();
32 virtual GLContextType GetContextType() const MOZ_OVERRIDE { return GLContextType::GLX; }
34 static GLContextGLX* Cast(GLContext* gl) {
35 MOZ_ASSERT(gl->GetContextType() == GLContextType::GLX);
36 return static_cast<GLContextGLX*>(gl);
39 bool Init() MOZ_OVERRIDE;
41 virtual bool MakeCurrentImpl(bool aForce) MOZ_OVERRIDE;
43 virtual bool IsCurrent() MOZ_OVERRIDE;
45 virtual bool SetupLookupFunction() MOZ_OVERRIDE;
47 virtual bool IsDoubleBuffered() const MOZ_OVERRIDE;
49 virtual bool SupportsRobustness() const MOZ_OVERRIDE;
51 virtual bool SwapBuffers() MOZ_OVERRIDE;
53 private:
54 friend class GLContextProviderGLX;
56 GLContextGLX(const SurfaceCaps& caps,
57 GLContext* shareContext,
58 bool isOffscreen,
59 Display *aDisplay,
60 GLXDrawable aDrawable,
61 GLXContext aContext,
62 bool aDeleteDrawable,
63 bool aDoubleBuffered,
64 gfxXlibSurface *aPixmap);
66 GLXContext mContext;
67 Display *mDisplay;
68 GLXDrawable mDrawable;
69 bool mDeleteDrawable;
70 bool mDoubleBuffered;
72 GLXLibrary* mGLX;
74 nsRefPtr<gfxXlibSurface> mPixmap;
75 bool mOwnsContext;
81 #endif // GLCONTEXTGLX_H_