summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/gl_integration/wayland_egl
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-05-31 15:47:02 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2011-05-31 15:57:03 +0200
commitd0beb0d95b63c230e965cf151a39ac6e7b779ae9 (patch)
tree4dc437b0c75684e9ea6a22277953f3ba5ca661d2 /src/plugins/platforms/wayland/gl_integration/wayland_egl
parent9bd270f64d2eb481130663c4035f4097857c89c3 (diff)
Fix the egl path for xcb and wayland plugins
Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/plugins/platforms/wayland/gl_integration/wayland_egl')
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp6
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp11
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h6
3 files changed, 10 insertions, 13 deletions
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 <QtGui/QWindow>
+
QWaylandEglWindow::QWaylandEglWindow(QWindow *window)
: QWaylandWindow(window)
, mGLContext(0)
@@ -83,7 +85,7 @@ QPlatformGLContext * QWaylandEglWindow::glContext() const
{
if (!mGLContext) {
QWaylandEglWindow *that = const_cast<QWaylandEglWindow *>(this);
- that->mGLContext = new QWaylandGLContext(mEglIntegration->eglDisplay(),widget()->platformWindowFormat());
+ that->mGLContext = new QWaylandGLContext(mEglIntegration->eglDisplay(),this->window()->requestedWindowFormat());
EGLNativeWindowType window(reinterpret_cast<EGLNativeWindowType>(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 <QtGui/QPlatformGLContext>
-#include <QtGui/QPlatformWindowFormat>
+#include <QtGui/QWindowFormat>
#include <QtCore/QMutex>
-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<const QWaylandGLContext*>(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();