summaryrefslogtreecommitdiffstats
path: root/src/hardwareintegration/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/hardwareintegration/client')
-rw-r--r--src/hardwareintegration/client/CMakeLists.txt6
-rw-r--r--src/hardwareintegration/client/brcm-egl/brcm-egl.pri3
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp45
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h49
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp55
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h45
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp44
-rw-r--r--src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h43
-rw-r--r--src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.cpp46
-rw-r--r--src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.h41
-rw-r--r--src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp46
-rw-r--r--src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.h43
-rw-r--r--src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp40
-rw-r--r--src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h48
-rw-r--r--src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp44
-rw-r--r--src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h40
-rw-r--r--src/hardwareintegration/client/vulkan-server/vulkan-server.pri12
-rw-r--r--src/hardwareintegration/client/vulkan-server/vulkanserverbufferintegration.cpp177
-rw-r--r--src/hardwareintegration/client/vulkan-server/vulkanserverbufferintegration.h66
-rw-r--r--src/hardwareintegration/client/wayland-egl/CMakeLists.txt34
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp80
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h85
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration_p.h60
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandegldisplay.h62
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h51
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglinclude_p.h27
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp100
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h98
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h70
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp503
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h104
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext_p.h72
-rw-r--r--src/hardwareintegration/client/wayland-egl/wayland-egl.pri12
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp152
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h117
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp78
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h70
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp134
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h80
-rw-r--r--src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri16
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp114
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h80
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp138
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h110
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp121
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h81
-rw-r--r--src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri16
-rw-r--r--src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp65
-rw-r--r--src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h69
-rw-r--r--src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri11
50 files changed, 805 insertions, 2898 deletions
diff --git a/src/hardwareintegration/client/CMakeLists.txt b/src/hardwareintegration/client/CMakeLists.txt
new file mode 100644
index 000000000..f63592c84
--- /dev/null
+++ b/src/hardwareintegration/client/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+if(QT_FEATURE_wayland_egl)
+ add_subdirectory(wayland-egl)
+endif()
diff --git a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri
index f9f8d0726..e58b2cf85 100644
--- a/src/hardwareintegration/client/brcm-egl/brcm-egl.pri
+++ b/src/hardwareintegration/client/brcm-egl/brcm-egl.pri
@@ -1,7 +1,6 @@
INCLUDEPATH += $$PWD
QMAKE_USE += egl wayland-client libdl
-QT += egl_support-private
SOURCES += $$PWD/qwaylandbrcmeglintegration.cpp \
$$PWD/qwaylandbrcmglcontext.cpp \
@@ -11,5 +10,5 @@ HEADERS += $$PWD/qwaylandbrcmeglintegration.h \
$$PWD/qwaylandbrcmglcontext.h \
$$PWD/qwaylandbrcmeglwindow.h
-CONFIG += wayland-scanner
+CONFIG += wayland-scanner-client-wayland-protocol-include
WAYLANDCLIENTSOURCES += $$PWD/../../../extensions/brcm.xml
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp
index cd0f285cd..8f9047993 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwaylandbrcmeglintegration.h"
@@ -57,7 +21,7 @@ QWaylandBrcmEglIntegration::QWaylandBrcmEglIntegration()
qDebug() << "Using Brcm-EGL";
}
-void QWaylandBrcmEglIntegration::wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version)
+void QWaylandBrcmEglIntegration::wlDisplayHandleGlobal(void *data, struct ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version)
{
Q_UNUSED(version);
if (interface == "qt_brcm") {
@@ -78,6 +42,7 @@ QWaylandBrcmEglIntegration::~QWaylandBrcmEglIntegration()
void QWaylandBrcmEglIntegration::initialize(QWaylandDisplay *waylandDisplay)
{
+ m_display = waylandDisplay;
m_waylandDisplay = waylandDisplay->wl_display();
waylandDisplay->addRegistryListener(wlDisplayHandleGlobal, this);
EGLint major,minor;
@@ -111,7 +76,7 @@ void QWaylandBrcmEglIntegration::initialize(QWaylandDisplay *waylandDisplay)
QWaylandWindow *QWaylandBrcmEglIntegration::createEglWindow(QWindow *window)
{
- return new QWaylandBrcmEglWindow(window);
+ return new QWaylandBrcmEglWindow(window, m_display);
}
QPlatformOpenGLContext *QWaylandBrcmEglIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h
index 5e8a3bf46..ac164ab9d 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglintegration.h
@@ -1,47 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWAYLANDBRCMEGLINTEGRATION_H
#define QWAYLANDBRCMEGLINTEGRATION_H
#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
-#include <wayland-client.h>
+#include <QtWaylandClient/private/wayland-wayland-client-protocol.h>
+#include <wayland-client-core.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
@@ -86,12 +51,14 @@ public:
void *nativeResourceForContext(NativeResource resource, QPlatformOpenGLContext *context) override;
private:
- static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version);
+ static void wlDisplayHandleGlobal(void *data, struct ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version);
struct wl_display *m_waylandDisplay = nullptr;
struct qt_brcm *m_waylandBrcm = nullptr;
- EGLDisplay m_eglDisplay;
+ EGLDisplay m_eglDisplay = EGL_NO_DISPLAY;
+
+ QWaylandDisplay *m_display = nullptr;
};
}
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
index 5cd52f676..117e57807 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwaylandbrcmeglwindow.h"
@@ -43,14 +7,13 @@
#include <QtWaylandClient/private/qwaylandscreen_p.h>
#include "qwaylandbrcmglcontext.h"
-#include <QtEglSupport/private/qeglconvenience_p.h>
+#include <QtGui/private/qeglconvenience_p.h>
#include <QtGui/QWindow>
#include <qpa/qwindowsysteminterface.h>
#include <EGL/eglext_brcm.h>
-#include <wayland-client.h>
#include "wayland-brcm-client-protocol.h"
QT_BEGIN_NAMESPACE
@@ -125,8 +88,8 @@ private:
struct wl_event_queue *m_eventQueue = nullptr;
};
-QWaylandBrcmEglWindow::QWaylandBrcmEglWindow(QWindow *window)
- : QWaylandWindow(window)
+QWaylandBrcmEglWindow::QWaylandBrcmEglWindow(QWindow *window, QWaylandDisplay *display)
+ : QWaylandWindow(window, display)
, m_eglIntegration(static_cast<QWaylandBrcmEglIntegration *>(mDisplay->clientBufferIntegration()))
, m_format(window->format())
, m_eventQueue(wl_display_create_queue(mDisplay->wl_display()))
@@ -186,14 +149,14 @@ void QWaylandBrcmEglWindow::createEglSurfaces()
m_count = window()->format().swapBehavior() == QSurfaceFormat::TripleBuffer ? 3 : 2;
- m_eglConfig = q_configFromGLFormat(m_eglIntegration->eglDisplay(), brcmFixFormat(window()->format()), true, EGL_PIXMAP_BIT);
+ EGLConfig eglConfig = q_configFromGLFormat(m_eglIntegration->eglDisplay(), brcmFixFormat(window()->format()), true, EGL_PIXMAP_BIT);
- m_format = q_glFormatFromConfig(m_eglIntegration->eglDisplay(), m_eglConfig);
+ m_format = q_glFormatFromConfig(m_eglIntegration->eglDisplay(), eglConfig);
EGLint pixel_format = EGL_PIXEL_FORMAT_ARGB_8888_BRCM;
EGLint rt;
- eglGetConfigAttrib(m_eglIntegration->eglDisplay(), m_eglConfig, EGL_RENDERABLE_TYPE, &rt);
+ eglGetConfigAttrib(m_eglIntegration->eglDisplay(), eglConfig, EGL_RENDERABLE_TYPE, &rt);
if (rt & EGL_OPENGL_ES_BIT) {
pixel_format |= EGL_PIXEL_FORMAT_RENDER_GLES_BRCM;
@@ -229,7 +192,7 @@ void QWaylandBrcmEglWindow::createEglSurfaces()
EGL_NONE
};
- m_eglSurfaces[i] = eglCreatePixmapSurface(m_eglIntegration->eglDisplay(), m_eglConfig, (EGLNativePixmapType)&m_globalImages[5*i], attrs);
+ m_eglSurfaces[i] = eglCreatePixmapSurface(m_eglIntegration->eglDisplay(), eglConfig, (EGLNativePixmapType)&m_globalImages[5*i], attrs);
if (m_eglSurfaces[i] == EGL_NO_SURFACE)
qFatal("eglCreatePixmapSurface failed: %x, global image id: %d %d\n", eglGetError(), m_globalImages[5*i], m_globalImages[5*i+1]);
m_buffers[i] = new QWaylandBrcmBuffer(mDisplay, m_eglIntegration->waylandBrcm(), size, &m_globalImages[5*i], 5, m_eventQueue);
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h
index 2d418ecac..3b9026f9c 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWAYLANDBRCMEGLWINDOW_H
#define QWAYLANDBRCMEGLWINDOW_H
@@ -51,14 +15,13 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
-class QWaylandGLContext;
class QWaylandBrcmBuffer;
class QWaylandBrcmEglWindow : public QWaylandWindow
{
Q_OBJECT
public:
- QWaylandBrcmEglWindow(QWindow *window);
+ QWaylandBrcmEglWindow(QWindow *window, QWaylandDisplay *display);
~QWaylandBrcmEglWindow();
WindowType windowType() const override;
void setGeometry(const QRect &rect) override;
@@ -77,8 +40,6 @@ private:
const QWaylandWindow *m_parentWindow = nullptr;
- EGLConfig m_eglConfig = 0;
-
EGLint m_globalImages[3*5];
EGLSurface m_eglSurfaces[3];
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp
index 5c585746c..66135a7cc 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qwaylandbrcmglcontext.h"
@@ -43,7 +7,7 @@
#include <QtWaylandClient/private/qwaylandwindow_p.h>
#include "qwaylandbrcmeglwindow.h"
-#include <QtEglSupport/private/qeglconvenience_p.h>
+#include <QtGui/private/qeglconvenience_p.h>
#include <qpa/qplatformopenglcontext.h>
#include <QtGui/QSurfaceFormat>
@@ -66,7 +30,7 @@ QWaylandBrcmGLContext::QWaylandBrcmGLContext(EGLDisplay eglDisplay, const QSurfa
eglBindAPI(EGL_OPENGL_ES_API);
- QVector<EGLint> eglContextAttrs;
+ QList<EGLint> eglContextAttrs;
eglContextAttrs.append(EGL_CONTEXT_CLIENT_VERSION);
eglContextAttrs.append(format.majorVersion() == 1 ? 1 : 2);
eglContextAttrs.append(EGL_NONE);
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h
index d27333576..e64a20d9b 100644
--- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h
+++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QWAYLANDBRCMGLCONTEXT_H
#define QWAYLANDBRCMGLCONTEXT_H
@@ -51,7 +15,6 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
class QWaylandWindow;
-class QWaylandGLWindowSurface;
class QWaylandBrcmGLContext : public QPlatformOpenGLContext {
public:
@@ -71,7 +34,7 @@ public:
EGLContext eglContext() const { return m_context; }
private:
- EGLDisplay m_eglDisplay;
+ EGLDisplay m_eglDisplay = EGL_NO_DISPLAY;
EGLContext m_context;
EGLConfig m_config;
diff --git a/src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.cpp b/src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.cpp
index 9f840414e..54df2badd 100644
--- a/src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.cpp
+++ b/src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.cpp
@@ -1,47 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "dmabufserverbufferintegration.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QDebug>
+#include <QtOpenGL/QOpenGLTexture>
#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLTexture>
#include <EGL/egl.h>
#include <EGL/eglext.h>
@@ -83,7 +47,7 @@ DmaBufServerBuffer::DmaBufServerBuffer(DmaBufServerBufferIntegration *integratio
int err = eglGetError();
qCDebug(lcQpaWayland) << "imported egl image" << m_image;
if (m_image == EGL_NO_IMAGE_KHR || err != EGL_SUCCESS)
- qCWarning(lcQpaWayland) << "DmaBufServerBuffer error importing image. EGL error code" << hex << err;
+ qCWarning(lcQpaWayland) << "DmaBufServerBuffer error importing image. EGL error code" << Qt::hex << err;
qt_server_buffer_set_user_data(id, this);
@@ -93,7 +57,7 @@ DmaBufServerBuffer::~DmaBufServerBuffer()
{
int err = m_integration->eglDestroyImageKHR(m_image);
if (err != EGL_SUCCESS)
- qCWarning(lcQpaWayland) << "~DmaBufServerBuffer error destroying image" << m_image << "error code " << hex << err;
+ qCWarning(lcQpaWayland) << "~DmaBufServerBuffer error destroying image" << m_image << "error code " << Qt::hex << err;
qt_server_buffer_release(m_server_buffer);
qt_server_buffer_destroy(m_server_buffer);
}
diff --git a/src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.h b/src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.h
index f38c2e151..13dbdfbfb 100644
--- a/src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.h
+++ b/src/hardwareintegration/client/dmabuf-server/dmabufserverbufferintegration.h
@@ -1,45 +1,10 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DMABUFSERVERBUFFERINTEGRATION_H
#define DMABUFSERVERBUFFERINTEGRATION_H
+#include <QtCore/QVariant>
#include <QtWaylandClient/private/qwayland-wayland.h>
#include "qwayland-qt-dmabuf-server-buffer.h"
#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
diff --git a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp
index 754196468..16a3aa4cf 100644
--- a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp
+++ b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.cpp
@@ -1,47 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "drmeglserverbufferintegration.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QDebug>
+#include <QtOpenGL/QOpenGLTexture>
#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLTexture>
#include <EGL/egl.h>
@@ -125,7 +89,11 @@ void DrmEglServerBufferIntegration::initializeEgl()
return;
m_egl_initialized = true;
+#if QT_CONFIG(egl_extension_platform_wayland)
+ m_egl_display = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, m_display->wl_display(), nullptr);
+#else
m_egl_display = eglGetDisplay((EGLNativeDisplayType) m_display->wl_display());
+#endif
if (m_egl_display == EGL_NO_DISPLAY) {
qWarning("Failed to initialize drm egl server buffer integration. Could not get egl display from wl_display.");
return;
diff --git a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.h b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.h
index 2c65969f8..a06bc96b8 100644
--- a/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.h
+++ b/src/hardwareintegration/client/drm-egl-server/drmeglserverbufferintegration.h
@@ -1,46 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef DRMEGLSERVERBUFFERINTEGRATION_H
#define DRMEGLSERVERBUFFERINTEGRATION_H
#include <QtWaylandClient/private/qwayland-wayland.h>
+#include <QtCore/QVariant>
#include "qwayland-drm-egl-server-buffer.h"
#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
@@ -101,7 +66,7 @@ private:
PFNEGLDESTROYIMAGEKHRPROC m_egl_destroy_image;
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC m_gl_egl_image_target_texture;
QWaylandDisplay *m_display = nullptr;
- EGLDisplay m_egl_display;
+ EGLDisplay m_egl_display = EGL_NO_DISPLAY;
bool m_egl_initialized = false;
};
diff --git a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp
index 252ceb698..54081de97 100644
--- a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp
+++ b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "libhybriseglserverbufferintegration.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
diff --git a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h
index 0bfbe0ea4..7fd4a2abb 100644
--- a/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h
+++ b/src/hardwareintegration/client/libhybris-egl-server/libhybriseglserverbufferintegration.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 Jolla Ltd, author: <giulio.camuffo@jollamobile.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef LIBHYBRISEGLSERVERBUFFERINTEGRATION_H
#define LIBHYBRISEGLSERVERBUFFERINTEGRATION_H
@@ -44,8 +8,8 @@
#include "qwayland-libhybris-egl-server-buffer.h"
#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
+#include <QtCore/QList>
#include <QtCore/QTextStream>
-#include <QtCore/QVector>
#include <EGL/egl.h>
#include <EGL/eglext.h>
@@ -85,8 +49,8 @@ private:
EGLImageKHR m_image;
QOpenGLTexture *m_texture = nullptr;
int m_numFds;
- QVector<int32_t> m_ints;
- QVector<int32_t> m_fds;
+ QList<int32_t> m_ints;
+ QList<int32_t> m_fds;
int32_t m_stride;
int32_t m_hybrisFormat;
};
@@ -118,7 +82,7 @@ private:
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC m_gl_egl_image_target_texture;
PFNEGLHYBRISCREATEREMOTEBUFFERPROC m_egl_create_buffer;
QWaylandDisplay *m_display = nullptr;
- EGLDisplay m_egl_display;
+ EGLDisplay m_egl_display = EGL_NO_DISPLAY;
bool m_egl_initialized = false;
};
diff --git a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp
index 73ff9e6e8..38065dbde 100644
--- a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp
+++ b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.cpp
@@ -1,47 +1,11 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "shmserverbufferintegration.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QDebug>
+#include <QtOpenGL/QOpenGLTexture>
#include <QtGui/QOpenGLContext>
-#include <QtGui/QOpenGLTexture>
#include <QtGui/QImage>
#include <QtCore/QSharedMemory>
@@ -49,7 +13,7 @@ QT_BEGIN_NAMESPACE
static QOpenGLTexture *createTextureFromShm(const QString &key, int w, int h, int bpl, int format)
{
- QSharedMemory shm(key);
+ QT_IGNORE_DEPRECATIONS(QSharedMemory shm(key);)
bool ok;
ok = shm.attach(QSharedMemory::ReadOnly);
if (!ok) {
diff --git a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h
index b162d6924..344046ae1 100644
--- a/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h
+++ b/src/hardwareintegration/client/shm-emulation-server/shmserverbufferintegration.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2017 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef SHMSERVERBUFFERINTEGRATION_H
#define SHMSERVERBUFFERINTEGRATION_H
diff --git a/src/hardwareintegration/client/vulkan-server/vulkan-server.pri b/src/hardwareintegration/client/vulkan-server/vulkan-server.pri
new file mode 100644
index 000000000..2e13a87b7
--- /dev/null
+++ b/src/hardwareintegration/client/vulkan-server/vulkan-server.pri
@@ -0,0 +1,12 @@
+INCLUDEPATH += $$PWD
+
+QMAKE_USE += wayland-client
+
+SOURCES += \
+ $$PWD/vulkanserverbufferintegration.cpp
+
+HEADERS += \
+ $$PWD/vulkanserverbufferintegration.h
+
+CONFIG += wayland-scanner
+WAYLANDCLIENTSOURCES += $$PWD/../../../extensions/qt-vulkan-server-buffer-unstable-v1.xml
diff --git a/src/hardwareintegration/client/vulkan-server/vulkanserverbufferintegration.cpp b/src/hardwareintegration/client/vulkan-server/vulkanserverbufferintegration.cpp
new file mode 100644
index 000000000..8f1ff9a46
--- /dev/null
+++ b/src/hardwareintegration/client/vulkan-server/vulkanserverbufferintegration.cpp
@@ -0,0 +1,177 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "vulkanserverbufferintegration.h"
+#include <QtWaylandClient/private/qwaylanddisplay_p.h>
+#include <QDebug>
+#include <QtOpenGL/QOpenGLTexture>
+#include <QtGui/QOpenGLContext>
+#include <QtGui/qopengl.h>
+#include <QtGui/QImage>
+#include <QtCore/QCoreApplication>
+
+QT_BEGIN_NAMESPACE
+
+namespace QtWaylandClient {
+
+static constexpr bool sbiExtraDebug =
+#ifdef VULKAN_SERVER_BUFFER_EXTRA_DEBUG
+ true;
+#else
+ false;
+#endif
+
+#define DECL_GL_FUNCTION(name, type) \
+ type name
+
+#define FIND_GL_FUNCTION(name, type) \
+ do { \
+ name = reinterpret_cast<type>(glContext->getProcAddress(#name)); \
+ if (!name) { \
+ qWarning() << "ERROR in GL proc lookup. Could not find " #name; \
+ return false; \
+ } \
+ } while (0)
+
+struct VulkanServerBufferGlFunctions
+{
+ DECL_GL_FUNCTION(glCreateMemoryObjectsEXT, PFNGLCREATEMEMORYOBJECTSEXTPROC);
+ DECL_GL_FUNCTION(glImportMemoryFdEXT, PFNGLIMPORTMEMORYFDEXTPROC);
+ DECL_GL_FUNCTION(glTextureStorageMem2DEXT, PFNGLTEXTURESTORAGEMEM2DEXTPROC);
+ DECL_GL_FUNCTION(glTexStorageMem2DEXT, PFNGLTEXSTORAGEMEM2DEXTPROC);
+ DECL_GL_FUNCTION(glDeleteMemoryObjectsEXT, PFNGLDELETEMEMORYOBJECTSEXTPROC);
+
+ bool init(QOpenGLContext *glContext)
+ {
+ FIND_GL_FUNCTION(glCreateMemoryObjectsEXT, PFNGLCREATEMEMORYOBJECTSEXTPROC);
+ FIND_GL_FUNCTION(glImportMemoryFdEXT, PFNGLIMPORTMEMORYFDEXTPROC);
+ FIND_GL_FUNCTION(glTextureStorageMem2DEXT, PFNGLTEXTURESTORAGEMEM2DEXTPROC);
+ FIND_GL_FUNCTION(glTexStorageMem2DEXT, PFNGLTEXSTORAGEMEM2DEXTPROC);
+ FIND_GL_FUNCTION(glDeleteMemoryObjectsEXT, PFNGLDELETEMEMORYOBJECTSEXTPROC);
+
+ return true;
+ }
+ static bool create(QOpenGLContext *glContext);
+};
+
+static VulkanServerBufferGlFunctions *funcs = nullptr;
+
+bool VulkanServerBufferGlFunctions::create(QOpenGLContext *glContext)
+{
+ if (funcs)
+ return true;
+ funcs = new VulkanServerBufferGlFunctions;
+ if (!funcs->init(glContext)) {
+ delete funcs;
+ funcs = nullptr;
+ return false;
+ }
+ return true;
+}
+
+VulkanServerBuffer::VulkanServerBuffer(VulkanServerBufferIntegration *integration, struct ::qt_server_buffer *id,
+ int32_t fd, uint32_t width, uint32_t height, uint32_t memory_size, uint32_t format)
+ : m_integration(integration)
+ , m_server_buffer(id)
+ , m_fd(fd)
+ , m_memorySize(memory_size)
+ , m_internalFormat(format)
+{
+ m_size = QSize(width, height);
+}
+
+VulkanServerBuffer::~VulkanServerBuffer()
+{
+ if (QCoreApplication::closingDown())
+ return; // can't trust anything at this point
+
+ if (m_texture) { //only do gl cleanup if import has been called
+ m_integration->deleteGLTextureWhenPossible(m_texture);
+
+ if (sbiExtraDebug) qDebug() << "glDeleteMemoryObjectsEXT" << m_memoryObject;
+ funcs->glDeleteMemoryObjectsEXT(1, &m_memoryObject);
+ }
+ qt_server_buffer_release(m_server_buffer);
+ qt_server_buffer_destroy(m_server_buffer);
+}
+
+void VulkanServerBuffer::import()
+{
+ if (m_texture)
+ return;
+
+ if (sbiExtraDebug) qDebug() << "importing" << m_fd << Qt::hex << glGetError();
+
+ auto *glContext = QOpenGLContext::currentContext();
+ if (!glContext)
+ return;
+
+ if (!funcs && !VulkanServerBufferGlFunctions::create(glContext))
+ return;
+
+ funcs->glCreateMemoryObjectsEXT(1, &m_memoryObject);
+ if (sbiExtraDebug) qDebug() << "glCreateMemoryObjectsEXT" << Qt::hex << glGetError();
+ funcs->glImportMemoryFdEXT(m_memoryObject, m_memorySize, GL_HANDLE_TYPE_OPAQUE_FD_EXT, m_fd);
+ if (sbiExtraDebug) qDebug() << "glImportMemoryFdEXT" << Qt::hex << glGetError();
+
+
+ m_texture = new QOpenGLTexture(QOpenGLTexture::Target2D);
+ m_texture->create();
+
+ if (sbiExtraDebug) qDebug() << "created texture" << m_texture->textureId() << Qt::hex << glGetError();
+
+ m_texture->bind();
+ if (sbiExtraDebug) qDebug() << "bound texture" << Qt::hex << glGetError();
+ funcs->glTexStorageMem2DEXT(GL_TEXTURE_2D, 1, m_internalFormat, m_size.width(), m_size.height(), m_memoryObject, 0 );
+ if (sbiExtraDebug) qDebug() << "glTexStorageMem2DEXT" << Qt::hex << glGetError();
+ if (sbiExtraDebug) qDebug() << "format" << Qt::hex << m_internalFormat << GL_RGBA8;
+}
+
+QOpenGLTexture *VulkanServerBuffer::toOpenGlTexture()
+{
+ m_integration->deleteOrphanedTextures();
+ if (!m_texture)
+ import();
+ return m_texture;
+}
+
+void VulkanServerBufferIntegration::initialize(QWaylandDisplay *display)
+{
+ m_display = display;
+ display->addRegistryListener(&wlDisplayHandleGlobal, this);
+}
+
+QWaylandServerBuffer *VulkanServerBufferIntegration::serverBuffer(struct qt_server_buffer *buffer)
+{
+ return static_cast<QWaylandServerBuffer *>(qt_server_buffer_get_user_data(buffer));
+}
+
+void VulkanServerBufferIntegration::wlDisplayHandleGlobal(void *data, ::wl_registry *registry, uint32_t id, const QString &interface, uint32_t version)
+{
+ Q_UNUSED(version);
+ if (interface == "zqt_vulkan_server_buffer_v1") {
+ auto *integration = static_cast<VulkanServerBufferIntegration *>(data);
+ integration->QtWayland::zqt_vulkan_server_buffer_v1::init(registry, id, 1);
+ }
+}
+
+void VulkanServerBufferIntegration::zqt_vulkan_server_buffer_v1_server_buffer_created(qt_server_buffer *id, int32_t fd, uint32_t width, uint32_t height, uint32_t memory_size, uint32_t format)
+{
+ if (sbiExtraDebug) qDebug() << "vulkan_server_buffer_server_buffer_created" << fd;
+ auto *server_buffer = new VulkanServerBuffer(this, id, fd, width, height, memory_size, format);
+ qt_server_buffer_set_user_data(id, server_buffer);
+}
+
+void VulkanServerBufferIntegration::deleteOrphanedTextures()
+{
+ if (!QOpenGLContext::currentContext()) {
+ qWarning("VulkanServerBufferIntegration::deleteOrphanedTextures with no current context!");
+ return;
+ }
+ qDeleteAll(orphanedTextures);
+ orphanedTextures.clear();
+}
+
+}
+
+QT_END_NAMESPACE
diff --git a/src/hardwareintegration/client/vulkan-server/vulkanserverbufferintegration.h b/src/hardwareintegration/client/vulkan-server/vulkanserverbufferintegration.h
new file mode 100644
index 000000000..2f0867a81
--- /dev/null
+++ b/src/hardwareintegration/client/vulkan-server/vulkanserverbufferintegration.h
@@ -0,0 +1,66 @@
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef VULKANSERVERBUFFERINTEGRATION_H
+#define VULKANSERVERBUFFERINTEGRATION_H
+
+#include <QtWaylandClient/private/qwayland-wayland.h>
+#include "qwayland-qt-vulkan-server-buffer-unstable-v1.h"
+#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
+
+#include "vulkanserverbufferintegration.h"
+#include <QtWaylandClient/private/qwaylanddisplay_p.h>
+#include <QtCore/QTextStream>
+
+QT_BEGIN_NAMESPACE
+
+namespace QtWaylandClient {
+
+class VulkanServerBufferIntegration;
+
+class VulkanServerBuffer : public QWaylandServerBuffer
+{
+public:
+ VulkanServerBuffer(VulkanServerBufferIntegration *integration, struct ::qt_server_buffer *id, int32_t fd, uint32_t width, uint32_t height, uint32_t memory_size, uint32_t format);
+ ~VulkanServerBuffer() override;
+ QOpenGLTexture* toOpenGlTexture() override;
+
+private:
+ void import();
+
+ VulkanServerBufferIntegration *m_integration = nullptr;
+ struct ::qt_server_buffer *m_server_buffer = nullptr;
+ QOpenGLTexture *m_texture = nullptr;
+ int m_fd = -1;
+ uint m_memorySize = 0;
+ uint m_internalFormat = 0;
+ GLuint m_memoryObject = 0;
+};
+
+class VulkanServerBufferIntegration
+ : public QWaylandServerBufferIntegration
+ , public QtWayland::zqt_vulkan_server_buffer_v1
+{
+public:
+ void initialize(QWaylandDisplay *display) override;
+
+ QWaylandServerBuffer *serverBuffer(struct qt_server_buffer *buffer) override;
+
+ void deleteGLTextureWhenPossible(QOpenGLTexture *texture) { orphanedTextures << texture; }
+ void deleteOrphanedTextures();
+
+protected:
+ void zqt_vulkan_server_buffer_v1_server_buffer_created(qt_server_buffer *id, int32_t fd, uint32_t width, uint32_t height, uint32_t memory_size, uint32_t format) override;
+
+private:
+ static void wlDisplayHandleGlobal(void *data, struct ::wl_registry *registry, uint32_t id,
+ const QString &interface, uint32_t version);
+ QWaylandDisplay *m_display = nullptr;
+ QList<QOpenGLTexture *> orphanedTextures;
+};
+
+}
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/hardwareintegration/client/wayland-egl/CMakeLists.txt b/src/hardwareintegration/client/wayland-egl/CMakeLists.txt
new file mode 100644
index 000000000..967dd3cab
--- /dev/null
+++ b/src/hardwareintegration/client/wayland-egl/CMakeLists.txt
@@ -0,0 +1,34 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+# Generated from wayland-egl.pro.
+
+#####################################################################
+## WaylandEglClientHwIntegrationPrivate Module:
+#####################################################################
+qt_find_package(EGL) # special case
+
+qt_internal_add_module(WaylandEglClientHwIntegrationPrivate
+ CONFIG_MODULE_NAME wayland_egl_client_hw_integration
+ INTERNAL_MODULE
+ SOURCES
+ qwaylandeglclientbufferintegration.cpp qwaylandeglclientbufferintegration_p.h
+ qwaylandeglinclude_p.h
+ qwaylandeglwindow.cpp qwaylandeglwindow_p.h
+ qwaylandglcontext.cpp qwaylandglcontext_p.h
+ INCLUDE_DIRECTORIES
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC_LIBRARIES
+ ${CMAKE_DL_LIBS}
+ EGL::EGL
+ Qt::Core
+ Qt::Gui
+ Qt::OpenGLPrivate
+ Qt::WaylandClientPrivate
+ Wayland::Client
+ Wayland::Egl
+ NO_GENERATE_CPP_EXPORTS
+)
+
+#### Keys ignored in scope 1:.:.:wayland-egl.pro:<TRUE>:
+# MODULE = "wayland_egl_client_hw_integration"
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp
index 4b3a635c7..3b97aef20 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.cpp
@@ -1,48 +1,12 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandeglclientbufferintegration.h"
-
-#include "qwaylandeglwindow.h"
-#include "qwaylandglcontext.h"
-
-#include <wayland-client.h>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwaylandeglclientbufferintegration_p.h"
+
+#include "qwaylandeglwindow_p.h"
+#include "qwaylandglcontext_p.h"
+
+#include <wayland-client-core.h>
#include <QtCore/QDebug>
#include <private/qeglconvenience_p.h>
@@ -65,7 +29,7 @@ static const char *qwaylandegl_threadedgl_blacklist_vendor[] = {
QWaylandEglClientBufferIntegration::QWaylandEglClientBufferIntegration()
{
- qDebug() << "Using Wayland-EGL";
+ qCDebug(lcQpaWayland) << "Using Wayland-EGL";
}
@@ -76,6 +40,9 @@ QWaylandEglClientBufferIntegration::~QWaylandEglClientBufferIntegration()
void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay *display)
{
+#if QT_CONFIG(egl_extension_platform_wayland)
+ m_eglDisplay = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, display->wl_display(), nullptr);
+#else
if (q_hasEglExtension(EGL_NO_DISPLAY, "EGL_EXT_platform_base")) {
if (q_hasEglExtension(EGL_NO_DISPLAY, "EGL_KHR_platform_wayland") ||
q_hasEglExtension(EGL_NO_DISPLAY, "EGL_EXT_platform_wayland") ||
@@ -87,7 +54,7 @@ void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay *display)
m_eglDisplay = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, display->wl_display(), nullptr);
} else {
- qWarning("The EGL implementation does not support the Wayland platform");
+ qCWarning(lcQpaWayland) << "The EGL implementation does not support the Wayland platform";
return;
}
} else {
@@ -98,17 +65,18 @@ void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay *display)
m_eglDisplay = eglGetDisplay((EGLNativeDisplayType) display->wl_display());
}
+#endif
m_display = display;
if (m_eglDisplay == EGL_NO_DISPLAY) {
- qWarning("EGL not available");
+ qCWarning(lcQpaWayland) << "EGL not available";
return;
}
EGLint major,minor;
if (!eglInitialize(m_eglDisplay, &major, &minor)) {
- qWarning("failed to initialize EGL display");
+ qCWarning(lcQpaWayland) << "Failed to initialize EGL display" << Qt::hex << eglGetError();
m_eglDisplay = EGL_NO_DISPLAY;
return;
}
@@ -124,6 +92,13 @@ void QWaylandEglClientBufferIntegration::initialize(QWaylandDisplay *display)
break;
}
}
+
+ // On desktop NVIDIA resizing QtQuick freezes them when using threaded rendering QTBUG-95817
+ // In order to support threaded rendering on embedded platforms where resizing is not needed
+ // we check if XDG_CURRENT_DESKTOP is set which desktop environments should set
+ if (qstrcmp(vendor, "NVIDIA") == 0 && qEnvironmentVariableIsSet("XDG_CURRENT_DESKTOP")) {
+ m_supportsThreading = false;
+ }
}
bool QWaylandEglClientBufferIntegration::isValid() const
@@ -143,12 +118,15 @@ bool QWaylandEglClientBufferIntegration::supportsWindowDecoration() const
QWaylandWindow *QWaylandEglClientBufferIntegration::createEglWindow(QWindow *window)
{
- return new QWaylandEglWindow(window);
+ return new QWaylandEglWindow(window, m_display);
}
QPlatformOpenGLContext *QWaylandEglClientBufferIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const
{
- return new QWaylandGLContext(m_eglDisplay, m_display, glFormat, share);
+ QSurfaceFormat fmt = glFormat;
+ if (m_display->supportsWindowDecoration())
+ fmt.setAlphaBufferSize(8);
+ return new QWaylandGLContext(m_eglDisplay, m_display, fmt, share);
}
void *QWaylandEglClientBufferIntegration::nativeResource(NativeResource resource)
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h
deleted file mode 100644
index 0c5326230..000000000
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDEGLINTEGRATION_H
-#define QWAYLANDEGLINTEGRATION_H
-
-#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
-
-#include "qwaylandeglinclude.h"
-
-QT_BEGIN_NAMESPACE
-
-class QWindow;
-
-namespace QtWaylandClient {
-
-class QWaylandWindow;
-
-class QWaylandEglClientBufferIntegration : public QWaylandClientBufferIntegration
-{
-public:
- QWaylandEglClientBufferIntegration();
- ~QWaylandEglClientBufferIntegration() override;
-
- void initialize(QWaylandDisplay *display) override;
- bool isValid() const override;
- bool supportsThreadedOpenGL() const override;
- bool supportsWindowDecoration() const override;
-
- QWaylandWindow *createEglWindow(QWindow *window) override;
- QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const override;
-
- void *nativeResource(NativeResource resource) override;
- void *nativeResourceForContext(NativeResource resource, QPlatformOpenGLContext *context) override;
-
- EGLDisplay eglDisplay() const;
-
-private:
- QWaylandDisplay *m_display = nullptr;
-
- EGLDisplay m_eglDisplay = EGL_NO_DISPLAY;
- bool m_supportsThreading = false;
-};
-
-QT_END_NAMESPACE
-
-}
-
-#endif // QWAYLANDEGLINTEGRATION_H
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration_p.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration_p.h
new file mode 100644
index 000000000..ed8fdec2d
--- /dev/null
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglclientbufferintegration_p.h
@@ -0,0 +1,60 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QWAYLANDEGLINTEGRATION_H
+#define QWAYLANDEGLINTEGRATION_H
+
+#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
+
+#include "qwaylandeglinclude_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QWindow;
+
+namespace QtWaylandClient {
+
+class QWaylandWindow;
+
+class Q_WAYLANDCLIENT_EXPORT QWaylandEglClientBufferIntegration : public QWaylandClientBufferIntegration
+{
+public:
+ QWaylandEglClientBufferIntegration();
+ ~QWaylandEglClientBufferIntegration() override;
+
+ void initialize(QWaylandDisplay *display) override;
+ bool isValid() const override;
+ bool supportsThreadedOpenGL() const override;
+ bool supportsWindowDecoration() const override;
+
+ QWaylandWindow *createEglWindow(QWindow *window) override;
+ QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const override;
+
+ void *nativeResource(NativeResource resource) override;
+ void *nativeResourceForContext(NativeResource resource, QPlatformOpenGLContext *context) override;
+
+ EGLDisplay eglDisplay() const;
+
+private:
+ QWaylandDisplay *m_display = nullptr;
+
+ EGLDisplay m_eglDisplay = EGL_NO_DISPLAY;
+ bool m_supportsThreading = false;
+};
+
+QT_END_NAMESPACE
+
+}
+
+#endif // QWAYLANDEGLINTEGRATION_H
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandegldisplay.h b/src/hardwareintegration/client/wayland-egl/qwaylandegldisplay.h
deleted file mode 100644
index ac0d96791..000000000
--- a/src/hardwareintegration/client/wayland-egl/qwaylandegldisplay.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDEGLWINDOW_H
-#define QWAYLANDEGLWINDOW_H
-
-#include <QtWaylandClient/qwaylanddisplay.h>
-
-#include "qwaylandeglintegration.h"
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-class QWaylandEglDisplay : public QWaylandDisplay
-{
-public:
-
- QWaylandEglDisplay()
- : QWaylandDisplay()
- { }
-};
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h
deleted file mode 100644
index 233ce78bd..000000000
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDEGLINCLUDE_H
-#define QWAYLANDEGLINCLUDE_H
-
-#include <string.h>
-#include <wayland-client.h>
-
-#include <wayland-egl.h>
-
-#define EGL_EGLEXT_PROTOTYPES
-#include <QtEglSupport/private/qt_egl_p.h>
-
-#endif // QWAYLANDEGLINCLUDE_H
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude_p.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude_p.h
new file mode 100644
index 000000000..eb52ce8ee
--- /dev/null
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglinclude_p.h
@@ -0,0 +1,27 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QWAYLANDEGLINCLUDE_H
+#define QWAYLANDEGLINCLUDE_H
+
+#include <string.h>
+#include <wayland-client-core.h>
+
+#include <wayland-egl.h>
+
+#define EGL_EGLEXT_PROTOTYPES
+#include <QtGui/private/qt_egl_p.h>
+
+#endif // QWAYLANDEGLINCLUDE_H
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
index 24dadff4d..0b014cd5c 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -1,48 +1,13 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandeglwindow.h"
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwaylandeglwindow_p.h"
#include <QtWaylandClient/private/qwaylandscreen_p.h>
-#include "qwaylandglcontext.h"
+#include <QtWaylandClient/private/qwaylandsurface_p.h>
+#include "qwaylandglcontext_p.h"
-#include <QtEglSupport/private/qeglconvenience_p.h>
+#include <QtGui/private/qeglconvenience_p.h>
#include <QDebug>
#include <QtGui/QWindow>
@@ -54,20 +19,15 @@ QT_BEGIN_NAMESPACE
namespace QtWaylandClient {
-QWaylandEglWindow::QWaylandEglWindow(QWindow *window)
- : QWaylandWindow(window)
+QWaylandEglWindow::QWaylandEglWindow(QWindow *window, QWaylandDisplay *display)
+ : QWaylandWindow(window, display)
, m_clientBufferIntegration(static_cast<QWaylandEglClientBufferIntegration *>(mDisplay->clientBufferIntegration()))
+ , m_format(window->requestedFormat())
{
- QSurfaceFormat fmt = window->requestedFormat();
- if (mDisplay->supportsWindowDecoration())
- fmt.setAlphaBufferSize(8);
- m_eglConfig = q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), fmt);
- m_format = q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(), m_eglConfig, fmt);
-
- // Do not create anything from here. This platform window may belong to a
- // RasterGLSurface window which may have pure raster content. In this case, where the
- // window is never actually made current, creating a wl_egl_window and EGL surface
- // should be avoided.
+ connect(display, &QWaylandDisplay::connected, this, [this] {
+ m_clientBufferIntegration = static_cast<QWaylandEglClientBufferIntegration *>(
+ mDisplay->clientBufferIntegration());
+ });
}
QWaylandEglWindow::~QWaylandEglWindow()
@@ -105,7 +65,7 @@ void QWaylandEglWindow::setGeometry(const QRect &rect)
void QWaylandEglWindow::updateSurface(bool create)
{
- QMargins margins = frameMargins();
+ QMargins margins = clientSideMargins();
QRect rect = geometry();
QSize sizeWithMargins = (rect.size() + QSize(margins.left() + margins.right(), margins.top() + margins.bottom())) * scale();
@@ -124,6 +84,7 @@ void QWaylandEglWindow::updateSurface(bool create)
}
mOffset = QPoint();
} else {
+ QReadLocker locker(&mSurfaceLock);
if (m_waylandEglWindow) {
int current_width, current_height;
static bool disableResizeCheck = qgetenv("QT_WAYLAND_DISABLE_RESIZECHECK").toInt();
@@ -131,20 +92,26 @@ void QWaylandEglWindow::updateSurface(bool create)
if (!disableResizeCheck) {
wl_egl_window_get_attached_size(m_waylandEglWindow, &current_width, &current_height);
}
- if (disableResizeCheck || (current_width != sizeWithMargins.width() || current_height != sizeWithMargins.height())) {
+ if (disableResizeCheck || (current_width != sizeWithMargins.width() || current_height != sizeWithMargins.height()) || m_requestedSize != sizeWithMargins) {
wl_egl_window_resize(m_waylandEglWindow, sizeWithMargins.width(), sizeWithMargins.height(), mOffset.x(), mOffset.y());
+ m_requestedSize = sizeWithMargins;
mOffset = QPoint();
m_resize = true;
}
- } else if (create && wl_surface::isInitialized()) {
- ::wl_surface *wlSurface = wl_surface::object();
- m_waylandEglWindow = wl_egl_window_create(wlSurface, sizeWithMargins.width(), sizeWithMargins.height());
+ } else if (create && mSurface) {
+ m_waylandEglWindow = wl_egl_window_create(mSurface->object(), sizeWithMargins.width(), sizeWithMargins.height());
+ m_requestedSize = sizeWithMargins;
}
if (!m_eglSurface && m_waylandEglWindow && create) {
EGLNativeWindowType eglw = (EGLNativeWindowType) m_waylandEglWindow;
- m_eglSurface = eglCreateWindowSurface(m_clientBufferIntegration->eglDisplay(), m_eglConfig, eglw, 0);
+ QSurfaceFormat fmt = window()->requestedFormat();
+ if (mDisplay->supportsWindowDecoration())
+ fmt.setAlphaBufferSize(8);
+ EGLConfig eglConfig = q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), fmt);
+ m_format = q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(), eglConfig, fmt);
+ m_eglSurface = eglCreateWindowSurface(m_clientBufferIntegration->eglDisplay(), eglConfig, eglw, 0);
if (Q_UNLIKELY(m_eglSurface == EGL_NO_SURFACE))
qCWarning(lcQpaWayland, "Could not create EGL surface (EGL error 0x%x)\n", eglGetError());
}
@@ -154,7 +121,7 @@ void QWaylandEglWindow::updateSurface(bool create)
QRect QWaylandEglWindow::contentsRect() const
{
QRect r = geometry();
- QMargins m = frameMargins();
+ QMargins m = clientSideMargins();
return QRect(m.left(), m.bottom(), r.width(), r.height());
}
@@ -163,13 +130,6 @@ QSurfaceFormat QWaylandEglWindow::format() const
return m_format;
}
-void QWaylandEglWindow::setVisible(bool visible)
-{
- QWaylandWindow::setVisible(visible);
- if (!visible)
- invalidateSurface();
-}
-
void QWaylandEglWindow::invalidateSurface()
{
if (m_eglSurface) {
@@ -180,6 +140,8 @@ void QWaylandEglWindow::invalidateSurface()
wl_egl_window_destroy(m_waylandEglWindow);
m_waylandEglWindow = nullptr;
}
+ delete m_contentFBO;
+ m_contentFBO = nullptr;
}
EGLSurface QWaylandEglWindow::eglSurface() const
@@ -220,3 +182,5 @@ void QWaylandEglWindow::bindContentFBO()
}
QT_END_NAMESPACE
+
+#include "moc_qwaylandeglwindow_p.cpp"
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
deleted file mode 100644
index 88e893a74..000000000
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDEGLWINDOW_H
-#define QWAYLANDEGLWINDOW_H
-
-#include <QtWaylandClient/private/qwaylandwindow_p.h>
-#include "qwaylandeglinclude.h"
-#include "qwaylandeglclientbufferintegration.h"
-
-QT_BEGIN_NAMESPACE
-
-class QOpenGLFramebufferObject;
-
-namespace QtWaylandClient {
-
-class QWaylandGLContext;
-
-class QWaylandEglWindow : public QWaylandWindow
-{
- Q_OBJECT
-public:
- QWaylandEglWindow(QWindow *window);
- ~QWaylandEglWindow();
- WindowType windowType() const override;
- void ensureSize() override;
-
- void updateSurface(bool create);
- virtual void setGeometry(const QRect &rect) override;
- QRect contentsRect() const;
-
- EGLSurface eglSurface() const;
- GLuint contentFBO() const;
- GLuint contentTexture() const;
- bool needToUpdateContentFBO() const { return decoration() && (m_resize || !m_contentFBO); }
-
- QSurfaceFormat format() const override;
-
- void bindContentFBO();
-
- void invalidateSurface() override;
- void setVisible(bool visible) override;
-
-private:
- QWaylandEglClientBufferIntegration *m_clientBufferIntegration = nullptr;
- struct wl_egl_window *m_waylandEglWindow = nullptr;
-
- const QWaylandWindow *m_parentWindow = nullptr;
-
- EGLSurface m_eglSurface = EGL_NO_SURFACE;
- EGLConfig m_eglConfig;
- mutable bool m_resize = false;
- mutable QOpenGLFramebufferObject *m_contentFBO = nullptr;
-
- QSurfaceFormat m_format;
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDEGLWINDOW_H
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h
new file mode 100644
index 000000000..5b9aa9874
--- /dev/null
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow_p.h
@@ -0,0 +1,70 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QWAYLANDEGLWINDOW_H
+#define QWAYLANDEGLWINDOW_H
+
+#include <QtWaylandClient/private/qwaylandwindow_p.h>
+#include "qwaylandeglinclude_p.h"
+#include "qwaylandeglclientbufferintegration_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLFramebufferObject;
+
+namespace QtWaylandClient {
+
+class QWaylandGLContext;
+
+class Q_WAYLANDCLIENT_EXPORT QWaylandEglWindow : public QWaylandWindow
+{
+ Q_OBJECT
+public:
+ QWaylandEglWindow(QWindow *window, QWaylandDisplay *display);
+ ~QWaylandEglWindow();
+ WindowType windowType() const override;
+ void ensureSize() override;
+
+ void updateSurface(bool create);
+ void setGeometry(const QRect &rect) override;
+ QRect contentsRect() const;
+
+ EGLSurface eglSurface() const;
+ GLuint contentFBO() const;
+ GLuint contentTexture() const;
+ bool needToUpdateContentFBO() const { return decoration() && (m_resize || !m_contentFBO); }
+
+ QSurfaceFormat format() const override;
+
+ void bindContentFBO();
+
+ void invalidateSurface() override;
+
+private:
+ QWaylandEglClientBufferIntegration *m_clientBufferIntegration = nullptr;
+ struct wl_egl_window *m_waylandEglWindow = nullptr;
+
+ EGLSurface m_eglSurface = EGL_NO_SURFACE;
+ mutable bool m_resize = false;
+ mutable QOpenGLFramebufferObject *m_contentFBO = nullptr;
+
+ QSurfaceFormat m_format;
+ QSize m_requestedSize;
+};
+
+}
+
+QT_END_NAMESPACE
+
+#endif // QWAYLANDEGLWINDOW_H
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index 6b9776e9c..02789b305 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -1,61 +1,26 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandglcontext.h"
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#include "qwaylandglcontext_p.h"
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
#include <QtWaylandClient/private/qwaylandwindow_p.h>
#include <QtWaylandClient/private/qwaylandsubsurface_p.h>
#include <QtWaylandClient/private/qwaylandabstractdecoration_p.h>
#include <QtWaylandClient/private/qwaylandintegration_p.h>
-#include "qwaylandeglwindow.h"
+#include "qwaylandeglwindow_p.h"
#include <QDebug>
-#include <QtEglSupport/private/qeglconvenience_p.h>
+#include <QtGui/private/qeglconvenience_p.h>
#include <QtGui/private/qopenglcontext_p.h>
-#include <QtGui/private/qopengltexturecache_p.h>
+#include <QtOpenGL/private/qopengltexturecache_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformopenglcontext.h>
#include <QtGui/QSurfaceFormat>
-#include <QtGui/QOpenGLShaderProgram>
+#include <QtOpenGL/QOpenGLShaderProgram>
#include <QtGui/QOpenGLFunctions>
+#include <QOpenGLBuffer>
#include <QtCore/qmutex.h>
@@ -138,19 +103,10 @@ public:
qDebug() << "Shader Program link failed.";
qDebug() << m_blitProgram->log();
}
- }
- ~DecorationsBlitter()
- {
- delete m_blitProgram;
- }
- void blit(QWaylandEglWindow *window)
- {
- Q_ASSERT(window->wl_surface::isInitialized());
- QOpenGLTextureCache *cache = QOpenGLTextureCache::cacheForContext(m_context->context());
- QRect windowRect = window->window()->frameGeometry();
- int scale = window->scale() ;
- glViewport(0, 0, windowRect.width() * scale, windowRect.height() * scale);
+ m_blitProgram->bind();
+ m_blitProgram->enableAttributeArray(0);
+ m_blitProgram->enableAttributeArray(1);
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
@@ -159,9 +115,8 @@ public:
glDepthMask(GL_FALSE);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- m_context->mUseNativeDefaultFbo = true;
- glBindFramebuffer(GL_FRAMEBUFFER, 0);
- m_context->mUseNativeDefaultFbo = false;
+ m_buffer.create();
+ m_buffer.bind();
static const GLfloat squareVertices[] = {
-1.f, -1.f,
@@ -169,14 +124,12 @@ public:
-1.f, 1.0f,
1.0f, 1.0f
};
-
static const GLfloat inverseSquareVertices[] = {
-1.f, 1.f,
1.f, 1.f,
-1.f, -1.f,
1.f, -1.f
};
-
static const GLfloat textureVertices[] = {
0.0f, 0.0f,
1.0f, 0.0f,
@@ -184,212 +137,159 @@ public:
1.0f, 1.0f,
};
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- m_blitProgram->bind();
+ m_squareVerticesOffset = 0;
+ m_inverseSquareVerticesOffset = sizeof(squareVertices);
+ m_textureVerticesOffset = sizeof(squareVertices) + sizeof(textureVertices);
- m_blitProgram->enableAttributeArray(0);
- m_blitProgram->enableAttributeArray(1);
- m_blitProgram->setAttributeArray(1, textureVertices, 2);
+ m_buffer.allocate(sizeof(squareVertices) + sizeof(inverseSquareVertices) + sizeof(textureVertices));
+ m_buffer.write(m_squareVerticesOffset, squareVertices, sizeof(squareVertices));
+ m_buffer.write(m_inverseSquareVerticesOffset, inverseSquareVertices, sizeof(inverseSquareVertices));
+ m_buffer.write(m_textureVerticesOffset, textureVertices, sizeof(textureVertices));
+
+ m_blitProgram->setAttributeBuffer(1, GL_FLOAT, m_textureVerticesOffset, 2);
+
+ m_textureWrap = m_context->context()->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat) ? GL_REPEAT : GL_CLAMP_TO_EDGE;
+ }
+ ~DecorationsBlitter()
+ {
+ delete m_blitProgram;
+ }
+ void blit(QWaylandEglWindow *window)
+ {
+ QOpenGLTextureCache *cache = QOpenGLTextureCache::cacheForContext(m_context->context());
- glActiveTexture(GL_TEXTURE0);
+ QSize surfaceSize = window->surfaceSize();
+ qreal scale = window->scale() ;
+ glViewport(0, 0, surfaceSize.width() * scale, surfaceSize.height() * scale);
//Draw Decoration
- m_blitProgram->setAttributeArray(0, inverseSquareVertices, 2);
- QImage decorationImage = window->decoration()->contentImage();
- cache->bindTexture(m_context->context(), decorationImage);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- if (m_context->context()->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat)) {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- } else {
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ if (auto *decoration = window->decoration()) {
+ m_blitProgram->setAttributeBuffer(0, GL_FLOAT, m_inverseSquareVerticesOffset, 2);
+ QImage decorationImage = decoration->contentImage();
+ cache->bindTexture(m_context->context(), decorationImage);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, m_textureWrap);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, m_textureWrap);
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
//Draw Content
- m_blitProgram->setAttributeArray(0, squareVertices, 2);
+ m_blitProgram->setAttributeBuffer(0, GL_FLOAT, m_squareVerticesOffset, 2);
glBindTexture(GL_TEXTURE_2D, window->contentTexture());
QRect r = window->contentsRect();
glViewport(r.x() * scale, r.y() * scale, r.width() * scale, r.height() * scale);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
- //Cleanup
- m_blitProgram->disableAttributeArray(0);
- m_blitProgram->disableAttributeArray(1);
}
QOpenGLShaderProgram *m_blitProgram = nullptr;
QWaylandGLContext *m_context = nullptr;
+ QOpenGLBuffer m_buffer;
+ int m_squareVerticesOffset;
+ int m_inverseSquareVerticesOffset;
+ int m_textureVerticesOffset;
+ int m_textureWrap;
};
-
-
-QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *display, const QSurfaceFormat &format, QPlatformOpenGLContext *share)
- : QPlatformOpenGLContext()
- , m_eglDisplay(eglDisplay)
- , m_display(display)
+QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *display,
+ const QSurfaceFormat &fmt, QPlatformOpenGLContext *share)
+ : QEGLPlatformContext(fmt, share, eglDisplay), m_display(display)
{
- QSurfaceFormat fmt = format;
- if (static_cast<QWaylandIntegration *>(QGuiApplicationPrivate::platformIntegration())->display()->supportsWindowDecoration())
- fmt.setAlphaBufferSize(8);
- m_config = q_configFromGLFormat(m_eglDisplay, fmt);
- m_format = q_glFormatFromConfig(m_eglDisplay, m_config, fmt);
- m_shareEGLContext = share ? static_cast<QWaylandGLContext *>(share)->eglContext() : EGL_NO_CONTEXT;
-
- QVector<EGLint> eglContextAttrs;
- eglContextAttrs.append(EGL_CONTEXT_CLIENT_VERSION);
- eglContextAttrs.append(format.majorVersion());
- const bool hasKHRCreateContext = q_hasEglExtension(m_eglDisplay, "EGL_KHR_create_context");
- if (hasKHRCreateContext) {
- eglContextAttrs.append(EGL_CONTEXT_MINOR_VERSION_KHR);
- eglContextAttrs.append(format.minorVersion());
- int flags = 0;
- // The debug bit is supported both for OpenGL and OpenGL ES.
- if (format.testOption(QSurfaceFormat::DebugContext))
- flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
- // The fwdcompat bit is only for OpenGL 3.0+.
- if (m_format.renderableType() == QSurfaceFormat::OpenGL
- && format.majorVersion() >= 3
- && !format.testOption(QSurfaceFormat::DeprecatedFunctions))
- flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
- if (flags) {
- eglContextAttrs.append(EGL_CONTEXT_FLAGS_KHR);
- eglContextAttrs.append(flags);
- }
- // Profiles are OpenGL only and mandatory in 3.2+. The value is silently ignored for < 3.2.
- if (m_format.renderableType() == QSurfaceFormat::OpenGL) {
- switch (format.profile()) {
- case QSurfaceFormat::NoProfile:
- break;
- case QSurfaceFormat::CoreProfile:
- eglContextAttrs.append(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR);
- eglContextAttrs.append(EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR);
- break;
- case QSurfaceFormat::CompatibilityProfile:
- eglContextAttrs.append(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR);
- eglContextAttrs.append(EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR);
- break;
- }
- }
- }
- eglContextAttrs.append(EGL_NONE);
+ m_reconnectionWatcher = QObject::connect(m_display, &QWaylandDisplay::connected,
+ m_display, [this] { invalidateContext(); });
- switch (m_format.renderableType()) {
+ switch (format().renderableType()) {
case QSurfaceFormat::OpenVG:
m_api = EGL_OPENVG_API;
break;
#ifdef EGL_VERSION_1_4
-# if !defined(QT_OPENGL_ES_2)
- case QSurfaceFormat::DefaultRenderableType:
-# endif
case QSurfaceFormat::OpenGL:
m_api = EGL_OPENGL_API;
break;
-#endif
- case QSurfaceFormat::OpenGLES:
+#endif // EGL_VERSION_1_4
default:
m_api = EGL_OPENGL_ES_API;
break;
}
- eglBindAPI(m_api);
-
- m_context = eglCreateContext(m_eglDisplay, m_config, m_shareEGLContext, eglContextAttrs.constData());
-
- if (m_context == EGL_NO_CONTEXT) {
- m_context = eglCreateContext(m_eglDisplay, m_config, EGL_NO_CONTEXT, eglContextAttrs.constData());
- m_shareEGLContext = EGL_NO_CONTEXT;
- }
- EGLint error = eglGetError();
- if (error != EGL_SUCCESS) {
- qWarning("QWaylandGLContext: failed to create EGLContext, error=%x", error);
- return;
- }
+ // Create an EGL context for the decorations blitter. By using a dedicated context we don't need to make sure to not
+ // change the context state and we also use OpenGL ES 2 API independently to what the app is using to draw.
+ QList<EGLint> eglDecorationsContextAttrs = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
+ m_decorationsContext = eglCreateContext(eglDisplay, eglConfig(), eglContext(),
+ eglDecorationsContextAttrs.constData());
+ if (m_decorationsContext == EGL_NO_CONTEXT)
+ qWarning("QWaylandGLContext: Failed to create the decorations EGLContext. Decorations will not be drawn.");
EGLint a = EGL_MIN_SWAP_INTERVAL;
EGLint b = EGL_MAX_SWAP_INTERVAL;
- if (!eglGetConfigAttrib(m_eglDisplay, m_config, a, &a) ||
- !eglGetConfigAttrib(m_eglDisplay, m_config, b, &b) ||
- a > 0) {
- mSupportNonBlockingSwap = false;
+ if (!eglGetConfigAttrib(eglDisplay, eglConfig(), a, &a)
+ || !eglGetConfigAttrib(eglDisplay, eglConfig(), b, &b) || a > 0) {
+ m_supportNonBlockingSwap = false;
+ }
+ {
+ bool ok;
+ int supportNonBlockingSwap = qEnvironmentVariableIntValue("QT_WAYLAND_FORCE_NONBLOCKING_SWAP_SUPPORT", &ok);
+ if (ok)
+ m_supportNonBlockingSwap = supportNonBlockingSwap != 0;
}
- if (!mSupportNonBlockingSwap) {
+ if (!m_supportNonBlockingSwap) {
qWarning(lcQpaWayland) << "Non-blocking swap buffers not supported."
<< "Subsurface rendering can be affected."
<< "It may also cause the event loop to freeze in some situations";
}
+}
- updateGLFormat();
+EGLSurface QWaylandGLContext::createTemporaryOffscreenSurface()
+{
+ m_wlSurface = m_display->createSurface(nullptr);
+ m_eglWindow = wl_egl_window_create(m_wlSurface, 1, 1);
+#if QT_CONFIG(egl_extension_platform_wayland)
+ EGLSurface eglSurface =
+ eglCreatePlatformWindowSurface(eglDisplay(), eglConfig(), m_eglWindow, nullptr);
+#else
+ EGLSurface eglSurface = eglCreateWindowSurface(eglDisplay(), eglConfig(), m_eglWindow, nullptr);
+#endif
+ return eglSurface;
}
-void QWaylandGLContext::updateGLFormat()
+void QWaylandGLContext::destroyTemporaryOffscreenSurface(EGLSurface eglSurface)
{
- // Have to save & restore to prevent QOpenGLContext::currentContext() from becoming
- // inconsistent after QOpenGLContext::create().
- EGLDisplay prevDisplay = eglGetCurrentDisplay();
- if (prevDisplay == EGL_NO_DISPLAY) // when no context is current
- prevDisplay = m_eglDisplay;
- EGLContext prevContext = eglGetCurrentContext();
- EGLSurface prevSurfaceDraw = eglGetCurrentSurface(EGL_DRAW);
- EGLSurface prevSurfaceRead = eglGetCurrentSurface(EGL_READ);
-
- wl_surface *wlSurface = m_display->createSurface(nullptr);
- wl_egl_window *eglWindow = wl_egl_window_create(wlSurface, 1, 1);
- EGLSurface eglSurface = eglCreateWindowSurface(m_eglDisplay, m_config, eglWindow, 0);
-
- if (eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) {
- if (m_format.renderableType() == QSurfaceFormat::OpenGL
- || m_format.renderableType() == QSurfaceFormat::OpenGLES) {
- const GLubyte *s = glGetString(GL_VERSION);
- if (s) {
- QByteArray version = QByteArray(reinterpret_cast<const char *>(s));
- int major, minor;
- if (QPlatformOpenGLContext::parseOpenGLVersion(version, major, minor)) {
- m_format.setMajorVersion(major);
- m_format.setMinorVersion(minor);
- }
- }
- m_format.setProfile(QSurfaceFormat::NoProfile);
- m_format.setOptions(QSurfaceFormat::FormatOptions());
- if (m_format.renderableType() == QSurfaceFormat::OpenGL) {
- // Check profile and options.
- if (m_format.majorVersion() < 3) {
- m_format.setOption(QSurfaceFormat::DeprecatedFunctions);
- } else {
- GLint value = 0;
- glGetIntegerv(GL_CONTEXT_FLAGS, &value);
- if (!(value & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT))
- m_format.setOption(QSurfaceFormat::DeprecatedFunctions);
- if (value & GL_CONTEXT_FLAG_DEBUG_BIT)
- m_format.setOption(QSurfaceFormat::DebugContext);
- if (m_format.version() >= qMakePair(3, 2)) {
- value = 0;
- glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &value);
- if (value & GL_CONTEXT_CORE_PROFILE_BIT)
- m_format.setProfile(QSurfaceFormat::CoreProfile);
- else if (value & GL_CONTEXT_COMPATIBILITY_PROFILE_BIT)
- m_format.setProfile(QSurfaceFormat::CompatibilityProfile);
- }
- }
- }
- }
- eglMakeCurrent(prevDisplay, prevSurfaceDraw, prevSurfaceRead, prevContext);
- }
- eglDestroySurface(m_eglDisplay, eglSurface);
- wl_egl_window_destroy(eglWindow);
- wl_surface_destroy(wlSurface);
+ eglDestroySurface(eglDisplay(), eglSurface);
+ wl_egl_window_destroy(m_eglWindow);
+ m_eglWindow = nullptr;
+ wl_surface_destroy(m_wlSurface);
+ m_wlSurface = nullptr;
}
QWaylandGLContext::~QWaylandGLContext()
{
+ QObject::disconnect(m_reconnectionWatcher);
delete m_blitter;
- eglDestroyContext(m_eglDisplay, m_context);
+ m_blitter = nullptr;
+ if (m_decorationsContext != EGL_NO_CONTEXT)
+ eglDestroyContext(eglDisplay(), m_decorationsContext);
+}
+
+void QWaylandGLContext::beginFrame()
+{
+ Q_ASSERT(m_currentWindow != nullptr);
+ if (m_supportNonBlockingSwap)
+ m_currentWindow->beginFrame();
+}
+
+void QWaylandGLContext::endFrame()
+{
+ Q_ASSERT(m_currentWindow != nullptr);
+ if (m_supportNonBlockingSwap)
+ m_currentWindow->endFrame();
}
bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
{
+ if (!isValid()) {
+ return false;
+ }
+
// in QWaylandGLContext() we called eglBindAPI with the correct value. However,
// eglBindAPI's documentation says:
// "eglBindAPI defines the current rendering API for EGL in the thread it is called from"
@@ -399,147 +299,44 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
eglBindAPI(m_api);
}
- QWaylandEglWindow *window = static_cast<QWaylandEglWindow *>(surface);
- EGLSurface eglSurface = window->eglSurface();
+ m_currentWindow = static_cast<QWaylandEglWindow *>(surface);
+ EGLSurface eglSurface = m_currentWindow->eglSurface();
- if (!window->needToUpdateContentFBO() && (eglSurface != EGL_NO_SURFACE)) {
- if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) {
- qWarning("QWaylandGLContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
+ if (!m_currentWindow->needToUpdateContentFBO() && (eglSurface != EGL_NO_SURFACE)) {
+ if (!eglMakeCurrent(eglDisplay(), eglSurface, eglSurface, eglContext())) {
+ qWarning("QWaylandGLContext::makeCurrent: eglError: %#x, this: %p \n", eglGetError(), this);
return false;
}
return true;
}
- if (window->isExposed())
- window->setCanResize(false);
- // Core profiles mandate the use of VAOs when rendering. We would then need to use one
- // in DecorationsBlitter, but for that we would need a QOpenGLFunctions_3_2_Core instead
- // of the QOpenGLFunctions we use, but that would break when using a lower version context.
- // Instead of going crazy, just disable decorations for core profiles until we use
- // subsurfaces for them.
- if (m_format.profile() != QSurfaceFormat::CoreProfile && !window->decoration())
- window->createDecoration();
+ if (m_currentWindow->isExposed())
+ m_currentWindow->setCanResize(false);
if (eglSurface == EGL_NO_SURFACE) {
- window->updateSurface(true);
- eglSurface = window->eglSurface();
+ m_currentWindow->updateSurface(true);
+ eglSurface = m_currentWindow->eglSurface();
}
- if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) {
- qWarning("QWaylandGLContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
- window->setCanResize(true);
+ if (!eglMakeCurrent(eglDisplay(), eglSurface, eglSurface, eglContext())) {
+ qWarning("QWaylandGLContext::makeCurrent: eglError: %#x, this: %p \n", eglGetError(), this);
+ m_currentWindow->setCanResize(true);
return false;
}
//### setCurrentContext will be called in QOpenGLContext::makeCurrent after this function
// returns, but that's too late, as we need a current context in order to bind the content FBO.
QOpenGLContextPrivate::setCurrentContext(context());
- window->bindContentFBO();
+ m_currentWindow->bindContentFBO();
return true;
}
void QWaylandGLContext::doneCurrent()
{
- eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ eglMakeCurrent(eglDisplay(), EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
}
-#define STATE_GUARD_VERTEX_ATTRIB_COUNT 2
-
-class StateGuard
-{
-public:
- StateGuard() {
- QOpenGLFunctions glFuncs(QOpenGLContext::currentContext());
-
- glGetIntegerv(GL_CURRENT_PROGRAM, (GLint *) &m_program);
- glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint *) &m_activeTextureUnit);
- glGetIntegerv(GL_TEXTURE_BINDING_2D, (GLint *) &m_texture);
- glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint *) &m_fbo);
- glGetIntegerv(GL_VIEWPORT, m_viewport);
- glGetIntegerv(GL_DEPTH_WRITEMASK, &m_depthWriteMask);
- glGetIntegerv(GL_COLOR_WRITEMASK, m_colorWriteMask);
- m_blend = glIsEnabled(GL_BLEND);
- m_depth = glIsEnabled(GL_DEPTH_TEST);
- m_cull = glIsEnabled(GL_CULL_FACE);
- m_scissor = glIsEnabled(GL_SCISSOR_TEST);
- for (int i = 0; i < STATE_GUARD_VERTEX_ATTRIB_COUNT; ++i) {
- glFuncs.glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, (GLint *) &m_vertexAttribs[i].enabled);
- glFuncs.glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, (GLint *) &m_vertexAttribs[i].arrayBuffer);
- glFuncs.glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_SIZE, &m_vertexAttribs[i].size);
- glFuncs.glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_STRIDE, &m_vertexAttribs[i].stride);
- glFuncs.glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_TYPE, (GLint *) &m_vertexAttribs[i].type);
- glFuncs.glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, (GLint *) &m_vertexAttribs[i].normalized);
- glFuncs.glGetVertexAttribPointerv(i, GL_VERTEX_ATTRIB_ARRAY_POINTER, &m_vertexAttribs[i].pointer);
- }
- glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (GLint *) &m_minFilter);
- glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (GLint *) &m_magFilter);
- glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, (GLint *) &m_wrapS);
- glGetTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, (GLint *) &m_wrapT);
- }
-
- ~StateGuard() {
- QOpenGLFunctions glFuncs(QOpenGLContext::currentContext());
-
- glFuncs.glUseProgram(m_program);
- glActiveTexture(m_activeTextureUnit);
- glBindTexture(GL_TEXTURE_2D, m_texture);
- glFuncs.glBindFramebuffer(GL_FRAMEBUFFER, m_fbo);
- glViewport(m_viewport[0], m_viewport[1], m_viewport[2], m_viewport[3]);
- glDepthMask(m_depthWriteMask);
- glColorMask(m_colorWriteMask[0], m_colorWriteMask[1], m_colorWriteMask[2], m_colorWriteMask[3]);
- if (m_blend)
- glEnable(GL_BLEND);
- if (m_depth)
- glEnable(GL_DEPTH_TEST);
- if (m_cull)
- glEnable(GL_CULL_FACE);
- if (m_scissor)
- glEnable(GL_SCISSOR_TEST);
- for (int i = 0; i < STATE_GUARD_VERTEX_ATTRIB_COUNT; ++i) {
- if (m_vertexAttribs[i].enabled)
- glFuncs.glEnableVertexAttribArray(i);
- GLuint prevBuf;
- glGetIntegerv(GL_ARRAY_BUFFER_BINDING, (GLint *) &prevBuf);
- glFuncs.glBindBuffer(GL_ARRAY_BUFFER, m_vertexAttribs[i].arrayBuffer);
- glFuncs.glVertexAttribPointer(i, m_vertexAttribs[i].size, m_vertexAttribs[i].type,
- m_vertexAttribs[i].normalized, m_vertexAttribs[i].stride,
- m_vertexAttribs[i].pointer);
- glFuncs.glBindBuffer(GL_ARRAY_BUFFER, prevBuf);
- }
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, m_minFilter);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, m_magFilter);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, m_wrapS);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, m_wrapT);
- }
-
-private:
- GLuint m_program;
- GLenum m_activeTextureUnit;
- GLuint m_texture;
- GLuint m_fbo;
- GLint m_depthWriteMask;
- GLint m_colorWriteMask[4];
- GLboolean m_blend;
- GLboolean m_depth;
- GLboolean m_cull;
- GLboolean m_scissor;
- GLint m_viewport[4];
- struct VertexAttrib {
- bool enabled;
- GLuint arrayBuffer;
- GLint size;
- GLint stride;
- GLenum type;
- bool normalized;
- void *pointer = nullptr;
- } m_vertexAttribs[STATE_GUARD_VERTEX_ATTRIB_COUNT];
- GLenum m_minFilter;
- GLenum m_magFilter;
- GLenum m_wrapS;
- GLenum m_wrapT;
-};
-
void QWaylandGLContext::swapBuffers(QPlatformSurface *surface)
{
QWaylandEglWindow *window = static_cast<QWaylandEglWindow *>(surface);
@@ -547,48 +344,44 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface)
EGLSurface eglSurface = window->eglSurface();
if (window->decoration()) {
- makeCurrent(surface);
+ if (m_api != EGL_OPENGL_ES_API)
+ eglBindAPI(EGL_OPENGL_ES_API);
- // Must save & restore all state. Applications are usually not prepared
- // for random context state changes in a swapBuffers() call.
- StateGuard stateGuard;
+ // save the current EGL content and surface to set it again after the blitter is done
+ EGLDisplay currentDisplay = eglGetCurrentDisplay();
+ EGLContext currentContext = eglGetCurrentContext();
+ EGLSurface currentSurfaceDraw = eglGetCurrentSurface(EGL_DRAW);
+ EGLSurface currentSurfaceRead = eglGetCurrentSurface(EGL_READ);
+ eglMakeCurrent(eglDisplay(), eglSurface, eglSurface, m_decorationsContext);
if (!m_blitter)
m_blitter = new DecorationsBlitter(this);
m_blitter->blit(window);
+
+ if (m_api != EGL_OPENGL_ES_API)
+ eglBindAPI(m_api);
+ eglMakeCurrent(currentDisplay, currentSurfaceDraw, currentSurfaceRead, currentContext);
}
- int swapInterval = mSupportNonBlockingSwap ? 0 : m_format.swapInterval();
- eglSwapInterval(m_eglDisplay, swapInterval);
- if (swapInterval == 0 && m_format.swapInterval() > 0) {
+ int swapInterval = m_supportNonBlockingSwap ? 0 : format().swapInterval();
+ eglSwapInterval(eglDisplay(), swapInterval);
+ if (swapInterval == 0 && format().swapInterval() > 0) {
// Emulating a blocking swap
glFlush(); // Flush before waiting so we can swap more quickly when the frame event arrives
window->waitForFrameSync(100);
}
window->handleUpdate();
- eglSwapBuffers(m_eglDisplay, eglSurface);
+ if (!eglSwapBuffers(eglDisplay(), eglSurface))
+ qCWarning(lcQpaWayland, "eglSwapBuffers failed with %#x, surface: %p", eglGetError(), eglSurface);
window->setCanResize(true);
}
GLuint QWaylandGLContext::defaultFramebufferObject(QPlatformSurface *surface) const
{
- if (mUseNativeDefaultFbo)
- return 0;
-
return static_cast<QWaylandEglWindow *>(surface)->contentFBO();
}
-bool QWaylandGLContext::isSharing() const
-{
- return m_shareEGLContext != EGL_NO_CONTEXT;
-}
-
-bool QWaylandGLContext::isValid() const
-{
- return m_context != EGL_NO_CONTEXT;
-}
-
QFunctionPointer QWaylandGLContext::getProcAddress(const char *procName)
{
QFunctionPointer proc = (QFunctionPointer) eglGetProcAddress(procName);
@@ -597,9 +390,9 @@ QFunctionPointer QWaylandGLContext::getProcAddress(const char *procName)
return proc;
}
-EGLConfig QWaylandGLContext::eglConfig() const
+EGLSurface QWaylandGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
{
- return m_config;
+ return static_cast<QWaylandEglWindow *>(surface)->eglSurface();
}
}
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h
deleted file mode 100644
index 9e876ac17..000000000
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDGLCONTEXT_H
-#define QWAYLANDGLCONTEXT_H
-
-#include <QtWaylandClient/private/qwaylanddisplay_p.h>
-
-#include <qpa/qplatformopenglcontext.h>
-
-#include "qwaylandeglinclude.h"
-
-QT_BEGIN_NAMESPACE
-
-class QOpenGLShaderProgram;
-class QOpenGLTextureCache;
-
-namespace QtWaylandClient {
-
-class QWaylandWindow;
-class QWaylandGLWindowSurface;
-class DecorationsBlitter;
-
-class QWaylandGLContext : public QPlatformOpenGLContext
-{
-public:
- QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *display, const QSurfaceFormat &format, QPlatformOpenGLContext *share);
- ~QWaylandGLContext();
-
- void swapBuffers(QPlatformSurface *surface) override;
-
- bool makeCurrent(QPlatformSurface *surface) override;
- void doneCurrent() override;
-
- GLuint defaultFramebufferObject(QPlatformSurface *surface) const override;
-
- bool isSharing() const override;
- bool isValid() const override;
-
- QFunctionPointer getProcAddress(const char *procName) override;
-
- QSurfaceFormat format() const override { return m_format; }
-
- EGLConfig eglConfig() const;
- EGLContext eglContext() const { return m_context; }
-
-private:
- void updateGLFormat();
-
- EGLDisplay m_eglDisplay;
- QWaylandDisplay *m_display = nullptr;
- EGLContext m_context;
- EGLContext m_shareEGLContext;
- EGLConfig m_config;
- QSurfaceFormat m_format;
- DecorationsBlitter *m_blitter = nullptr;
- bool mUseNativeDefaultFbo = false;
- uint m_api;
- bool mSupportNonBlockingSwap = true;
-
- friend class DecorationsBlitter;
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDGLCONTEXT_H
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext_p.h b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext_p.h
new file mode 100644
index 000000000..b985c6675
--- /dev/null
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext_p.h
@@ -0,0 +1,72 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifndef QWAYLANDGLCONTEXT_H
+#define QWAYLANDGLCONTEXT_H
+
+#include "qwaylandeglinclude_p.h" //must be first
+
+#include <QtWaylandClient/private/qwaylanddisplay_p.h>
+#include <QtGui/private/qeglplatformcontext_p.h>
+#include <qpa/qplatformopenglcontext.h>
+
+QT_BEGIN_NAMESPACE
+
+class QOpenGLShaderProgram;
+class QOpenGLTextureCache;
+
+namespace QtWaylandClient {
+
+class QWaylandEglWindow;
+class DecorationsBlitter;
+
+class Q_WAYLANDCLIENT_EXPORT QWaylandGLContext : public QEGLPlatformContext
+{
+public:
+ QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *display, const QSurfaceFormat &format, QPlatformOpenGLContext *share);
+ ~QWaylandGLContext();
+ void swapBuffers(QPlatformSurface *surface) override;
+
+ bool makeCurrent(QPlatformSurface *surface) override;
+ void doneCurrent() override;
+
+ void beginFrame() override;
+ void endFrame() override;
+
+ GLuint defaultFramebufferObject(QPlatformSurface *surface) const override;
+
+ QFunctionPointer getProcAddress(const char *procName) override;
+
+protected:
+ EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override;
+ EGLSurface createTemporaryOffscreenSurface() override;
+ void destroyTemporaryOffscreenSurface(EGLSurface surface) override;
+
+private:
+ QWaylandDisplay *m_display = nullptr;
+ EGLContext m_decorationsContext;
+ DecorationsBlitter *m_blitter = nullptr;
+ bool m_supportNonBlockingSwap = true;
+ EGLenum m_api;
+ wl_surface *m_wlSurface = nullptr;
+ wl_egl_window *m_eglWindow = nullptr;
+ QWaylandEglWindow *m_currentWindow = nullptr;
+ QMetaObject::Connection m_reconnectionWatcher;
+};
+
+}
+
+QT_END_NAMESPACE
+
+#endif // QWAYLANDGLCONTEXT_H
diff --git a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri
index d7634b150..5d0d0204b 100644
--- a/src/hardwareintegration/client/wayland-egl/wayland-egl.pri
+++ b/src/hardwareintegration/client/wayland-egl/wayland-egl.pri
@@ -1,14 +1,14 @@
INCLUDEPATH += $$PWD
-QMAKE_USE += egl wayland-client wayland-egl
+QMAKE_USE += egl wayland-client wayland-egl libdl
-QT += egl_support-private
+QT += opengl-private
SOURCES += $$PWD/qwaylandeglclientbufferintegration.cpp \
$$PWD/qwaylandglcontext.cpp \
$$PWD/qwaylandeglwindow.cpp
-HEADERS += $$PWD/qwaylandeglclientbufferintegration.h \
- $$PWD/qwaylandglcontext.h \
- $$PWD/qwaylandeglwindow.h \
- $$PWD/qwaylandeglinclude.h
+HEADERS += $$PWD/qwaylandeglclientbufferintegration_p.h \
+ $$PWD/qwaylandglcontext_p.h \
+ $$PWD/qwaylandeglwindow_p.h \
+ $$PWD/qwaylandeglinclude_p.h
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp
deleted file mode 100644
index aa5367e02..000000000
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandxcompositeeglclientbufferintegration.h"
-
-#include "qwaylandxcompositeeglwindow.h"
-
-#include <QtCore/QDebug>
-#include <QtEglSupport/private/qeglconvenience_p.h>
-
-#include <QtWaylandClient/private/qwaylanddisplay_p.h>
-
-#include "wayland-xcomposite-client-protocol.h"
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-QWaylandXCompositeEGLClientBufferIntegration::QWaylandXCompositeEGLClientBufferIntegration()
- : QWaylandClientBufferIntegration()
-{
- qDebug() << "Using XComposite-EGL";
-}
-
-QWaylandXCompositeEGLClientBufferIntegration::~QWaylandXCompositeEGLClientBufferIntegration()
-{
- XCloseDisplay(mDisplay);
-}
-
-void QWaylandXCompositeEGLClientBufferIntegration::initialize(QWaylandDisplay *display)
-{
- mWaylandDisplay = display;
- mWaylandDisplay->addRegistryListener(&wlDisplayHandleGlobal, this);
- while (!mDisplay) {
- display->flushRequests();
- display->blockingReadEvents();
- }
-}
-
-QWaylandWindow * QWaylandXCompositeEGLClientBufferIntegration::createEglWindow(QWindow *window)
-{
- return new QWaylandXCompositeEGLWindow(window,this);
-}
-
-QPlatformOpenGLContext *QWaylandXCompositeEGLClientBufferIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const
-{
- EGLDisplay display = eglDisplay();
- EGLConfig config = q_configFromGLFormat(display, glFormat, true, EGL_WINDOW_BIT | EGL_PIXMAP_BIT);
- return new QWaylandXCompositeEGLContext(glFormat, share, display, config);
-}
-
-Display * QWaylandXCompositeEGLClientBufferIntegration::xDisplay() const
-{
- return mDisplay;
-}
-
-EGLDisplay QWaylandXCompositeEGLClientBufferIntegration::eglDisplay() const
-{
- return mEglDisplay;
-}
-
-int QWaylandXCompositeEGLClientBufferIntegration::screen() const
-{
- return mScreen;
-}
-
-Window QWaylandXCompositeEGLClientBufferIntegration::rootWindow() const
-{
- return mRootWindow;
-}
-
-QWaylandDisplay * QWaylandXCompositeEGLClientBufferIntegration::waylandDisplay() const
-{
- return mWaylandDisplay;
-}
-qt_xcomposite * QWaylandXCompositeEGLClientBufferIntegration::waylandXComposite() const
-{
- return mWaylandComposite;
-}
-
-const struct qt_xcomposite_listener QWaylandXCompositeEGLClientBufferIntegration::xcomposite_listener = {
- QWaylandXCompositeEGLClientBufferIntegration::rootInformation
-};
-
-void QWaylandXCompositeEGLClientBufferIntegration::wlDisplayHandleGlobal(void *data, wl_registry *registry, uint32_t id, const QString &interface, uint32_t version)
-{
- Q_UNUSED(version);
- if (interface == "qt_xcomposite") {
- QWaylandXCompositeEGLClientBufferIntegration *integration = static_cast<QWaylandXCompositeEGLClientBufferIntegration *>(data);
- integration->mWaylandComposite = static_cast<struct qt_xcomposite *>(wl_registry_bind(registry,id,&qt_xcomposite_interface,1));
- qt_xcomposite_add_listener(integration->mWaylandComposite,&xcomposite_listener,integration);
- }
-
-}
-
-void QWaylandXCompositeEGLClientBufferIntegration::rootInformation(void *data, qt_xcomposite *xcomposite, const char *display_name, uint32_t root_window)
-{
- Q_UNUSED(xcomposite);
- QWaylandXCompositeEGLClientBufferIntegration *integration = static_cast<QWaylandXCompositeEGLClientBufferIntegration *>(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;
-}
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h
deleted file mode 100644
index ee55d6892..000000000
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglclientbufferintegration.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDXCOMPOSITEEGLCLIENTBUFFERINTEGRATION_H
-#define QWAYLANDXCOMPOSITEEGLCLIENTBUFFERINTEGRATION_H
-
-#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
-#include <wayland-client.h>
-
-#include <QtCore/QTextStream>
-#include <QtCore/QDataStream>
-#include <QtCore/QMetaType>
-#include <QtCore/QVariant>
-#include <QtGui/QWindow>
-
-#include <qpa/qplatformopenglcontext.h>
-
-#include <QWaitCondition>
-
-#include <X11/Xlib.h>
-#include <EGL/egl.h>
-
-// avoid clashes with Qt::CursorShape
-#ifdef CursorShape
-# define X_CursorShape CursorShape
-# undef CursorShape
-#endif
-
-struct qt_xcomposite;
-struct qt_xcomposite_listener;
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-class QWaylandXCompositeEGLClientBufferIntegration : public QWaylandClientBufferIntegration
-{
-public:
- QWaylandXCompositeEGLClientBufferIntegration();
- ~QWaylandXCompositeEGLClientBufferIntegration() override;
-
- void initialize(QWaylandDisplay *dispaly) override;
-
- QWaylandWindow *createEglWindow(QWindow *window) override;
- QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const override;
-
- QWaylandDisplay *waylandDisplay() const;
- struct qt_xcomposite *waylandXComposite() const;
-
- Display *xDisplay() const;
- EGLDisplay eglDisplay() const;
- int screen() const;
- Window rootWindow() const;
-
- bool supportsThreadedOpenGL() const override { return true; }
- bool supportsWindowDecoration() const override { return false; }
-
-private:
- QWaylandDisplay *mWaylandDisplay = nullptr;
- struct qt_xcomposite *mWaylandComposite = nullptr;
-
- Display *mDisplay = nullptr;
- EGLDisplay mEglDisplay;
- int mScreen;
- Window mRootWindow;
-
- static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id,
- const QString &interface, uint32_t version);
-
- static const struct ::qt_xcomposite_listener xcomposite_listener;
- static void rootInformation(void *data,
- struct qt_xcomposite *xcomposite,
- const char *display_name,
- uint32_t root_window);
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDXCOMPOSITEEGLCLIENTBUFFERINTEGRATION_H
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp
deleted file mode 100644
index a6fead95c..000000000
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandxcompositeeglcontext.h"
-
-#include "qwaylandxcompositeeglwindow.h"
-
-#include <QtCore/QDebug>
-#include <QtGui/QRegion>
-
-#include <QtEglSupport/private/qeglconvenience_p.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLConfig config)
- : QEGLPlatformContext(format, share, display, &config)
-{
-}
-
-void QWaylandXCompositeEGLContext::swapBuffers(QPlatformSurface *surface)
-{
- QEGLPlatformContext::swapBuffers(surface);
-
- QWaylandXCompositeEGLWindow *w =
- static_cast<QWaylandXCompositeEGLWindow *>(surface);
-
- QSize size = w->geometry().size();
-
- w->commit(w->buffer(), QRegion(0, 0, size.width(), size.height()));
- w->waitForFrameSync(100);
-}
-
-EGLSurface QWaylandXCompositeEGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
-{
- return static_cast<QWaylandXCompositeEGLWindow *>(surface)->eglSurface();
-}
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h
deleted file mode 100644
index e0b70bf21..000000000
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDXCOMPOSITEEGLCONTEXT_H
-#define QWAYLANDXCOMPOSITEEGLCONTEXT_H
-
-#include <qpa/qplatformopenglcontext.h>
-
-#include "qwaylandxcompositeeglclientbufferintegration.h"
-
-#include <QtEglSupport/private/qeglplatformcontext_p.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-class QWaylandXCompositeEGLWindow;
-
-class QWaylandXCompositeEGLContext : public QEGLPlatformContext
-{
-public:
- QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display, EGLConfig config);
-
- void swapBuffers(QPlatformSurface *surface) override;
-
-private:
- EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override;
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDXCOMPOSITEEGLCONTEXT_H
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp
deleted file mode 100644
index 57a7ba7b6..000000000
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.cpp
+++ /dev/null
@@ -1,134 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandxcompositeeglwindow.h"
-#include "qwaylandxcompositebuffer.h"
-
-#include <QtEglSupport/private/qeglconvenience_p.h>
-#include <QtEglSupport/private/qxlibeglintegration_p.h>
-
-#include "wayland-xcomposite-client-protocol.h"
-
-#include <X11/extensions/Xcomposite.h>
-#include "qwaylandxcompositeeglclientbufferintegration.h"
-
-#include <QtCore/QDebug>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-QWaylandXCompositeEGLWindow::QWaylandXCompositeEGLWindow(QWindow *window, QWaylandXCompositeEGLClientBufferIntegration *glxIntegration)
- : QWaylandWindow(window)
- , m_glxIntegration(glxIntegration)
- , m_config(q_configFromGLFormat(glxIntegration->eglDisplay(), window->format(), true, EGL_WINDOW_BIT | EGL_PIXMAP_BIT))
-{
-}
-
-QWaylandWindow::WindowType QWaylandXCompositeEGLWindow::windowType() const
-{
- //yeah. this type needs a new name
- return QWaylandWindow::Egl;
-}
-
-void QWaylandXCompositeEGLWindow::setGeometry(const QRect &rect)
-{
- QWaylandWindow::setGeometry(rect);
-
- if (m_surface) {
- eglDestroySurface(m_glxIntegration->eglDisplay(), m_surface);
- m_surface = 0;
- }
-}
-
-EGLSurface QWaylandXCompositeEGLWindow::eglSurface() const
-{
- if (!m_surface)
- const_cast<QWaylandXCompositeEGLWindow *>(this)->createEglSurface();
- return m_surface;
-}
-
-void QWaylandXCompositeEGLWindow::createEglSurface()
-{
- QSize size(geometry().size());
- if (size.isEmpty()) {
- // QGLWidget wants a context for a window without geometry
- size = QSize(1,1);
- }
-
- delete m_buffer;
- //XFreePixmap deletes the glxPixmap as well
- if (m_xWindow) {
- XDestroyWindow(m_glxIntegration->xDisplay(), m_xWindow);
- }
-
- VisualID visualId = QXlibEglIntegration::getCompatibleVisualId(m_glxIntegration->xDisplay(), m_glxIntegration->eglDisplay(), m_config);
-
- XVisualInfo visualInfoTemplate;
- memset(&visualInfoTemplate, 0, sizeof(XVisualInfo));
- visualInfoTemplate.visualid = visualId;
-
- int matchingCount = 0;
- XVisualInfo *visualInfo = XGetVisualInfo(m_glxIntegration->xDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount);
-
- Colormap cmap = XCreateColormap(m_glxIntegration->xDisplay(),m_glxIntegration->rootWindow(),visualInfo->visual,AllocNone);
-
- XSetWindowAttributes a;
- a.colormap = cmap;
- m_xWindow = XCreateWindow(m_glxIntegration->xDisplay(), m_glxIntegration->rootWindow(),0, 0, size.width(), size.height(),
- 0, visualInfo->depth, InputOutput, visualInfo->visual,
- CWColormap, &a);
-
- XCompositeRedirectWindow(m_glxIntegration->xDisplay(), m_xWindow, CompositeRedirectManual);
- XMapWindow(m_glxIntegration->xDisplay(), m_xWindow);
-
- m_surface = eglCreateWindowSurface(m_glxIntegration->eglDisplay(), m_config, reinterpret_cast<EGLNativeWindowType>(m_xWindow), nullptr);
- if (m_surface == EGL_NO_SURFACE) {
- qFatal("Could not make eglsurface");
- }
-
- XSync(m_glxIntegration->xDisplay(),False);
- m_buffer = new QWaylandXCompositeBuffer(m_glxIntegration->waylandXComposite(),
- (uint32_t)m_xWindow,
- size);
-}
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h
deleted file mode 100644
index 0c8bcf441..000000000
--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglwindow.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDXCOMPOSITEEGLWINDOW_H
-#define QWAYLANDXCOMPOSITEEGLWINDOW_H
-
-#include <QtWaylandClient/private/qwaylandwindow_p.h>
-#include <QtWaylandClient/private/qwaylandbuffer_p.h>
-
-#include "qwaylandxcompositeeglclientbufferintegration.h"
-#include "qwaylandxcompositeeglcontext.h"
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-class QWaylandXCompositeEGLWindow : public QWaylandWindow
-{
-public:
- QWaylandXCompositeEGLWindow(QWindow *window, QWaylandXCompositeEGLClientBufferIntegration *glxIntegration);
- WindowType windowType() const override;
-
- void setGeometry(const QRect &rect) override;
-
- EGLSurface eglSurface() const;
-
- QWaylandBuffer *buffer() { return m_buffer; }
-
-private:
- void createEglSurface();
-
- QWaylandXCompositeEGLClientBufferIntegration *m_glxIntegration = nullptr;
- QWaylandBuffer *m_buffer = nullptr;
-
- Window m_xWindow = 0;
- EGLConfig m_config;
- EGLSurface m_surface = EGL_NO_SURFACE;
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDXCOMPOSITEEGLWINDOW_H
diff --git a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri b/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri
deleted file mode 100644
index f2beb1e03..000000000
--- a/src/hardwareintegration/client/xcomposite-egl/xcomposite-egl.pri
+++ /dev/null
@@ -1,16 +0,0 @@
-INCLUDEPATH += $$PWD
-include($$PWD/../xcomposite_share/xcomposite_share.pri)
-
-QMAKE_USE += egl wayland-client
-
-QT += egl_support-private
-
-SOURCES += \
- $$PWD/qwaylandxcompositeeglcontext.cpp \
- $$PWD/qwaylandxcompositeeglclientbufferintegration.cpp \
- $$PWD/qwaylandxcompositeeglwindow.cpp
-
-HEADERS += \
- $$PWD/qwaylandxcompositeeglcontext.h \
- $$PWD/qwaylandxcompositeeglclientbufferintegration.h \
- $$PWD/qwaylandxcompositeeglwindow.h
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp
deleted file mode 100644
index 351887416..000000000
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtCore/QDebug>
-
-#include "qwaylandxcompositeglxcontext.h"
-
-#include "qwaylandxcompositeglxwindow.h"
-
-#include <QRegion>
-
-#include <dlfcn.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-QWaylandXCompositeGLXContext::QWaylandXCompositeGLXContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, Display *display, int screen)
- : m_display(display),
- m_format(format)
-{
- qDebug("creating XComposite-GLX context");
-
- if (m_format.renderableType() == QSurfaceFormat::DefaultRenderableType)
- m_format.setRenderableType(QSurfaceFormat::OpenGL);
-
- if (m_format.renderableType() != QSurfaceFormat::OpenGL) {
- qWarning("Unsupported renderable type");
- return;
- }
-
- GLXContext shareContext = share ? static_cast<QWaylandXCompositeGLXContext *>(share)->m_context : 0;
- GLXFBConfig config = qglx_findConfig(display, screen, m_format, GLX_WINDOW_BIT | GLX_PIXMAP_BIT);
- XVisualInfo *visualInfo = glXGetVisualFromFBConfig(display, config);
- m_context = glXCreateContext(display, visualInfo, shareContext, true);
- qglx_surfaceFormatFromGLXFBConfig(&m_format, display, config);
-}
-
-bool QWaylandXCompositeGLXContext::makeCurrent(QPlatformSurface *surface)
-{
- Window xWindow = static_cast<QWaylandXCompositeGLXWindow *>(surface)->xWindow();
-
- return glXMakeCurrent(m_display, xWindow, m_context);
-}
-
-void QWaylandXCompositeGLXContext::doneCurrent()
-{
- glXMakeCurrent(m_display, 0, 0);
-}
-
-void QWaylandXCompositeGLXContext::swapBuffers(QPlatformSurface *surface)
-{
- QWaylandXCompositeGLXWindow *w = static_cast<QWaylandXCompositeGLXWindow *>(surface);
-
- QSize size = w->geometry().size();
-
- glXSwapBuffers(m_display, w->xWindow());
-
- w->commit(w->buffer(), QRegion(0, 0, size.width(), size.height()));
- w->waitForFrameSync(100);
-}
-
-QFunctionPointer QWaylandXCompositeGLXContext::getProcAddress(const char *procName)
-{
- QFunctionPointer proc = glXGetProcAddress(reinterpret_cast<const GLubyte *>(procName));
- if (!proc)
- proc = (QFunctionPointer) dlsym(RTLD_DEFAULT, procName);
- return proc;
-}
-
-QSurfaceFormat QWaylandXCompositeGLXContext::format() const
-{
- return m_format;
-}
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h
deleted file mode 100644
index 1bb2f4f7d..000000000
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDXCOMPOSITEGLXCONTEXT_H
-#define QWAYLANDXCOMPOSITEGLXCONTEXT_H
-
-#include <qpa/qplatformopenglcontext.h>
-
-#include "qwaylandxcompositeglxintegration.h"
-#include <QtGlxSupport/private/qglxconvenience_p.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-class QWaylandXCompositeGLXWindow;
-class QWaylandShmBuffer;
-
-class QWaylandXCompositeGLXContext : public QPlatformOpenGLContext
-{
-public:
- QWaylandXCompositeGLXContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, Display *display, int screen);
-
- QSurfaceFormat format() const override;
-
- void swapBuffers(QPlatformSurface *surface) override;
-
- bool makeCurrent(QPlatformSurface *surface) override;
- void doneCurrent() override;
-
- QFunctionPointer getProcAddress(const char *procName) override;
-
-private:
- GLXContext m_context;
-
- Display *m_display = nullptr;
- QSurfaceFormat m_format;
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDXCOMPOSITEGLXCONTEXT_H
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp
deleted file mode 100644
index 090cfb8a0..000000000
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandxcompositeglxintegration.h"
-
-#include "qwaylandxcompositeglxwindow.h"
-
-#include <QtCore/QDebug>
-
-#include "wayland-xcomposite-client-protocol.h"
-
-#include <QtWaylandClient/private/qwaylanddisplay_p.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-QWaylandXCompositeGLXIntegration::QWaylandXCompositeGLXIntegration()
-{
- qDebug() << "Using XComposite-GLX";
-}
-
-QWaylandXCompositeGLXIntegration::~QWaylandXCompositeGLXIntegration()
-{
- XCloseDisplay(mDisplay);
-}
-
-void QWaylandXCompositeGLXIntegration::initialize(QWaylandDisplay *display)
-{
- mWaylandDisplay = display;
- mWaylandDisplay->addRegistryListener(QWaylandXCompositeGLXIntegration::wlDisplayHandleGlobal, this);
- while (!mDisplay) {
- display->flushRequests();
- display->blockingReadEvents();
- }
-}
-
-QWaylandWindow * QWaylandXCompositeGLXIntegration::createEglWindow(QWindow *window)
-{
- return new QWaylandXCompositeGLXWindow(window, this);
-}
-
-QPlatformOpenGLContext *QWaylandXCompositeGLXIntegration::createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const
-{
- return new QWaylandXCompositeGLXContext(glFormat, share, mDisplay, mScreen);
-}
-
-Display * QWaylandXCompositeGLXIntegration::xDisplay() const
-{
- return mDisplay;
-}
-
-int QWaylandXCompositeGLXIntegration::screen() const
-{
- return mScreen;
-}
-
-Window QWaylandXCompositeGLXIntegration::rootWindow() const
-{
- return mRootWindow;
-}
-
-QWaylandDisplay * QWaylandXCompositeGLXIntegration::waylandDisplay() const
-{
- return mWaylandDisplay;
-}
-qt_xcomposite * QWaylandXCompositeGLXIntegration::waylandXComposite() const
-{
- return mWaylandComposite;
-}
-
-const struct qt_xcomposite_listener QWaylandXCompositeGLXIntegration::xcomposite_listener = {
- QWaylandXCompositeGLXIntegration::rootInformation
-};
-
-void QWaylandXCompositeGLXIntegration::wlDisplayHandleGlobal(void *data, wl_registry *registry, uint32_t id, const QString &interface, uint32_t version)
-{
- Q_UNUSED(version);
- if (interface == "qt_xcomposite") {
- qDebug("XComposite-GLX: got qt_xcomposite global");
- QWaylandXCompositeGLXIntegration *integration = static_cast<QWaylandXCompositeGLXIntegration *>(data);
- integration->mWaylandComposite = static_cast<struct qt_xcomposite *>(wl_registry_bind(registry, id, &qt_xcomposite_interface, 1));
- qt_xcomposite_add_listener(integration->mWaylandComposite,&xcomposite_listener,integration);
- }
-
-}
-
-void QWaylandXCompositeGLXIntegration::rootInformation(void *data, qt_xcomposite *xcomposite, const char *display_name, uint32_t root_window)
-{
- Q_UNUSED(xcomposite);
- QWaylandXCompositeGLXIntegration *integration = static_cast<QWaylandXCompositeGLXIntegration *>(data);
-
- qDebug("XComposite-GLX: xcomposite listener callback");
-
- integration->mDisplay = XOpenDisplay(display_name);
- integration->mRootWindow = (Window) root_window;
- integration->mScreen = XDefaultScreen(integration->mDisplay);
-}
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h
deleted file mode 100644
index 26f2bad6f..000000000
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxintegration.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDXCOMPOSITEGLXINTEGRATION_H
-#define QWAYLANDXCOMPOSITEGLXINTEGRATION_H
-
-#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
-#include <wayland-client.h>
-
-#include <QtCore/QTextStream>
-#include <QtCore/QDataStream>
-#include <QtCore/QMetaType>
-#include <QtCore/QVariant>
-#include <QtGui/QWindow>
-
-#include <X11/Xlib.h>
-
-// avoid clashes with Qt::CursorShape
-#ifdef CursorShape
-# define X_CursorShape CursorShape
-# undef CursorShape
-#endif
-
-struct qt_xcomposite;
-struct qt_xcomposite_listener;
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-class QWaylandXCompositeGLXIntegration : public QWaylandClientBufferIntegration
-{
-public:
- QWaylandXCompositeGLXIntegration();
- ~QWaylandXCompositeGLXIntegration() override;
-
- void initialize(QWaylandDisplay *display) override;
-
- QWaylandWindow *createEglWindow(QWindow *window) override;
- QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const override;
-
- QWaylandDisplay *waylandDisplay() const;
- struct qt_xcomposite *waylandXComposite() const;
-
- Display *xDisplay() const;
- int screen() const;
- Window rootWindow() const;
-
- bool supportsThreadedOpenGL() const override { return false; }
- bool supportsWindowDecoration() const override { return false; }
-
-private:
- QWaylandDisplay *mWaylandDisplay = nullptr;
- struct qt_xcomposite *mWaylandComposite = nullptr;
-
- Display *mDisplay = nullptr;
- int mScreen = 0;
- Window mRootWindow = 0;
-
- static void wlDisplayHandleGlobal(void *data, struct wl_registry *registry, uint32_t id,
- const QString &interface, uint32_t version);
-
- static const struct qt_xcomposite_listener xcomposite_listener;
- static void rootInformation(void *data,
- struct qt_xcomposite *xcomposite,
- const char *display_name,
- uint32_t root_window);
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDXCOMPOSITEGLXINTEGRATION_H
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp
deleted file mode 100644
index 2b491e24d..000000000
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandxcompositeglxwindow.h"
-#include "qwaylandxcompositebuffer.h"
-
-#include <QtCore/QDebug>
-
-#include "wayland-xcomposite-client-protocol.h"
-#include <QtGui/QRegion>
-
-#include <X11/extensions/Xcomposite.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-QWaylandXCompositeGLXWindow::QWaylandXCompositeGLXWindow(QWindow *window, QWaylandXCompositeGLXIntegration *glxIntegration)
- : QWaylandWindow(window)
- , m_glxIntegration(glxIntegration)
- , m_config(qglx_findConfig(glxIntegration->xDisplay(), glxIntegration->screen(), window->format(), GLX_WINDOW_BIT | GLX_PIXMAP_BIT))
-{
-}
-
-QWaylandWindow::WindowType QWaylandXCompositeGLXWindow::windowType() const
-{
- //yeah. this type needs a new name
- return QWaylandWindow::Egl;
-}
-
-void QWaylandXCompositeGLXWindow::setGeometry(const QRect &rect)
-{
- QWaylandWindow::setGeometry(rect);
-
- if (m_xWindow) {
- XDestroyWindow(m_glxIntegration->xDisplay(), m_xWindow);
- m_xWindow = 0;
- }
-}
-
-Window QWaylandXCompositeGLXWindow::xWindow() const
-{
- if (!m_xWindow)
- const_cast<QWaylandXCompositeGLXWindow *>(this)->createSurface();
-
- return m_xWindow;
-}
-
-void QWaylandXCompositeGLXWindow::createSurface()
-{
- QSize size(geometry().size());
- if (size.isEmpty()) {
- //QGLWidget wants a context for a window without geometry
- size = QSize(1,1);
- }
-
- if (!m_glxIntegration->xDisplay()) {
- qWarning("XCompositeGLXWindow: X display still null?!");
- return;
- }
-
- XVisualInfo *visualInfo = glXGetVisualFromFBConfig(m_glxIntegration->xDisplay(), m_config);
- Colormap cmap = XCreateColormap(m_glxIntegration->xDisplay(), m_glxIntegration->rootWindow(),
- visualInfo->visual, AllocNone);
-
- XSetWindowAttributes a;
- a.background_pixel = WhitePixel(m_glxIntegration->xDisplay(), m_glxIntegration->screen());
- a.border_pixel = BlackPixel(m_glxIntegration->xDisplay(), m_glxIntegration->screen());
- a.colormap = cmap;
- m_xWindow = XCreateWindow(m_glxIntegration->xDisplay(), m_glxIntegration->rootWindow(),0, 0, size.width(), size.height(),
- 0, visualInfo->depth, InputOutput, visualInfo->visual,
- CWBackPixel|CWBorderPixel|CWColormap, &a);
-
- XCompositeRedirectWindow(m_glxIntegration->xDisplay(), m_xWindow, CompositeRedirectManual);
- XMapWindow(m_glxIntegration->xDisplay(), m_xWindow);
-
- XSync(m_glxIntegration->xDisplay(), False);
- mBuffer = new QWaylandXCompositeBuffer(m_glxIntegration->waylandXComposite(),
- (uint32_t)m_xWindow,
- size);
-}
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h
deleted file mode 100644
index 45a77a299..000000000
--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxwindow.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDXCOMPOSITEGLXWINDOW_H
-#define QWAYLANDXCOMPOSITEGLXWINDOW_H
-
-#include <QtWaylandClient/private/qwaylandwindow_p.h>
-#include "qwaylandxcompositeglxintegration.h"
-#include "qwaylandxcompositeglxcontext.h"
-
-#include <QtCore/QWaitCondition>
-
-#include <QtWaylandClient/private/qwaylandbuffer_p.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-class QWaylandXCompositeGLXWindow : public QWaylandWindow
-{
-public:
- QWaylandXCompositeGLXWindow(QWindow *window, QWaylandXCompositeGLXIntegration *glxIntegration);
- WindowType windowType() const override;
-
- void setGeometry(const QRect &rect) override;
-
- Window xWindow() const;
-
- QWaylandBuffer *buffer() { return mBuffer; }
-
-private:
- void createSurface();
-
- QWaylandXCompositeGLXIntegration *m_glxIntegration = nullptr;
-
- Window m_xWindow = 0;
- GLXFBConfig m_config;
- QWaylandBuffer *mBuffer = nullptr;
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDXCOMPOSITEGLXWINDOW_H
diff --git a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri b/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri
deleted file mode 100644
index a2f5376a9..000000000
--- a/src/hardwareintegration/client/xcomposite-glx/xcomposite-glx.pri
+++ /dev/null
@@ -1,16 +0,0 @@
-INCLUDEPATH += $$PWD
-include ($$PWD/../xcomposite_share/xcomposite_share.pri)
-
-QMAKE_USE += wayland-client glx libdl
-
-QT += glx_support-private
-
-SOURCES += \
- $$PWD/qwaylandxcompositeglxcontext.cpp \
- $$PWD/qwaylandxcompositeglxintegration.cpp \
- $$PWD/qwaylandxcompositeglxwindow.cpp
-
-HEADERS += \
- $$PWD/qwaylandxcompositeglxcontext.h \
- $$PWD/qwaylandxcompositeglxintegration.h \
- $$PWD/qwaylandxcompositeglxwindow.h
diff --git a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp b/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp
deleted file mode 100644
index 5f1818cdf..000000000
--- a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qwaylandxcompositebuffer.h"
-
-#include <wayland-client.h>
-#include "wayland-xcomposite-client-protocol.h"
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-QWaylandXCompositeBuffer::QWaylandXCompositeBuffer(qt_xcomposite *xcomposite, uint32_t window, const QSize &size)
- :mSize(size)
-{
- mBuffer = qt_xcomposite_create_buffer(xcomposite,
- window,
- size.width(),
- size.height());
-}
-
-QSize QWaylandXCompositeBuffer::size() const
-{
- return mSize;
-}
-
-}
-
-QT_END_NAMESPACE
diff --git a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h b/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h
deleted file mode 100644
index 3ff7c51ce..000000000
--- a/src/hardwareintegration/client/xcomposite_share/qwaylandxcompositebuffer.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWAYLANDXCOMPOSITEBUFFER_H
-#define QWAYLANDXCOMPOSITEBUFFER_H
-
-#include <QtWaylandClient/private/qwaylandbuffer_p.h>
-#include <stdint.h>
-
-struct qt_xcomposite;
-struct wl_visual;
-
-QT_BEGIN_NAMESPACE
-
-namespace QtWaylandClient {
-
-class QWaylandXCompositeBuffer : public QWaylandBuffer
-{
-public:
- QWaylandXCompositeBuffer(qt_xcomposite *xcomposite,
- uint32_t window,
- const QSize &size);
-
- QSize size() const;
-private:
- QSize mSize;
-};
-
-}
-
-QT_END_NAMESPACE
-
-#endif // QWAYLANDXCOMPOSITEBUFFER_H
diff --git a/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri b/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri
deleted file mode 100644
index b18aa2d50..000000000
--- a/src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri
+++ /dev/null
@@ -1,11 +0,0 @@
-INCLUDEPATH += $$PWD
-
-QMAKE_USE += xcomposite x11
-CONFIG += wayland-scanner
-WAYLANDCLIENTSOURCES += $$PWD/../../../extensions/xcomposite.xml
-
-HEADERS += \
- $$PWD/qwaylandxcompositebuffer.h
-
-SOURCES += \
- $$PWD/qwaylandxcompositebuffer.cpp