diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/platform/graphics/glx/GLContextGLX.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/platform/graphics/glx/GLContextGLX.h')
-rw-r--r-- | Source/WebCore/platform/graphics/glx/GLContextGLX.h | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/Source/WebCore/platform/graphics/glx/GLContextGLX.h b/Source/WebCore/platform/graphics/glx/GLContextGLX.h index edefc04c2..ca24024f6 100644 --- a/Source/WebCore/platform/graphics/glx/GLContextGLX.h +++ b/Source/WebCore/platform/graphics/glx/GLContextGLX.h @@ -17,58 +17,61 @@ * Boston, MA 02110-1301 USA */ -#ifndef GLContextGLX_h -#define GLContextGLX_h +#pragma once #if USE(GLX) #include "GLContext.h" +#include "XUniquePtr.h" +#include "XUniqueResource.h" -typedef struct __GLXcontextRec* GLXContext; -typedef unsigned long GLXPbuffer; -typedef unsigned long GLXPixmap; typedef unsigned char GLubyte; -typedef unsigned long Pixmap; -typedef unsigned long XID; +typedef unsigned long Window; typedef void* ContextKeyType; +typedef struct _XDisplay Display; namespace WebCore { -class GLContextGLX : public GLContext { +class GLContextGLX final : public GLContext { WTF_MAKE_NONCOPYABLE(GLContextGLX); public: - static PassOwnPtr<GLContextGLX> createContext(XID window, GLContext* sharingContext); - static PassOwnPtr<GLContextGLX> createWindowContext(XID window, GLContext* sharingContext); + static std::unique_ptr<GLContextGLX> createContext(GLNativeWindowType, PlatformDisplay&); + static std::unique_ptr<GLContextGLX> createSharingContext(PlatformDisplay&); virtual ~GLContextGLX(); - virtual bool makeContextCurrent(); - virtual void swapBuffers(); - virtual void waitNative(); - virtual bool canRenderToDefaultFramebuffer(); - virtual IntSize defaultFrameBufferSize(); - virtual cairo_device_t* cairoDevice(); -#if USE(3D_GRAPHICS) - virtual PlatformGraphicsContext3D platformContext(); +private: + bool makeContextCurrent() override; + void swapBuffers() override; + void waitNative() override; + bool canRenderToDefaultFramebuffer() override; + IntSize defaultFrameBufferSize() override; + void swapInterval(int) override; + cairo_device_t* cairoDevice() override; + bool isEGLContext() const override { return false; } + +#if ENABLE(GRAPHICS_CONTEXT_3D) + PlatformGraphicsContext3D platformContext() override; #endif -private: - static PassOwnPtr<GLContextGLX> createPbufferContext(GLXContext sharingContext); - static PassOwnPtr<GLContextGLX> createPixmapContext(GLXContext sharingContext); + GLContextGLX(PlatformDisplay&, XUniqueGLXContext&&, GLNativeWindowType); + GLContextGLX(PlatformDisplay&, XUniqueGLXContext&&, XUniqueGLXPbuffer&&); + GLContextGLX(PlatformDisplay&, XUniqueGLXContext&&, XUniquePixmap&&, XUniqueGLXPixmap&&); - GLContextGLX(GLXContext); - GLContextGLX(GLXContext, Pixmap, GLXPixmap); + static std::unique_ptr<GLContextGLX> createWindowContext(GLNativeWindowType, PlatformDisplay&, GLXContext sharingContext = nullptr); + static std::unique_ptr<GLContextGLX> createPbufferContext(PlatformDisplay&, GLXContext sharingContext = nullptr); + static std::unique_ptr<GLContextGLX> createPixmapContext(PlatformDisplay&, GLXContext sharingContext = nullptr); - GLXContext m_context; - XID m_window; - GLXPbuffer m_pbuffer; - Pixmap m_pixmap; - GLXPixmap m_glxPixmap; - cairo_device_t* m_cairoDevice; + Display* m_x11Display { nullptr }; + XUniqueGLXContext m_context; + Window m_window { 0 }; + XUniqueGLXPbuffer m_pbuffer; + XUniquePixmap m_pixmap; + XUniqueGLXPixmap m_glxPixmap; + cairo_device_t* m_cairoDevice { nullptr }; }; } // namespace WebCore #endif // USE(GLX) -#endif // GLContextGLX_h |