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 --- .../wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp | 6 ++++-- .../wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp | 11 +++-------- .../wayland/gl_integration/wayland_egl/qwaylandglcontext.h | 6 +++--- 3 files changed, 10 insertions(+), 13 deletions(-) (limited to 'src/plugins/platforms/wayland/gl_integration/wayland_egl') 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(); -- cgit v1.2.3