diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-21 13:39:26 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-21 14:02:22 +0200 |
commit | 176f30b13739b352cbe453cba7796d9a9c808bcd (patch) | |
tree | 8fa60b6ae4ef06455652863a0406bc5e86a22303 /src/plugins/platforms/xcb/qxcbintegration.cpp | |
parent | 272daebaa07b21e372ad4274fafb51ce0be92396 (diff) |
OpenGL API refactor.
Rename QGuiGLFormat to QSurfaceFormat, and make QWindow sub-class of
QSurface and QPlatformWindow sub-class of QPlatformSurface, instead of
having QPlatformGLSurface accessor in QWindow.
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 72d0036a3c..d5f7c70ad2 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -66,6 +66,7 @@ #if defined(XCB_USE_GLX) #include "qglxintegration.h" #elif defined(XCB_USE_EGL) +#include "qxcbeglsurface.h" #include <QtPlatformSupport/private/qeglplatformcontext_p.h> #endif @@ -103,12 +104,28 @@ QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const return new QXcbWindow(window); } -QPlatformGLContext *QXcbIntegration::createPlatformGLContext(const QGuiGLFormat &glFormat, QPlatformGLContext *share) const +#if defined(XCB_USE_EGL) +class QEGLXcbPlatformContext : public QEGLPlatformContext +{ +public: + QEGLXcbPlatformContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share, EGLDisplay display) + : QEGLPlatformContext(glFormat, share, display) + { + } + + EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) + { + return static_cast<QXcbWindow *>(surface)->eglSurface()->surface(); + } +}; +#endif + +QPlatformGLContext *QXcbIntegration::createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const { #if defined(XCB_USE_GLX) return new QGLXContext(static_cast<QXcbScreen *>(m_screens.at(0)), glFormat, share); #elif defined(XCB_USE_EGL) - return new QEGLPlatformContext(glFormat, share, m_connection->egl_display()); + return new QEGLXcbPlatformContext(glFormat, share, m_connection->egl_display()); #elif defined(XCB_USE_DRI2) return new QDri2Context(glFormat, share); #endif |