summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/gl_integration/xcomposite_egl
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wayland/gl_integration/xcomposite_egl')
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp169
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h82
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp139
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h98
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp77
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h65
-rw-r--r--src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri15
7 files changed, 645 insertions, 0 deletions
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
new file mode 100644
index 0000000000..92acf752e4
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp
@@ -0,0 +1,169 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwaylandxcompositeeglcontext.h"
+
+#include "qwaylandxcompositeeglwindow.h"
+#include "qwaylandxcompositebuffer.h"
+
+#include "wayland-xcomposite-client-protocol.h"
+#include <QtCore/QDebug>
+
+#include "qeglconvenience.h"
+#include "qxlibeglintegration.h"
+
+#include <X11/extensions/Xcomposite.h>
+
+QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(QWaylandXCompositeEGLIntegration *glxIntegration, QWaylandXCompositeEGLWindow *window)
+ : QPlatformGLContext()
+ , mEglIntegration(glxIntegration)
+ , mWindow(window)
+ , mBuffer(0)
+ , mXWindow(0)
+ , mConfig(q_configFromQPlatformWindowFormat(glxIntegration->eglDisplay(),window->widget()->platformWindowFormat(),true,EGL_WINDOW_BIT))
+ , mWaitingForSync(false)
+{
+ QVector<EGLint> eglContextAttrs;
+ eglContextAttrs.append(EGL_CONTEXT_CLIENT_VERSION); eglContextAttrs.append(2);
+ eglContextAttrs.append(EGL_NONE);
+
+ mContext = eglCreateContext(glxIntegration->eglDisplay(),mConfig,EGL_NO_CONTEXT,eglContextAttrs.constData());
+ if (mContext == EGL_NO_CONTEXT) {
+ qFatal("failed to find context");
+ }
+
+ geometryChanged();
+}
+
+void QWaylandXCompositeEGLContext::makeCurrent()
+{
+ QPlatformGLContext::makeCurrent();
+
+ eglMakeCurrent(mEglIntegration->eglDisplay(),mEglWindowSurface,mEglWindowSurface,mContext);
+}
+
+void QWaylandXCompositeEGLContext::doneCurrent()
+{
+ QPlatformGLContext::doneCurrent();
+ eglMakeCurrent(mEglIntegration->eglDisplay(),EGL_NO_SURFACE,EGL_NO_SURFACE,EGL_NO_CONTEXT);
+}
+
+void QWaylandXCompositeEGLContext::swapBuffers()
+{
+ QSize size = mWindow->geometry().size();
+
+ eglSwapBuffers(mEglIntegration->eglDisplay(),mEglWindowSurface);
+ mWindow->damage(QRegion(QRect(QPoint(0,0),size)));
+ mWindow->waitForFrameSync();
+}
+
+void * QWaylandXCompositeEGLContext::getProcAddress(const QString &procName)
+{
+ return (void *)eglGetProcAddress(qPrintable(procName));
+}
+
+QPlatformWindowFormat QWaylandXCompositeEGLContext::platformWindowFormat() const
+{
+ return qt_qPlatformWindowFormatFromConfig(mEglIntegration->eglDisplay(),mConfig);
+}
+
+void QWaylandXCompositeEGLContext::sync_function(void *data)
+{
+ QWaylandXCompositeEGLContext *that = static_cast<QWaylandXCompositeEGLContext *>(data);
+ that->mWaitingForSync = false;
+}
+
+void QWaylandXCompositeEGLContext::geometryChanged()
+{
+ QSize size(mWindow->geometry().size());
+ if (size.isEmpty()) {
+ //QGLWidget wants a context for a window without geometry
+ size = QSize(1,1);
+ }
+
+ delete mBuffer;
+ //XFreePixmap deletes the glxPixmap as well
+ if (mXWindow) {
+ XDestroyWindow(mEglIntegration->xDisplay(),mXWindow);
+ }
+
+ VisualID visualId = QXlibEglIntegration::getCompatibleVisualId(mEglIntegration->xDisplay(),mEglIntegration->eglDisplay(),mConfig);
+
+ XVisualInfo visualInfoTemplate;
+ memset(&visualInfoTemplate, 0, sizeof(XVisualInfo));
+ visualInfoTemplate.visualid = visualId;
+
+ int matchingCount = 0;
+ XVisualInfo *visualInfo = XGetVisualInfo(mEglIntegration->xDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount);
+
+ Colormap cmap = XCreateColormap(mEglIntegration->xDisplay(),mEglIntegration->rootWindow(),visualInfo->visual,AllocNone);
+
+ XSetWindowAttributes a;
+ a.colormap = cmap;
+ mXWindow = XCreateWindow(mEglIntegration->xDisplay(), mEglIntegration->rootWindow(),0, 0, size.width(), size.height(),
+ 0, visualInfo->depth, InputOutput, visualInfo->visual,
+ CWColormap, &a);
+
+ XCompositeRedirectWindow(mEglIntegration->xDisplay(), mXWindow, CompositeRedirectManual);
+ XMapWindow(mEglIntegration->xDisplay(), mXWindow);
+
+ mEglWindowSurface = eglCreateWindowSurface(mEglIntegration->eglDisplay(),mConfig,mXWindow,0);
+ if (mEglWindowSurface == EGL_NO_SURFACE) {
+ qFatal("Could not make eglsurface");
+ }
+
+ XSync(mEglIntegration->xDisplay(),False);
+ mBuffer = new QWaylandXCompositeBuffer(mEglIntegration->waylandXComposite(),
+ (uint32_t)mXWindow,
+ size,
+ mEglIntegration->waylandDisplay()->argbVisual());
+ mWindow->attach(mBuffer);
+ wl_display_sync_callback(mEglIntegration->waylandDisplay()->wl_display(),
+ QWaylandXCompositeEGLContext::sync_function,
+ this);
+
+ mWaitingForSync = true;
+ wl_display_sync(mEglIntegration->waylandDisplay()->wl_display(),0);
+ mEglIntegration->waylandDisplay()->flushRequests();
+ while (mWaitingForSync) {
+ mEglIntegration->waylandDisplay()->readEvents();
+ }
+}
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h
new file mode 100644
index 0000000000..f0693d4d81
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDXCOMPOSITEEGLCONTEXT_H
+#define QWAYLANDXCOMPOSITEEGLCONTEXT_H
+
+#include <QtGui/QPlatformGLContext>
+
+#include <QtCore/QWaitCondition>
+
+#include "qwaylandbuffer.h"
+#include "qwaylandxcompositeeglintegration.h"
+
+class QWaylandXCompositeEGLWindow;
+
+class QWaylandXCompositeEGLContext : public QPlatformGLContext
+{
+public:
+ QWaylandXCompositeEGLContext(QWaylandXCompositeEGLIntegration *glxIntegration, QWaylandXCompositeEGLWindow *window);
+
+ void makeCurrent();
+ void doneCurrent();
+ void swapBuffers();
+ void* getProcAddress(const QString& procName);
+
+ QPlatformWindowFormat platformWindowFormat() const;
+
+ void geometryChanged();
+
+private:
+ QWaylandXCompositeEGLIntegration *mEglIntegration;
+ QWaylandXCompositeEGLWindow *mWindow;
+ QWaylandBuffer *mBuffer;
+
+ Window mXWindow;
+ EGLConfig mConfig;
+ EGLContext mContext;
+ EGLSurface mEglWindowSurface;
+
+ static void sync_function(void *data);
+ bool mWaitingForSync;
+};
+
+#endif // QWAYLANDXCOMPOSITEEGLCONTEXT_H
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp
new file mode 100644
index 0000000000..95b4112cdc
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.cpp
@@ -0,0 +1,139 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwaylandxcompositeeglintegration.h"
+
+#include "qwaylandxcompositeeglwindow.h"
+
+#include <QtCore/QDebug>
+
+#include "wayland-xcomposite-client-protocol.h"
+
+QWaylandGLIntegration * QWaylandGLIntegration::createGLIntegration(QWaylandDisplay *waylandDisplay)
+{
+ return new QWaylandXCompositeEGLIntegration(waylandDisplay);
+}
+
+QWaylandXCompositeEGLIntegration::QWaylandXCompositeEGLIntegration(QWaylandDisplay * waylandDispaly)
+ : QWaylandGLIntegration()
+ , mWaylandDisplay(waylandDispaly)
+{
+ qDebug() << "Using XComposite-EGL";
+ wl_display_add_global_listener(mWaylandDisplay->wl_display(), QWaylandXCompositeEGLIntegration::wlDisplayHandleGlobal,
+ this);
+}
+
+QWaylandXCompositeEGLIntegration::~QWaylandXCompositeEGLIntegration()
+{
+ XCloseDisplay(mDisplay);
+}
+
+void QWaylandXCompositeEGLIntegration::initialize()
+{
+}
+
+QWaylandWindow * QWaylandXCompositeEGLIntegration::createEglWindow(QWidget *widget)
+{
+ return new QWaylandXCompositeEGLWindow(widget,this);
+}
+
+Display * QWaylandXCompositeEGLIntegration::xDisplay() const
+{
+ return mDisplay;
+}
+
+EGLDisplay QWaylandXCompositeEGLIntegration::eglDisplay() const
+{
+ return mEglDisplay;
+}
+
+int QWaylandXCompositeEGLIntegration::screen() const
+{
+ return mScreen;
+}
+
+Window QWaylandXCompositeEGLIntegration::rootWindow() const
+{
+ return mRootWindow;
+}
+
+QWaylandDisplay * QWaylandXCompositeEGLIntegration::waylandDisplay() const
+{
+ return mWaylandDisplay;
+}
+wl_xcomposite * QWaylandXCompositeEGLIntegration::waylandXComposite() const
+{
+ return mWaylandComposite;
+}
+
+const struct wl_xcomposite_listener QWaylandXCompositeEGLIntegration::xcomposite_listener = {
+ QWaylandXCompositeEGLIntegration::rootInformation
+};
+
+void QWaylandXCompositeEGLIntegration::wlDisplayHandleGlobal(wl_display *display, uint32_t id, const char *interface, uint32_t version, void *data)
+{
+ Q_UNUSED(version);
+ if (strcmp(interface, "xcomposite") == 0) {
+ QWaylandXCompositeEGLIntegration *integration = static_cast<QWaylandXCompositeEGLIntegration *>(data);
+ integration->mWaylandComposite = wl_xcomposite_create(display,id);
+ wl_xcomposite_add_listener(integration->mWaylandComposite,&xcomposite_listener,integration);
+ }
+
+}
+
+void QWaylandXCompositeEGLIntegration::rootInformation(void *data, wl_xcomposite *xcomposite, const char *display_name, uint32_t root_window)
+{
+ Q_UNUSED(xcomposite);
+ QWaylandXCompositeEGLIntegration *integration = static_cast<QWaylandXCompositeEGLIntegration *>(data);
+
+ integration->mDisplay = XOpenDisplay(display_name);
+ integration->mRootWindow = (Window) root_window;
+ integration->mScreen = XDefaultScreen(integration->mDisplay);
+ integration->mEglDisplay = eglGetDisplay(integration->mDisplay);
+ eglBindAPI(EGL_OPENGL_ES_API);
+ EGLint minor,major;
+ if (!eglInitialize(integration->mEglDisplay,&major,&minor)) {
+ qFatal("Failed to initialize EGL");
+ }
+ eglSwapInterval(integration->eglDisplay(),0);
+ qDebug() << "ROOT INFORMATION" << integration->mDisplay << integration->mRootWindow << integration->mScreen;
+}
+
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h
new file mode 100644
index 0000000000..590ae3754c
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglintegration.h
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDXCOMPOSITEEGLINTEGRATION_H
+#define QWAYLANDXCOMPOSITEEGLINTEGRATION_H
+
+#include "gl_integration/qwaylandglintegration.h"
+#include "wayland-client.h"
+
+#include <QtCore/QTextStream>
+#include <QtCore/QDataStream>
+#include <QtCore/QMetaType>
+#include <QtCore/QVariant>
+#include <QtGui/QWidget>
+
+#include <QWaitCondition>
+
+#include <X11/Xlib.h>
+#include <EGL/egl.h>
+
+struct wl_xcomposite;
+
+class QWaylandXCompositeEGLIntegration : public QWaylandGLIntegration
+{
+public:
+ QWaylandXCompositeEGLIntegration(QWaylandDisplay * waylandDispaly);
+ ~QWaylandXCompositeEGLIntegration();
+
+ void initialize();
+
+ QWaylandWindow *createEglWindow(QWidget *widget);
+
+ QWaylandDisplay *waylandDisplay() const;
+ struct wl_xcomposite *waylandXComposite() const;
+
+ Display *xDisplay() const;
+ EGLDisplay eglDisplay() const;
+ int screen() const;
+ Window rootWindow() const;
+
+private:
+ QWaylandDisplay *mWaylandDisplay;
+ struct wl_xcomposite *mWaylandComposite;
+
+ Display *mDisplay;
+ EGLDisplay mEglDisplay;
+ int mScreen;
+ Window mRootWindow;
+
+ static void wlDisplayHandleGlobal(struct wl_display *display, uint32_t id,
+ const char *interface, uint32_t version, void *data);
+
+ static const struct wl_xcomposite_listener xcomposite_listener;
+ static void rootInformation(void *data,
+ struct wl_xcomposite *xcomposite,
+ const char *display_name,
+ uint32_t root_window);
+};
+
+#endif // QWAYLANDXCOMPOSITEEGLINTEGRATION_H
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp
new file mode 100644
index 0000000000..1c9d36fe92
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwaylandxcompositeeglwindow.h"
+
+#include <QtCore/QDebug>
+
+QWaylandXCompositeEGLWindow::QWaylandXCompositeEGLWindow(QWidget *window, QWaylandXCompositeEGLIntegration *glxIntegration)
+ : QWaylandWindow(window)
+ , mGlxIntegration(glxIntegration)
+ , mContext(0)
+{
+
+}
+
+QWaylandWindow::WindowType QWaylandXCompositeEGLWindow::windowType() const
+{
+ //yeah. this type needs a new name
+ return QWaylandWindow::Egl;
+}
+
+QPlatformGLContext * QWaylandXCompositeEGLWindow::glContext() const
+{
+ if (!mContext) {
+ qDebug() << "creating glcontext;";
+ QWaylandXCompositeEGLWindow *that = const_cast<QWaylandXCompositeEGLWindow *>(this);
+ that->mContext = new QWaylandXCompositeEGLContext(mGlxIntegration,that);
+ }
+ return mContext;
+}
+
+void QWaylandXCompositeEGLWindow::setGeometry(const QRect &rect)
+{
+ QWaylandWindow::setGeometry(rect);
+
+ if (mContext) {
+ mContext->geometryChanged();
+ }
+}
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h
new file mode 100644
index 0000000000..fc33b32322
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglwindow.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWAYLANDXCOMPOSITEEGLWINDOW_H
+#define QWAYLANDXCOMPOSITEEGLWINDOW_H
+
+#include "qwaylandwindow.h"
+#include "qwaylandxcompositeeglintegration.h"
+#include "qwaylandxcompositeeglcontext.h"
+
+class QWaylandXCompositeEGLWindow : public QWaylandWindow
+{
+public:
+ QWaylandXCompositeEGLWindow(QWidget *window, QWaylandXCompositeEGLIntegration *glxIntegration);
+ WindowType windowType() const;
+
+ QPlatformGLContext *glContext() const;
+
+ void setGeometry(const QRect &rect);
+
+private:
+ QWaylandXCompositeEGLIntegration *mGlxIntegration;
+ QWaylandXCompositeEGLContext *mContext;
+
+};
+
+#endif // QWAYLANDXCOMPOSITEEGLWINDOW_H
diff --git a/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri
new file mode 100644
index 0000000000..c3533f9ce3
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/xcomposite_egl/xcomposite_egl.pri
@@ -0,0 +1,15 @@
+include (../xcomposite_share/xcomposite_share.pri)
+include (../../../eglconvenience/eglconvenience.pri)
+include (../../../eglconvenience/xlibeglintegration.pri)
+
+LIBS += -lXcomposite -lEGL
+
+SOURCES += \
+ $$PWD/qwaylandxcompositeeglcontext.cpp \
+ $$PWD/qwaylandxcompositeeglintegration.cpp \
+ $$PWD/qwaylandxcompositeeglwindow.cpp
+
+HEADERS += \
+ $$PWD/qwaylandxcompositeeglcontext.h \
+ $$PWD/qwaylandxcompositeeglintegration.h \
+ $$PWD/qwaylandxcompositeeglwindow.h