From d0beb0d95b63c230e965cf151a39ac6e7b779ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Tue, 31 May 2011 15:47:02 +0200 Subject: Fix the egl path for xcb and wayland plugins MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Samuel Rødal --- src/plugins/platforms/eglconvenience/qeglconvenience.cpp | 2 +- src/plugins/platforms/eglconvenience/qeglconvenience.h | 2 +- .../readback_egl/qwaylandreadbackeglcontext.cpp | 10 ++++++---- .../gl_integration/readback_egl/qwaylandreadbackeglcontext.h | 2 +- .../readback_egl/qwaylandreadbackeglintegration.cpp | 2 +- .../readback_egl/qwaylandreadbackeglintegration.h | 2 ++ .../wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp | 6 ++++-- .../wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp | 11 +++-------- .../wayland/gl_integration/wayland_egl/qwaylandglcontext.h | 6 +++--- .../xcomposite_egl/qwaylandxcompositeeglcontext.cpp | 5 +++-- .../xcomposite_egl/qwaylandxcompositeeglcontext.h | 4 +--- src/plugins/platforms/xcb/qxcbwindow.cpp | 4 ++-- 12 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp index fdfc19b0c1..333425632c 100644 --- a/src/plugins/platforms/eglconvenience/qeglconvenience.cpp +++ b/src/plugins/platforms/eglconvenience/qeglconvenience.cpp @@ -195,7 +195,7 @@ bool q_reduceConfigAttributes(QVector *configAttributes) return false; } -EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QWindowFormat &format, bool highestPixelFormat, int surfaceType) +EGLConfig q_configFromQWindowFormat(EGLDisplay display, const QWindowFormat &format, bool highestPixelFormat, int surfaceType) { EGLConfig cfg = 0; QVector configureAttributes = q_createConfigAttributesFromFormat(format); diff --git a/src/plugins/platforms/eglconvenience/qeglconvenience.h b/src/plugins/platforms/eglconvenience/qeglconvenience.h index dc15de8153..978cab4925 100644 --- a/src/plugins/platforms/eglconvenience/qeglconvenience.h +++ b/src/plugins/platforms/eglconvenience/qeglconvenience.h @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE QVector q_createConfigAttributesFromFormat(const QWindowFormat &format); bool q_reduceConfigAttributes(QVector *configAttributes); -EGLConfig q_configFromQPlatformWindowFormat(EGLDisplay display, const QWindowFormat &format, bool highestPixelFormat = false, int surfaceType = EGL_WINDOW_BIT); +EGLConfig q_configFromQWindowFormat(EGLDisplay display, const QWindowFormat &format, bool highestPixelFormat = false, int surfaceType = EGL_WINDOW_BIT); QWindowFormat q_windowFormatFromConfig(EGLDisplay display, const EGLConfig config); bool q_hasEglExtension(EGLDisplay display,const char* extensionName); diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp index a3a86880f9..8769752d5f 100644 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp +++ b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.cpp @@ -43,12 +43,14 @@ #include "../../../eglconvenience/qeglconvenience.h" +#include +#include + #include #include #include "qwaylandshmsurface.h" -#include static inline void qgl_byteSwapImage(QImage &img, GLenum pixel_type) { @@ -77,7 +79,7 @@ QWaylandReadbackEglContext::QWaylandReadbackEglContext(QWaylandReadbackEglIntegr , mWindow(window) , mBuffer(0) , mPixmap(0) - , mConfig(q_configFromQPlatformWindowFormat(eglIntegration->eglDisplay(),window->widget()->platformWindowFormat(),true,EGL_PIXMAP_BIT)) + , mConfig(q_configFromQWindowFormat(eglIntegration->eglDisplay(),window->window()->requestedWindowFormat(),true,EGL_PIXMAP_BIT)) , mPixmapSurface(EGL_NO_SURFACE) { QVector eglContextAttrs; @@ -112,7 +114,7 @@ void QWaylandReadbackEglContext::swapBuffers() { eglSwapBuffers(mEglIntegration->eglDisplay(),mPixmapSurface); - if (QWindowContext::currentContext().handle() != this) { + if (QWindowContext::currentContext()->handle() != this) { makeCurrent(); } @@ -141,7 +143,7 @@ void * QWaylandReadbackEglContext::getProcAddress(const QString &procName) return (void *) eglGetProcAddress(procName.toLatin1().data()); } -QPlatformWindowFormat QWaylandReadbackEglContext::platformWindowFormat() const +QWindowFormat QWaylandReadbackEglContext::windowFormat() const { return q_windowFormatFromConfig(mEglIntegration->eglDisplay(),mConfig); } diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h index 4a71ef08a7..f57ac46667 100644 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h +++ b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglcontext.h @@ -60,7 +60,7 @@ public: void swapBuffers(); void* getProcAddress(const QString& procName); - virtual QPlatformWindowFormat platformWindowFormat() const; + virtual QWindowFormat windowFormat() const; void geometryChanged(); diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp index b77671317d..50a1170f79 100644 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp +++ b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.cpp @@ -83,7 +83,7 @@ void QWaylandReadbackEglIntegration::initialize() QWaylandWindow * QWaylandReadbackEglIntegration::createEglWindow(QWindow *window) { - return new QWaylandReadbackEglWindow(widget,this); + return new QWaylandReadbackEglWindow(window,this); } EGLDisplay QWaylandReadbackEglIntegration::eglDisplay() diff --git a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h index 20e1636b7e..649f96e9cc 100644 --- a/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h +++ b/src/plugins/platforms/wayland/gl_integration/readback_egl/qwaylandreadbackeglintegration.h @@ -48,6 +48,8 @@ #include #include #include +#include +#include #include diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp index 90d4aa59a9..4a085ae0bd 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp +++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp @@ -44,6 +44,8 @@ #include "qwaylandscreen.h" #include "qwaylandglcontext.h" +#include + QWaylandEglWindow::QWaylandEglWindow(QWindow *window) : QWaylandWindow(window) , mGLContext(0) @@ -83,7 +85,7 @@ QPlatformGLContext * QWaylandEglWindow::glContext() const { if (!mGLContext) { QWaylandEglWindow *that = const_cast(this); - that->mGLContext = new QWaylandGLContext(mEglIntegration->eglDisplay(),widget()->platformWindowFormat()); + that->mGLContext = new QWaylandGLContext(mEglIntegration->eglDisplay(),this->window()->requestedWindowFormat()); EGLNativeWindowType window(reinterpret_cast(mWaylandEglWindow)); EGLSurface surface = eglCreateWindowSurface(mEglIntegration->eglDisplay(),mGLContext->eglConfig(),window,NULL); @@ -98,7 +100,7 @@ void QWaylandEglWindow::newSurfaceCreated() if (mWaylandEglWindow) { wl_egl_window_destroy(mWaylandEglWindow); } - wl_visual *visual = QWaylandScreen::waylandScreenFromWidget(widget())->visual(); + wl_visual *visual = QWaylandScreen::waylandScreenFromWindow(window())->visual(); QSize size = geometry().size(); if (!size.isValid()) size = QSize(0,0); diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp index 172722d85c..0cff704ab1 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp +++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp @@ -47,22 +47,17 @@ #include "../../../eglconvenience/qeglconvenience.h" #include -#include +#include #include -QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, const QPlatformWindowFormat &format) +QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, const QWindowFormat &format) : QPlatformGLContext() , mEglDisplay(eglDisplay) , mSurface(EGL_NO_SURFACE) - , mConfig(q_configFromQPlatformWindowFormat(mEglDisplay,format,true)) + , mConfig(q_configFromQWindowFormat(mEglDisplay,format,true)) , mFormat(q_windowFormatFromConfig(mEglDisplay,mConfig)) { - QPlatformGLContext *sharePlatformContext = 0; - sharePlatformContext = format.sharedGLContext(); - mFormat.setSharedContext(sharePlatformContext); EGLContext shareEGLContext = EGL_NO_CONTEXT; - if (sharePlatformContext) - shareEGLContext = static_cast(sharePlatformContext)->mContext; eglBindAPI(EGL_OPENGL_ES_API); diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h index 2c6feb498c..47070f54b1 100644 --- a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h +++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h @@ -53,14 +53,14 @@ class QWaylandGLWindowSurface; class QWaylandGLContext : public QPlatformGLContext { public: - QWaylandGLContext(EGLDisplay eglDisplay, const QPlatformWindowFormat &format); + QWaylandGLContext(EGLDisplay eglDisplay, const QWindowFormat &format); ~QWaylandGLContext(); void makeCurrent(); void doneCurrent(); void swapBuffers(); void* getProcAddress(const QString&); - QPlatformWindowFormat platformWindowFormat() const { return mFormat; } + QWindowFormat windowFormat() const { return mFormat; } void setEglSurface(EGLSurface surface); EGLConfig eglConfig() const; @@ -70,7 +70,7 @@ private: EGLContext mContext; EGLSurface mSurface; EGLConfig mConfig; - QPlatformWindowFormat mFormat; + QWindowFormat mFormat; QWaylandGLContext(); diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp index 7cdd2b8c5e..e61ee69d37 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp @@ -46,6 +46,7 @@ #include "wayland-xcomposite-client-protocol.h" #include +#include #include "qeglconvenience.h" #include "qxlibeglintegration.h" @@ -58,7 +59,7 @@ QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(QWaylandXCompositeEGL , mWindow(window) , mBuffer(0) , mXWindow(0) - , mConfig(q_configFromQPlatformWindowFormat(glxIntegration->eglDisplay(),window->widget()->platformWindowFormat(),true,EGL_WINDOW_BIT)) + , mConfig(q_configFromQWindowFormat(glxIntegration->eglDisplay(),window->window()->requestedWindowFormat(),true,EGL_WINDOW_BIT)) , mWaitingForSync(false) { QVector eglContextAttrs; @@ -98,7 +99,7 @@ void * QWaylandXCompositeEGLContext::getProcAddress(const QString &procName) return (void *)eglGetProcAddress(qPrintable(procName)); } -QPlatformWindowFormat QWaylandXCompositeEGLContext::platformWindowFormat() const +QWindowFormat QWaylandXCompositeEGLContext::windowFormat() const { return q_windowFormatFromConfig(mEglIntegration->eglDisplay(),mConfig); } diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h index 9d9dd53e0b..528faf07c5 100644 --- a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h +++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h @@ -44,8 +44,6 @@ #include -#include - #include "qwaylandbuffer.h" #include "qwaylandxcompositeeglintegration.h" @@ -61,7 +59,7 @@ public: void swapBuffers(); void* getProcAddress(const QString& procName); - QPlatformWindowFormat platformWindowFormat() const; + QWindowFormat windowFormat() const; void geometryChanged(); diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index e17c87fa85..afcec8e139 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -150,7 +150,7 @@ void QXcbWindow::create() XVisualInfo *visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(m_screen),m_screen->screenNumber(), window()->requestedWindowFormat()); #elif defined(XCB_USE_EGL) EGLDisplay eglDisplay = connection()->egl_display(); - EGLConfig eglConfig = q_configFromQPlatformWindowFormat(eglDisplay,window()->requestedWindowFormat(),true); + EGLConfig eglConfig = q_configFromQWindowFormat(eglDisplay,window()->requestedWindowFormat(),true); VisualID id = QXlibEglIntegration::getCompatibleVisualId(DISPLAY_FROM_XCB(this), eglDisplay, eglConfig); XVisualInfo visualInfoTemplate; @@ -890,7 +890,7 @@ QPlatformGLContext *QXcbWindow::glContext() const that->m_context = new QGLXContext(m_window, m_screen, window()->requestedWindowFormat()); #elif defined(XCB_USE_EGL) EGLDisplay display = connection()->egl_display(); - EGLConfig config = q_configFromQPlatformWindowFormat(display,window()->requestedWindowFormat(),true); + EGLConfig config = q_configFromQWindowFormat(display,window()->requestedWindowFormat(),true); QVector eglContextAttrs; eglContextAttrs.append(EGL_CONTEXT_CLIENT_VERSION); eglContextAttrs.append(2); -- cgit v1.2.3