summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/gl_integration/wayland_egl
diff options
context:
space:
mode:
authorQt by Nokia <qt-info@nokia.com>2011-04-27 12:05:43 +0200
committeraxis <qt-info@nokia.com>2011-04-27 12:05:43 +0200
commit38be0d13830efd2d98281c645c3a60afe05ffece (patch)
tree6ea73f3ec77f7d153333779883e8120f82820abe /src/plugins/platforms/wayland/gl_integration/wayland_egl
Initial import from the monolithic Qt.
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
Diffstat (limited to 'src/plugins/platforms/wayland/gl_integration/wayland_egl')
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglinclude.h57
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp95
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h73
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp112
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h71
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp126
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h80
-rw-r--r--src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri12
8 files changed, 626 insertions, 0 deletions
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglinclude.h b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglinclude.h
new file mode 100644
index 0000000000..5dc2addd10
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglinclude.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** 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 QWAYLANDEGLINCLUDE_H
+#define QWAYLANDEGLINCLUDE_H
+
+#include <wayland-client.h>
+
+#include <wayland-egl.h>
+
+#define GL_GLEXT_PROTOTYPES
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#define EGL_EGLEXT_PROTOTYPES
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#endif // QWAYLANDEGLINCLUDE_H
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp
new file mode 100644
index 0000000000..39e7be5ac6
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.cpp
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** 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 "qwaylandeglintegration.h"
+
+#include "gl_integration/qwaylandglintegration.h"
+
+#include "qwaylandeglwindow.h"
+
+#include <QtCore/QDebug>
+
+QWaylandEglIntegration::QWaylandEglIntegration(struct wl_display *waylandDisplay)
+ : mWaylandDisplay(waylandDisplay)
+ , mNativeEglDisplay(wl_egl_display_create(mWaylandDisplay))
+{
+ qDebug() << "Using Wayland-EGL";
+}
+
+
+QWaylandEglIntegration::~QWaylandEglIntegration()
+{
+ eglTerminate(mEglDisplay);
+}
+
+void QWaylandEglIntegration::initialize()
+{
+ EGLint major,minor;
+ mEglDisplay = eglGetDisplay((EGLNativeDisplayType)mNativeEglDisplay);
+ if (mEglDisplay == NULL) {
+ qWarning("EGL not available");
+ } else {
+ if (!eglInitialize(mEglDisplay, &major, &minor)) {
+ qWarning("failed to initialize EGL display");
+ return;
+ }
+ }
+}
+
+QWaylandWindow *QWaylandEglIntegration::createEglWindow(QWidget *window)
+{
+ return new QWaylandEglWindow(window);
+}
+
+EGLDisplay QWaylandEglIntegration::eglDisplay() const
+{
+ return mEglDisplay;
+}
+
+wl_egl_display * QWaylandEglIntegration::nativeDisplay() const
+{
+ return mNativeEglDisplay;
+}
+
+QWaylandGLIntegration *QWaylandGLIntegration::createGLIntegration(QWaylandDisplay *waylandDisplay)
+{
+ return new QWaylandEglIntegration(waylandDisplay->wl_display());
+}
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h
new file mode 100644
index 0000000000..bf4c3fe45c
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglintegration.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** 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 QWAYLANDEGLINTEGRATION_H
+#define QWAYLANDEGLINTEGRATION_H
+
+#include "gl_integration/qwaylandglintegration.h"
+
+#include "qwaylandeglinclude.h"
+
+class QWaylandWindow;
+class QWidget;
+
+class QWaylandEglIntegration : public QWaylandGLIntegration
+{
+public:
+ QWaylandEglIntegration(struct wl_display *waylandDisplay);
+ ~QWaylandEglIntegration();
+
+ void initialize();
+
+ QWaylandWindow *createEglWindow(QWidget *window);
+
+ EGLDisplay eglDisplay() const;
+ struct wl_egl_display *nativeDisplay() const;
+private:
+ struct wl_display *mWaylandDisplay;
+
+ EGLDisplay mEglDisplay;
+ struct wl_egl_display *mNativeEglDisplay;
+
+
+};
+
+#endif // QWAYLANDEGLINTEGRATION_H
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp
new file mode 100644
index 0000000000..d7cf0a55e1
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.cpp
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** 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 "qwaylandeglwindow.h"
+
+#include "qwaylandscreen.h"
+#include "qwaylandglcontext.h"
+
+QWaylandEglWindow::QWaylandEglWindow(QWidget *window)
+ : QWaylandWindow(window)
+ , mGLContext(0)
+ , mWaylandEglWindow(0)
+{
+ mEglIntegration = static_cast<QWaylandEglIntegration *>(mDisplay->eglIntegration());
+ //super creates a new surface
+ newSurfaceCreated();
+}
+
+QWaylandEglWindow::~QWaylandEglWindow()
+{
+ delete mGLContext;
+}
+
+QWaylandWindow::WindowType QWaylandEglWindow::windowType() const
+{
+ return QWaylandWindow::Egl;
+}
+
+void QWaylandEglWindow::setGeometry(const QRect &rect)
+{
+ QWaylandWindow::setGeometry(rect);
+ if (mWaylandEglWindow) {
+ wl_egl_window_resize(mWaylandEglWindow,rect.width(),rect.height(),0,0);
+ }
+}
+
+void QWaylandEglWindow::setParent(const QPlatformWindow *parent)
+{
+ const QWaylandWindow *wParent = static_cast<const QWaylandWindow *>(parent);
+
+ mParentWindow = wParent;
+}
+
+QPlatformGLContext * QWaylandEglWindow::glContext() const
+{
+ if (!mGLContext) {
+ QWaylandEglWindow *that = const_cast<QWaylandEglWindow *>(this);
+ that->mGLContext = new QWaylandGLContext(mEglIntegration->eglDisplay(),widget()->platformWindowFormat());
+
+ EGLNativeWindowType window(reinterpret_cast<EGLNativeWindowType>(mWaylandEglWindow));
+ EGLSurface surface = eglCreateWindowSurface(mEglIntegration->eglDisplay(),mGLContext->eglConfig(),window,NULL);
+ that->mGLContext->setEglSurface(surface);
+ }
+
+ return mGLContext;
+}
+
+void QWaylandEglWindow::newSurfaceCreated()
+{
+ if (mWaylandEglWindow) {
+ wl_egl_window_destroy(mWaylandEglWindow);
+ }
+ wl_visual *visual = QWaylandScreen::waylandScreenFromWidget(widget())->visual();
+ QSize size = geometry().size();
+ if (!size.isValid())
+ size = QSize(0,0);
+
+ mWaylandEglWindow = wl_egl_window_create(mEglIntegration->nativeDisplay(),mSurface,size.width(),size.height(),visual);
+ if (mGLContext) {
+ EGLNativeWindowType window(reinterpret_cast<EGLNativeWindowType>(mWaylandEglWindow));
+ EGLSurface surface = eglCreateWindowSurface(mEglIntegration->eglDisplay(),mGLContext->eglConfig(),window,NULL);
+ mGLContext->setEglSurface(surface);
+ }
+}
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h
new file mode 100644
index 0000000000..549d039bf8
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandeglwindow.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** 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 QWAYLANDEGLWINDOW_H
+#define QWAYLANDEGLWINDOW_H
+
+#include "qwaylandwindow.h"
+#include "qwaylandeglinclude.h"
+#include "qwaylandeglintegration.h"
+
+class QWaylandGLContext;
+
+class QWaylandEglWindow : public QWaylandWindow
+{
+public:
+ QWaylandEglWindow(QWidget *window);
+ ~QWaylandEglWindow();
+ WindowType windowType() const;
+ void setGeometry(const QRect &rect);
+ void setParent(const QPlatformWindow *parent);
+ QPlatformGLContext *glContext() const;
+protected:
+ void newSurfaceCreated();
+private:
+ QWaylandEglIntegration *mEglIntegration;
+ QWaylandGLContext *mGLContext;
+ struct wl_egl_window *mWaylandEglWindow;
+ EGLConfig mConfig;
+
+ const QWaylandWindow *mParentWindow;
+};
+
+#endif // QWAYLANDEGLWINDOW_H
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
new file mode 100644
index 0000000000..d293019909
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.cpp
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** 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 "qwaylandglcontext.h"
+
+#include "qwaylanddisplay.h"
+#include "qwaylandwindow.h"
+
+#include "../../../eglconvenience/qeglconvenience.h"
+
+#include <QtGui/QPlatformGLContext>
+#include <QtGui/QPlatformWindowFormat>
+#include <QtCore/QMutex>
+
+QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, const QPlatformWindowFormat &format)
+ : QPlatformGLContext()
+ , mEglDisplay(eglDisplay)
+ , mSurface(EGL_NO_SURFACE)
+ , mConfig(q_configFromQPlatformWindowFormat(mEglDisplay,format,true))
+ , mFormat(qt_qPlatformWindowFormatFromConfig(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);
+
+ QVector<EGLint> eglContextAttrs;
+ eglContextAttrs.append(EGL_CONTEXT_CLIENT_VERSION);
+ eglContextAttrs.append(2);
+ eglContextAttrs.append(EGL_NONE);
+
+ mContext = eglCreateContext(mEglDisplay, mConfig,
+ shareEGLContext, eglContextAttrs.constData());
+}
+
+QWaylandGLContext::QWaylandGLContext()
+ : QPlatformGLContext()
+ , mEglDisplay(0)
+ , mContext(EGL_NO_CONTEXT)
+ , mSurface(EGL_NO_SURFACE)
+ , mConfig(0)
+{ }
+
+QWaylandGLContext::~QWaylandGLContext()
+{
+ eglDestroyContext(mEglDisplay,mContext);
+}
+
+void QWaylandGLContext::makeCurrent()
+{
+ QPlatformGLContext::makeCurrent();
+ if (mSurface == EGL_NO_SURFACE) {
+ qWarning("makeCurrent with EGL_NO_SURFACE");
+ }
+ eglMakeCurrent(mEglDisplay, mSurface, mSurface, mContext);
+}
+
+void QWaylandGLContext::doneCurrent()
+{
+ QPlatformGLContext::doneCurrent();
+ eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+}
+
+void QWaylandGLContext::swapBuffers()
+{
+ eglSwapBuffers(mEglDisplay,mSurface);
+}
+
+void *QWaylandGLContext::getProcAddress(const QString &string)
+{
+ return (void *) eglGetProcAddress(string.toLatin1().data());
+}
+
+void QWaylandGLContext::setEglSurface(EGLSurface surface)
+{
+ doneCurrent();
+ mSurface = surface;
+}
+
+EGLConfig QWaylandGLContext::eglConfig() const
+{
+ return mConfig;
+}
+
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h
new file mode 100644
index 0000000000..76caffabfb
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/qwaylandglcontext.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** 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 QWAYLANDGLCONTEXT_H
+#define QWAYLANDGLCONTEXT_H
+
+#include "qwaylanddisplay.h"
+
+#include <QtGui/QPlatformGLContext>
+
+#include "qwaylandeglinclude.h"
+
+class QWaylandWindow;
+class QWaylandGLWindowSurface;
+
+class QWaylandGLContext : public QPlatformGLContext {
+public:
+ QWaylandGLContext(EGLDisplay eglDisplay, const QPlatformWindowFormat &format);
+ ~QWaylandGLContext();
+ void makeCurrent();
+ void doneCurrent();
+ void swapBuffers();
+ void* getProcAddress(const QString&);
+
+ QPlatformWindowFormat platformWindowFormat() const { return mFormat; }
+
+ void setEglSurface(EGLSurface surface);
+ EGLConfig eglConfig() const;
+private:
+ EGLDisplay mEglDisplay;
+
+ EGLContext mContext;
+ EGLSurface mSurface;
+ EGLConfig mConfig;
+ QPlatformWindowFormat mFormat;
+
+ QWaylandGLContext();
+
+};
+
+
+#endif // QWAYLANDGLCONTEXT_H
diff --git a/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri b/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri
new file mode 100644
index 0000000000..bc978645c4
--- /dev/null
+++ b/src/plugins/platforms/wayland/gl_integration/wayland_egl/wayland_egl.pri
@@ -0,0 +1,12 @@
+LIBS += -lwayland-egl -lEGL
+INCLUDEPATH += $$PWD
+SOURCES += $$PWD/qwaylandeglintegration.cpp \
+ $$PWD/qwaylandglcontext.cpp \
+ $$PWD/qwaylandeglwindow.cpp \
+ $$PWD/../../../eglconvenience/qeglconvenience.cpp
+
+HEADERS += $$PWD/qwaylandeglintegration.h \
+ $$PWD/qwaylandglcontext.h \
+ $$PWD/qwaylandeglwindow.h \
+ $$PWD/../../../eglconvenience/qeglconvenience.h \
+ gl_integration/wayland_egl/qwaylandeglinclude.h