Get wayland plugin working after latest QPA API changes.
authorSamuel Rødal <samuel.rodal@nokia.com>
Fri, 5 Aug 2011 10:11:40 +0000 (12:11 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Fri, 5 Aug 2011 14:34:35 +0000 (16:34 +0200)
Change-Id: If54e7068aaed84fe765b887250bca79c787bd8a3
Reviewed-on: http://codereview.qt.nokia.com/2684
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
src/plugins/platforms/wayland/qwaylandintegration.cpp
src/plugins/platforms/wayland/qwaylandintegration.h

index eb4503c..eefd86d 100644 (file)
@@ -56,6 +56,7 @@
 #include <QtGui/QWindowSystemInterface>
 #include <QtGui/QPlatformCursor>
 #include <QtGui/QSurfaceFormat>
+#include <QtGui/QGuiGLContext>
 
 #ifdef QT_WAYLAND_GL_SUPPORT
 #include "gl_integration/qwaylandglintegration.h"
@@ -68,6 +69,9 @@ QWaylandIntegration::QWaylandIntegration()
 {
     QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher);
     mDisplay = new QWaylandDisplay();
+
+    foreach (QPlatformScreen *screen, mDisplay->screens())
+        screenAdded(screen);
 }
 
 QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const
@@ -75,12 +79,6 @@ QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const
     return mNativeInterface;
 }
 
-QList<QPlatformScreen *>
-QWaylandIntegration::screens() const
-{
-    return mDisplay->screens();
-}
-
 bool QWaylandIntegration::hasCapability(QPlatformIntegration::Capability cap) const
 {
     switch (cap) {
@@ -104,10 +102,10 @@ QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) cons
     return new QWaylandShmWindow(window);
 }
 
-QPlatformGLContext *QWaylandIntegration::createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const
+QPlatformGLContext *QWaylandIntegration::createPlatformGLContext(QGuiGLContext *context) const
 {
 #ifdef QT_WAYLAND_GL_SUPPORT
-    return mDisplay->eglIntegration()->createPlatformGLContext(glFormat, share);
+    return mDisplay->eglIntegration()->createPlatformGLContext(context->format(), context->shareHandle());
 #else
     Q_UNUSED(glFormat);
     Q_UNUSED(share);
index 209d5da..69b8863 100644 (file)
@@ -57,13 +57,11 @@ public:
 
     bool hasCapability(QPlatformIntegration::Capability cap) const;
     QPlatformWindow *createPlatformWindow(QWindow *window) const;
-    QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const;
+    QPlatformGLContext *createPlatformGLContext(QGuiGLContext *context) const;
     QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const;
 
     QAbstractEventDispatcher *guiThreadEventDispatcher() const;
 
-    QList<QPlatformScreen *> screens() const;
-
     QPlatformFontDatabase *fontDatabase() const;
 
     QPlatformNativeInterface *nativeInterface() const;