gfx/gl/GLContextGLX.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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
    17 {
    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);
    37     }
    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;
    76 };
    78 }
    79 }
    81 #endif // GLCONTEXTGLX_H_

mercurial