From eb1c91b2185df1d57a87ed2b5335f3b0ba500c67 Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Thu, 21 Nov 2013 08:14:03 +0100 Subject: make compositor build with new directory layout Change-Id: I3ede73420af9cb95820a9bec4fe7305f1107e22d Reviewed-by: Andy Nichols --- src/plugins/hardwareintegration/client/client.pro | 16 ++ .../compositor/brcm-egl/brcm-egl.json | 3 + .../compositor/brcm-egl/brcm-egl.pro | 16 ++ .../compositor/brcm-egl/main.cpp | 74 ++++++ .../hardwareintegration/compositor/compositor.pro | 14 ++ .../compositor/wayland-egl/main.cpp | 74 ++++++ .../compositor/wayland-egl/wayland-egl.json | 3 + .../compositor/wayland-egl/wayland-egl.pro | 11 + .../compositor/xcomposite-egl/main.cpp | 74 ++++++ .../compositor/xcomposite-egl/xcomposite-egl.json | 3 + .../compositor/xcomposite-egl/xcomposite-egl.pro | 11 + .../compositor/xcomposite-glx/main.cpp | 74 ++++++ .../compositor/xcomposite-glx/xcomposite-glx.json | 3 + .../compositor/xcomposite-glx/xcomposite-glx.pro | 11 + .../hardwareintegration/hardwareintegration.pro | 7 + src/plugins/plugins.pro | 8 +- .../waylandcompositors/brcm-egl/brcm-egl.json | 3 - .../waylandcompositors/brcm-egl/brcm-egl.pro | 23 -- .../waylandcompositors/brcm-egl/brcmbuffer.cpp | 75 ------ .../waylandcompositors/brcm-egl/brcmbuffer.h | 81 ------- .../brcm-egl/brcmeglintegration.cpp | 184 -------------- .../brcm-egl/brcmeglintegration.h | 78 ------ src/plugins/waylandcompositors/brcm-egl/main.cpp | 74 ------ .../waylandcompositors/wayland-egl/main.cpp | 74 ------ .../wayland-egl/wayland-egl.json | 3 - .../waylandcompositors/wayland-egl/wayland-egl.pro | 23 -- .../wayland-egl/waylandeglintegration.cpp | 265 --------------------- .../wayland-egl/waylandeglintegration.h | 77 ------ .../waylandcompositors/waylandcompositors.pro | 17 -- .../waylandcompositors/xcomposite-egl/main.cpp | 74 ------ .../xcomposite-egl/xcomposite-egl.json | 3 - .../xcomposite-egl/xcomposite-egl.pro | 22 -- .../xcomposite-egl/xcompositeeglintegration.cpp | 150 ------------ .../xcomposite-egl/xcompositeeglintegration.h | 72 ------ .../waylandcompositors/xcomposite-glx/main.cpp | 74 ------ .../xcomposite-glx/xcomposite-glx.json | 3 - .../xcomposite-glx/xcomposite-glx.pro | 22 -- .../xcomposite-glx/xcompositeglxintegration.cpp | 160 ------------- .../xcomposite-glx/xcompositeglxintegration.h | 80 ------- .../xcomposite_share/xcomposite_share.pri | 15 -- .../xcomposite_share/xcompositebuffer.cpp | 69 ------ .../xcomposite_share/xcompositebuffer.h | 85 ------- .../xcomposite_share/xcompositehandler.cpp | 78 ------ .../xcomposite_share/xcompositehandler.h | 71 ------ .../xcomposite_share/xlibinclude.h | 78 ------ 45 files changed, 395 insertions(+), 2040 deletions(-) create mode 100644 src/plugins/hardwareintegration/client/client.pro create mode 100644 src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.json create mode 100644 src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.pro create mode 100644 src/plugins/hardwareintegration/compositor/brcm-egl/main.cpp create mode 100644 src/plugins/hardwareintegration/compositor/compositor.pro create mode 100644 src/plugins/hardwareintegration/compositor/wayland-egl/main.cpp create mode 100644 src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.json create mode 100644 src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro create mode 100644 src/plugins/hardwareintegration/compositor/xcomposite-egl/main.cpp create mode 100644 src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.json create mode 100644 src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pro create mode 100644 src/plugins/hardwareintegration/compositor/xcomposite-glx/main.cpp create mode 100644 src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.json create mode 100644 src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pro create mode 100644 src/plugins/hardwareintegration/hardwareintegration.pro delete mode 100644 src/plugins/waylandcompositors/brcm-egl/brcm-egl.json delete mode 100644 src/plugins/waylandcompositors/brcm-egl/brcm-egl.pro delete mode 100644 src/plugins/waylandcompositors/brcm-egl/brcmbuffer.cpp delete mode 100644 src/plugins/waylandcompositors/brcm-egl/brcmbuffer.h delete mode 100644 src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.cpp delete mode 100644 src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.h delete mode 100644 src/plugins/waylandcompositors/brcm-egl/main.cpp delete mode 100644 src/plugins/waylandcompositors/wayland-egl/main.cpp delete mode 100644 src/plugins/waylandcompositors/wayland-egl/wayland-egl.json delete mode 100644 src/plugins/waylandcompositors/wayland-egl/wayland-egl.pro delete mode 100644 src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp delete mode 100644 src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.h delete mode 100644 src/plugins/waylandcompositors/waylandcompositors.pro delete mode 100644 src/plugins/waylandcompositors/xcomposite-egl/main.cpp delete mode 100644 src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.json delete mode 100644 src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.pro delete mode 100644 src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.cpp delete mode 100644 src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.h delete mode 100644 src/plugins/waylandcompositors/xcomposite-glx/main.cpp delete mode 100644 src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.json delete mode 100644 src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.pro delete mode 100644 src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.cpp delete mode 100644 src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.h delete mode 100644 src/plugins/waylandcompositors/xcomposite_share/xcomposite_share.pri delete mode 100644 src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.cpp delete mode 100644 src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.h delete mode 100644 src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.cpp delete mode 100644 src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.h delete mode 100644 src/plugins/waylandcompositors/xcomposite_share/xlibinclude.h (limited to 'src/plugins') diff --git a/src/plugins/hardwareintegration/client/client.pro b/src/plugins/hardwareintegration/client/client.pro new file mode 100644 index 000000000..1b8f07640 --- /dev/null +++ b/src/plugins/hardwareintegration/client/client.pro @@ -0,0 +1,16 @@ +TEMPLATE=subdirs + +#config_wayland_egl { +# SUBDIRS += qwayland-egl +#} +#config_brcm_egl { +# SUBDIRS += qwayland-brcm-egl +#} +#config_xcomposite { +# config_egl { +# SUBDIRS += qwayland-xcomposite-egl +# } +# config_glx { +# SUBDIRS += qwayland-xcomposite-glx +# } +#} diff --git a/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.json b/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.json new file mode 100644 index 000000000..48611c6ab --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "wayland-brcm" ] +} diff --git a/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.pro b/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.pro new file mode 100644 index 000000000..d9bd92f4f --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/brcm-egl/brcm-egl.pro @@ -0,0 +1,16 @@ +PLUGIN_TYPE = wayland-graphics-integration +load(qt_plugin) + +QT = compositor compositor-private core-private gui-private + +OTHER_FILES += wayland_egl.json + +LIBS += -lEGL + +SOURCES += \ + main.cpp + +include($PWD/../../../../hardwareintegration/compositor/brcm-egl/brcm-egl.pri) + +OTHER_FILES += brcm-egl.json + diff --git a/src/plugins/hardwareintegration/compositor/brcm-egl/main.cpp b/src/plugins/hardwareintegration/compositor/brcm-egl/main.cpp new file mode 100644 index 000000000..0fecd2ec0 --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/brcm-egl/main.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "brcmeglintegration.h" + +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "brcm-egl.json") +public: + QStringList keys() const; + QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); +}; + +QStringList QWaylandIntegrationPlugin::keys() const +{ + QStringList list; + list << "wayland-brcm"; + return list; +} + +QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "wayland-brcm") + return new BrcmEglIntegration(); + + return 0; +} + +QT_END_NAMESPACE + +#include "main.moc" diff --git a/src/plugins/hardwareintegration/compositor/compositor.pro b/src/plugins/hardwareintegration/compositor/compositor.pro new file mode 100644 index 000000000..d0c8c1151 --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/compositor.pro @@ -0,0 +1,14 @@ +TEMPLATE = subdirs + +config_wayland_egl: \ + SUBDIRS += wayland-egl +config_brcm_egl: \ + SUBDIRS += brcm-egl + +config_xcomposite { + config_egl: \ + SUBDIRS += xcomposite-egl + + !contains(QT_CONFIG, opengles2):config_glx: \ + SUBDIRS += xcomposite-glx +} diff --git a/src/plugins/hardwareintegration/compositor/wayland-egl/main.cpp b/src/plugins/hardwareintegration/compositor/wayland-egl/main.cpp new file mode 100644 index 000000000..75a9fba29 --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/wayland-egl/main.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "waylandeglintegration.h" + +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "wayland-egl.json") +public: + QStringList keys() const; + QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); +}; + +QStringList QWaylandIntegrationPlugin::keys() const +{ + QStringList list; + list << "wayland-egl"; + return list; +} + +QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "wayland-egl") + return new WaylandEglIntegration(); + + return 0; +} + +QT_END_NAMESPACE + +#include "main.moc" diff --git a/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.json b/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.json new file mode 100644 index 000000000..4ea5bab90 --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "wayland-egl" ] +} diff --git a/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro b/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro new file mode 100644 index 000000000..5a65b0771 --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/wayland-egl/wayland-egl.pro @@ -0,0 +1,11 @@ +PLUGIN_TYPE = wayland-graphics-integration +load(qt_plugin) + +QT = compositor compositor-private core-private gui-private + +OTHER_FILES += wayland-egl.json + +SOURCES += \ + main.cpp + +include(../../../../hardwareintegration/compositor/wayland-egl/wayland-egl.pri) diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-egl/main.cpp b/src/plugins/hardwareintegration/compositor/xcomposite-egl/main.cpp new file mode 100644 index 000000000..3540d3517 --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/xcomposite-egl/main.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "xcompositeeglintegration.h" + +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "xcomposite-egl.json") +public: + QStringList keys() const; + QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); +}; + +QStringList QWaylandIntegrationPlugin::keys() const +{ + QStringList list; + list << "wayland-xcomposite"; + return list; +} + +QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "wayland-xcomposite") + return new XCompositeEglIntegration(); + + return 0; +} + +QT_END_NAMESPACE + +#include "main.moc" diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.json b/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.json new file mode 100644 index 000000000..8ccd5b46b --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "wayland-xcomposite" ] +} diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pro b/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pro new file mode 100644 index 000000000..a5abe63c6 --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pro @@ -0,0 +1,11 @@ +PLUGIN_TYPE = wayland-graphics-integration +load(qt_plugin) + +QT += compositor compositor-private core-private gui-private + +OTHER_FILES += xcomposite-egl.json + +SOURCES += \ + main.cpp + +include(../../../../hardwareintegration/compositor/xcomposite-egl/xcomposite-egl.pri) diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-glx/main.cpp b/src/plugins/hardwareintegration/compositor/xcomposite-glx/main.cpp new file mode 100644 index 000000000..3b6c9f9c1 --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/xcomposite-glx/main.cpp @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "xcompositeglxintegration.h" + +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "xcomposite-glx.json") +public: + QStringList keys() const; + QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); +}; + +QStringList QWaylandIntegrationPlugin::keys() const +{ + QStringList list; + list << "wayland-xcomposite-glx"; + return list; +} + +QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +{ + Q_UNUSED(paramList); + if (system.toLower() == "wayland-xcomposite-glx") + return new XCompositeGLXIntegration(); + + return 0; +} + +QT_END_NAMESPACE + +#include "main.moc" diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.json b/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.json new file mode 100644 index 000000000..8ccd5b46b --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.json @@ -0,0 +1,3 @@ +{ + "Keys": [ "wayland-xcomposite" ] +} diff --git a/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pro b/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pro new file mode 100644 index 000000000..9c320af2f --- /dev/null +++ b/src/plugins/hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pro @@ -0,0 +1,11 @@ +PLUGIN_TYPE = wayland-graphics-integration +load(qt_plugin) + +QT += compositor compositor-private core-private gui-private + +OTHER_FILES += xcomposite-glx.json + +SOURCES += \ + main.cpp + +include(../../../../hardwareintegration/compositor/xcomposite-glx/xcomposite-glx.pri) diff --git a/src/plugins/hardwareintegration/hardwareintegration.pro b/src/plugins/hardwareintegration/hardwareintegration.pro new file mode 100644 index 000000000..4f5ec1458 --- /dev/null +++ b/src/plugins/hardwareintegration/hardwareintegration.pro @@ -0,0 +1,7 @@ +TEMPLATE=subdirs + +SUBDIRS += client +#The compositor plugins are only useful with QtCompositor +contains(CONFIG, wayland-compositor) { + SUBDIRS += compositor +} diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 7325e57f1..554dd40cd 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -1,8 +1,2 @@ TEMPLATE=subdirs -SUBDIRS += platforms - - -#The compositor plugins are only useful with QtCompositor -contains(CONFIG, wayland-compositor) { - SUBDIRS += waylandcompositors -} +SUBDIRS += platforms hardwareintegration diff --git a/src/plugins/waylandcompositors/brcm-egl/brcm-egl.json b/src/plugins/waylandcompositors/brcm-egl/brcm-egl.json deleted file mode 100644 index 48611c6ab..000000000 --- a/src/plugins/waylandcompositors/brcm-egl/brcm-egl.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "wayland-brcm" ] -} diff --git a/src/plugins/waylandcompositors/brcm-egl/brcm-egl.pro b/src/plugins/waylandcompositors/brcm-egl/brcm-egl.pro deleted file mode 100644 index db26b3b8b..000000000 --- a/src/plugins/waylandcompositors/brcm-egl/brcm-egl.pro +++ /dev/null @@ -1,23 +0,0 @@ -PLUGIN_TYPE = waylandcompositors -load(qt_plugin) - -QT = compositor compositor-private core-private gui-private - -OTHER_FILES += wayland_egl.json - -LIBS += -lwayland-server -lEGL - -SOURCES += \ - brcmeglintegration.cpp \ - brcmbuffer.cpp \ - main.cpp - - -HEADERS += \ - brcmeglintegration.h \ - brcmbuffer.h - -OTHER_FILES += brcm-egl.json - -CONFIG += wayland-scanner -WAYLANDSERVERSOURCES += $$PWD/../../../extensions/brcm.xml $$PWD/../../../3rdparty/protocol/wayland.xml diff --git a/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.cpp b/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.cpp deleted file mode 100644 index e4fbfb553..000000000 --- a/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "brcmbuffer.h" - -#include - -#define EGL_EGLEXT_PROTOTYPES -#include - -QT_BEGIN_NAMESPACE - -BrcmBuffer::BrcmBuffer(struct ::wl_client *client, uint32_t id, const QSize &size, EGLint *data, size_t count) - : QtWaylandServer::wl_buffer(client, id) - , m_handle(count) - , m_invertedY(false) - , m_size(size) -{ - for (size_t i = 0; i < count; ++i) - m_handle[i] = data[i]; -} - -BrcmBuffer::~BrcmBuffer() -{ - eglDestroyGlobalImageBRCM(handle()); -} - -void BrcmBuffer::buffer_destroy_resource(Resource *) -{ - delete this; -} - -void BrcmBuffer::buffer_destroy(Resource *resource) -{ - wl_resource_destroy(resource->handle); -} - -QT_END_NAMESPACE diff --git a/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.h b/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.h deleted file mode 100644 index 6ec5868f9..000000000 --- a/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BRCMBUFFER_H -#define BRCMBUFFER_H - -#include -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class BrcmBuffer : public QtWaylandServer::wl_buffer -{ -public: - BrcmBuffer(struct ::wl_client *client, uint32_t id, const QSize &size, EGLint *data, size_t count); - ~BrcmBuffer(); - - bool isYInverted() const { return m_invertedY; } - void setInvertedY(bool inverted) { m_invertedY = inverted; } - - EGLint *handle() { return m_handle.data(); } - - QSize size() { return m_size; } - - static BrcmBuffer *fromResource(struct ::wl_resource *resource) { return static_cast(Resource::fromResource(resource)->buffer); } - -protected: - void buffer_destroy_resource(Resource *resource) Q_DECL_OVERRIDE; - void buffer_destroy(Resource *resource) Q_DECL_OVERRIDE; - -private: - QVector m_handle; - bool m_invertedY; - QSize m_size; -}; - -QT_END_NAMESPACE - -#endif // BRCMBUFFER_H diff --git a/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.cpp b/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.cpp deleted file mode 100644 index 0ef8318fb..000000000 --- a/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "brcmeglintegration.h" -#include "brcmbuffer.h" -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#define EGL_EGLEXT_PROTOTYPES -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class BrcmEglIntegrationPrivate -{ -public: - BrcmEglIntegrationPrivate() - : egl_display(EGL_NO_DISPLAY) - , valid(false) - { } - EGLDisplay egl_display; - bool valid; - PFNEGLQUERYGLOBALIMAGEBRCMPROC eglQueryGlobalImageBRCM; - PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; - PFNEGLCREATEIMAGEKHRPROC eglCreateImageKHR; - PFNEGLDESTROYIMAGEKHRPROC eglDestroyImageKHR; -}; - -BrcmEglIntegration::BrcmEglIntegration() - : QWaylandGraphicsHardwareIntegration() - , QtWaylandServer::qt_brcm() - , d_ptr(new BrcmEglIntegrationPrivate) -{ -} - -void BrcmEglIntegration::initializeHardware(QtWayland::Display *waylandDisplay) -{ - Q_D(BrcmEglIntegration); - - QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); - if (nativeInterface) { - d->egl_display = nativeInterface->nativeResourceForIntegration("EglDisplay"); - if (!d->egl_display) - qWarning("Failed to acquire EGL display from platform integration"); - - d->eglQueryGlobalImageBRCM = eglQueryGlobalImageBRCM; - - if (!d->eglQueryGlobalImageBRCM) { - qWarning("Failed to resolve eglQueryGlobalImageBRCM"); - return; - } - - d->glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)eglGetProcAddress("glEGLImageTargetTexture2DOES"); - - if (!d->glEGLImageTargetTexture2DOES) { - qWarning("Failed to resolve glEGLImageTargetTexture2DOES"); - return; - } - - d->eglCreateImageKHR = (PFNEGLCREATEIMAGEKHRPROC)eglGetProcAddress("eglCreateImageKHR"); - - if (!d->eglCreateImageKHR) { - qWarning("Failed to resolve eglCreateImageKHR"); - return; - } - - d->eglDestroyImageKHR = (PFNEGLDESTROYIMAGEKHRPROC)eglGetProcAddress("eglDestroyImageKHR"); - - if (!d->eglDestroyImageKHR) { - qWarning("Failed to resolve eglDestroyImageKHR"); - return; - } - d->valid = true; - init(waylandDisplay->handle()); - } -} - -GLuint BrcmEglIntegration::createTextureFromBuffer(struct ::wl_resource *buffer, QOpenGLContext *) -{ - Q_D(BrcmEglIntegration); - if (!d->valid) { - qWarning("createTextureFromBuffer() failed\n"); - return 0; - } - - BrcmBuffer *brcmBuffer = BrcmBuffer::fromResource(buffer); - - if (!d->eglQueryGlobalImageBRCM(brcmBuffer->handle(), brcmBuffer->handle() + 2)) { - qWarning("eglQueryGlobalImageBRCM failed!"); - return 0; - } - - EGLImageKHR image = d->eglCreateImageKHR(d->egl_display, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, (EGLClientBuffer)brcmBuffer->handle(), NULL); - if (image == EGL_NO_IMAGE_KHR) - qWarning("eglCreateImageKHR() failed: %x\n", eglGetError()); - - GLuint textureId; - glGenTextures(1, &textureId); - - glBindTexture(GL_TEXTURE_2D, textureId); - - d->glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image); - - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - d->eglDestroyImageKHR(d->egl_display, image); - - return textureId; -} - -bool BrcmEglIntegration::isYInverted(struct ::wl_resource *) const -{ - return false; -} - -void BrcmEglIntegration::brcm_bind_resource(Resource *) -{ -} - -void BrcmEglIntegration::brcm_create_buffer(Resource *resource, uint32_t id, int32_t width, int32_t height, wl_array *data) -{ - new BrcmBuffer(resource->client(), id, QSize(width, height), static_cast(data->data), data->size / sizeof(EGLint)); -} - -QSize BrcmEglIntegration::bufferSize(struct ::wl_resource *buffer) const -{ - BrcmBuffer *brcmBuffer = BrcmBuffer::fromResource(buffer); - - return brcmBuffer->size(); -} - -QT_END_NAMESPACE diff --git a/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.h b/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.h deleted file mode 100644 index 229905612..000000000 --- a/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BRCMEGLINTEGRATION_H -#define BRCMEGLINTEGRATION_H - -#include -#include "qwayland-server-brcm.h" - -#include - -QT_BEGIN_NAMESPACE - -class BrcmEglIntegrationPrivate; - -class BrcmEglIntegration : public QWaylandGraphicsHardwareIntegration, public QtWaylandServer::qt_brcm -{ - Q_DECLARE_PRIVATE(BrcmEglIntegration) -public: - BrcmEglIntegration(); - - void initializeHardware(QtWayland::Display *waylandDisplay) Q_DECL_OVERRIDE; - - GLuint createTextureFromBuffer(struct ::wl_resource *buffer, QOpenGLContext *context) Q_DECL_OVERRIDE; - bool isYInverted(struct ::wl_resource *) const Q_DECL_OVERRIDE; - - QSize bufferSize(struct ::wl_resource *buffer) const Q_DECL_OVERRIDE; - -protected: - void brcm_bind_resource(Resource *resource) Q_DECL_OVERRIDE; - void brcm_create_buffer(Resource *resource, uint32_t id, int32_t width, int32_t height, wl_array *data) Q_DECL_OVERRIDE; - -private: - Q_DISABLE_COPY(BrcmEglIntegration) - QScopedPointer d_ptr; -}; - -QT_END_NAMESPACE - -#endif // BRCMEGLINTEGRATION_H - diff --git a/src/plugins/waylandcompositors/brcm-egl/main.cpp b/src/plugins/waylandcompositors/brcm-egl/main.cpp deleted file mode 100644 index 0fecd2ec0..000000000 --- a/src/plugins/waylandcompositors/brcm-egl/main.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "brcmeglintegration.h" - -QT_BEGIN_NAMESPACE - -class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "brcm-egl.json") -public: - QStringList keys() const; - QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); -}; - -QStringList QWaylandIntegrationPlugin::keys() const -{ - QStringList list; - list << "wayland-brcm"; - return list; -} - -QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - if (system.toLower() == "wayland-brcm") - return new BrcmEglIntegration(); - - return 0; -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/waylandcompositors/wayland-egl/main.cpp b/src/plugins/waylandcompositors/wayland-egl/main.cpp deleted file mode 100644 index 75a9fba29..000000000 --- a/src/plugins/waylandcompositors/wayland-egl/main.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "waylandeglintegration.h" - -QT_BEGIN_NAMESPACE - -class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "wayland-egl.json") -public: - QStringList keys() const; - QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); -}; - -QStringList QWaylandIntegrationPlugin::keys() const -{ - QStringList list; - list << "wayland-egl"; - return list; -} - -QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - if (system.toLower() == "wayland-egl") - return new WaylandEglIntegration(); - - return 0; -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/waylandcompositors/wayland-egl/wayland-egl.json b/src/plugins/waylandcompositors/wayland-egl/wayland-egl.json deleted file mode 100644 index 4ea5bab90..000000000 --- a/src/plugins/waylandcompositors/wayland-egl/wayland-egl.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "wayland-egl" ] -} diff --git a/src/plugins/waylandcompositors/wayland-egl/wayland-egl.pro b/src/plugins/waylandcompositors/wayland-egl/wayland-egl.pro deleted file mode 100644 index e06bf85bf..000000000 --- a/src/plugins/waylandcompositors/wayland-egl/wayland-egl.pro +++ /dev/null @@ -1,23 +0,0 @@ -PLUGIN_TYPE = waylandcompositors -load(qt_plugin) - -QT = compositor compositor-private core-private gui-private - -OTHER_FILES += wayland-egl.json - -CONFIG += wayland-scanner -WAYLANDSERVERSOURCES += $$PWD/../../../3rdparty/protocol/wayland.xml - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += wayland-server wayland-egl egl -} else { - LIBS += -lwayland-egl -lwayland-server -lEGL -} - -SOURCES += \ - waylandeglintegration.cpp \ - main.cpp - -HEADERS += \ - waylandeglintegration.h diff --git a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp b/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp deleted file mode 100644 index e01de7984..000000000 --- a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "waylandeglintegration.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#ifndef EGL_WL_bind_wayland_display -typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_buffer *buffer, EGLint attribute, EGLint *value); -#endif - -#ifndef EGL_KHR_image -typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); -typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); -#endif - -#ifndef GL_OES_EGL_image -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); -typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); -#endif - -QT_BEGIN_NAMESPACE - -class WaylandEglIntegrationPrivate -{ -public: - WaylandEglIntegrationPrivate() - : egl_display(EGL_NO_DISPLAY) - , valid(false) - , display_bound(false) - , flipperConnected(false) - , egl_bind_wayland_display(0) - , egl_unbind_wayland_display(0) - , egl_query_wayland_buffer(0) - , egl_create_image(0) - , egl_destroy_image(0) - , gl_egl_image_target_texture_2d(0) - { } - EGLDisplay egl_display; - bool valid; - bool display_bound; - bool flipperConnected; - PFNEGLBINDWAYLANDDISPLAYWL egl_bind_wayland_display; - PFNEGLUNBINDWAYLANDDISPLAYWL egl_unbind_wayland_display; - PFNEGLQUERYWAYLANDBUFFERWL egl_query_wayland_buffer; - - PFNEGLCREATEIMAGEKHRPROC egl_create_image; - PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image; - - PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d; -}; - -WaylandEglIntegration::WaylandEglIntegration() - : QWaylandGraphicsHardwareIntegration() - , d_ptr(new WaylandEglIntegrationPrivate) -{ -} - -void WaylandEglIntegration::initializeHardware(QtWayland::Display *waylandDisplay) -{ - Q_D(WaylandEglIntegration); - - const bool ignoreBindDisplay = !qgetenv("QT_WAYLAND_IGNORE_BIND_DISPLAY").isEmpty(); - - QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); - if (!nativeInterface) { - qWarning("Failed to initialize egl display. No native platform interface available.\n"); - return; - } - - d->egl_display = nativeInterface->nativeResourceForWindow("EglDisplay", m_compositor->window()); - if (!d->egl_display) { - qWarning("Failed to initialize egl display. Could not get EglDisplay for window.\n"); - return; - } - - const char *extensionString = eglQueryString(d->egl_display, EGL_EXTENSIONS); - if ((!extensionString || !strstr(extensionString, "EGL_WL_bind_wayland_display")) && !ignoreBindDisplay) { - qWarning("Failed to initialize egl display. There is no EGL_WL_bind_wayland_display extension.\n"); - return; - } - - d->egl_bind_wayland_display = reinterpret_cast(eglGetProcAddress("eglBindWaylandDisplayWL")); - d->egl_unbind_wayland_display = reinterpret_cast(eglGetProcAddress("eglUnbindWaylandDisplayWL")); - if (!d->egl_bind_wayland_display || !d->egl_unbind_wayland_display && !ignoreBindDisplay) { - qWarning("Failed to initialize egl display. Could not find eglBindWaylandDisplayWL and eglUnbindWaylandDisplayWL.\n"); - return; - } - - d->egl_query_wayland_buffer = reinterpret_cast(eglGetProcAddress("eglQueryWaylandBufferWL")); - if (!d->egl_query_wayland_buffer) { - qWarning("Failed to initialize egl display. Could not find eglQueryWaylandBufferWL.\n"); - return; - } - - d->egl_create_image = reinterpret_cast(eglGetProcAddress("eglCreateImageKHR")); - d->egl_destroy_image = reinterpret_cast(eglGetProcAddress("eglDestroyImageKHR")); - if (!d->egl_create_image || !d->egl_destroy_image) { - qWarning("Failed to initialize egl display. Could not find eglCreateImageKHR and eglDestroyImageKHR.\n"); - return; - } - - d->gl_egl_image_target_texture_2d = reinterpret_cast(eglGetProcAddress("glEGLImageTargetTexture2DOES")); - if (!d->gl_egl_image_target_texture_2d) { - qWarning("Failed to initialize egl display. Could not find glEGLImageTargetTexture2DOES.\n"); - return; - } - - if (d->egl_bind_wayland_display && d->egl_unbind_wayland_display) { - d->display_bound = d->egl_bind_wayland_display(d->egl_display, waylandDisplay->handle()); - if (!d->display_bound && !ignoreBindDisplay) { - qWarning("Failed to initialize egl display. Could not bind Wayland display.\n"); - return; - } - } - - d->valid = true; - - qWarning("EGL Wayland extension successfully initialized.%s\n", !d->display_bound ? " eglBindWaylandDisplayWL ignored" : ""); -} - -GLuint WaylandEglIntegration::createTextureFromBuffer(struct ::wl_resource *buffer, QOpenGLContext *) -{ - Q_D(WaylandEglIntegration); - if (!d->valid) { - qWarning("createTextureFromBuffer() failed\n"); - return 0; - } - - EGLImageKHR image = d->egl_create_image(d->egl_display, EGL_NO_CONTEXT, - EGL_WAYLAND_BUFFER_WL, - buffer, NULL); - - GLuint textureId; - glGenTextures(1,&textureId); - - glBindTexture(GL_TEXTURE_2D, textureId); - - d->gl_egl_image_target_texture_2d(GL_TEXTURE_2D, image); - - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - - d->egl_destroy_image(d->egl_display, image); - - return textureId; -} - -bool WaylandEglIntegration::isYInverted(struct ::wl_resource *buffer) const -{ - Q_D(const WaylandEglIntegration); - -#if defined(EGL_WAYLAND_Y_INVERTED_WL) - EGLint isYInverted; - EGLBoolean ret; - ret = d->egl_query_wayland_buffer(d->egl_display, reinterpret_cast(buffer), EGL_WAYLAND_Y_INVERTED_WL, &isYInverted); - - // Yes, this looks strange, but the specification says that EGL_FALSE return - // value (not supported) should be treated the same as EGL_TRUE return value - // and EGL_TRUE in value. - if (ret == EGL_FALSE || isYInverted == EGL_TRUE) - return true; -#endif - - return QWaylandGraphicsHardwareIntegration::isYInverted(buffer); -} - - -bool WaylandEglIntegration::setDirectRenderSurface(QWaylandSurface *surface) -{ - Q_D(WaylandEglIntegration); - - QPlatformScreen *screen = QPlatformScreen::platformScreenForWindow(m_compositor->window()); - QPlatformScreenPageFlipper *flipper = screen ? screen->pageFlipper() : 0; - if (flipper && !d->flipperConnected) { - QObject::connect(flipper, SIGNAL(bufferReleased(QPlatformScreenBuffer*)), m_compositor->handle(), SLOT(releaseBuffer(QPlatformScreenBuffer*))); - d->flipperConnected = true; - } - Q_UNUSED(surface); - return flipper; -} - -void *WaylandEglIntegration::lockNativeBuffer(struct ::wl_resource *buffer, QOpenGLContext *) const -{ - Q_D(const WaylandEglIntegration); - - EGLImageKHR image = d->egl_create_image(d->egl_display, EGL_NO_CONTEXT, - EGL_WAYLAND_BUFFER_WL, - buffer, NULL); - return image; -} - -void WaylandEglIntegration::unlockNativeBuffer(void *native_buffer, QOpenGLContext *) const -{ - Q_D(const WaylandEglIntegration); - EGLImageKHR image = static_cast(native_buffer); - - d->egl_destroy_image(d->egl_display, image); -} - -QSize WaylandEglIntegration::bufferSize(struct ::wl_resource *buffer) const -{ - Q_D(const WaylandEglIntegration); - - int width, height; - d->egl_query_wayland_buffer(d->egl_display, reinterpret_cast(buffer), EGL_WIDTH, &width); - d->egl_query_wayland_buffer(d->egl_display, reinterpret_cast(buffer), EGL_HEIGHT, &height); - - return QSize(width, height); -} - -QT_END_NAMESPACE diff --git a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.h b/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.h deleted file mode 100644 index ce3284291..000000000 --- a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef WAYLANDEGLINTEGRATION_H -#define WAYLANDEGLINTEGRATION_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class WaylandEglIntegrationPrivate; - -class WaylandEglIntegration : public QWaylandGraphicsHardwareIntegration -{ - Q_DECLARE_PRIVATE(WaylandEglIntegration) -public: - WaylandEglIntegration(); - - void initializeHardware(QtWayland::Display *waylandDisplay) Q_DECL_OVERRIDE; - - GLuint createTextureFromBuffer(struct ::wl_resource *buffer, QOpenGLContext *context) Q_DECL_OVERRIDE; - bool isYInverted(struct ::wl_resource *) const Q_DECL_OVERRIDE; - - bool setDirectRenderSurface(QWaylandSurface *) Q_DECL_OVERRIDE; - - void *lockNativeBuffer(struct ::wl_resource *buffer, QOpenGLContext *context) const Q_DECL_OVERRIDE; - void unlockNativeBuffer(void *native_buffer, QOpenGLContext *context) const Q_DECL_OVERRIDE; - - QSize bufferSize(struct ::wl_resource *buffer) const Q_DECL_OVERRIDE; - -private: - Q_DISABLE_COPY(WaylandEglIntegration) - QScopedPointer d_ptr; -}; - -QT_END_NAMESPACE - -#endif // WAYLANDEGLINTEGRATION_H - diff --git a/src/plugins/waylandcompositors/waylandcompositors.pro b/src/plugins/waylandcompositors/waylandcompositors.pro deleted file mode 100644 index 8a4d9b04a..000000000 --- a/src/plugins/waylandcompositors/waylandcompositors.pro +++ /dev/null @@ -1,17 +0,0 @@ -TEMPLATE = subdirs - -!isEqual(QT_WAYLAND_GL_CONFIG,nogl) { - config_wayland_egl { - SUBDIRS += wayland-egl - } - config_brcm_egl { - SUBDIRS += brcm-egl - } - config_xcomposite { - config_egl { - SUBDIRS += xcomposite-egl - } else:config_glx { - SUBDIRS += xcomposite-glx - } - } -} diff --git a/src/plugins/waylandcompositors/xcomposite-egl/main.cpp b/src/plugins/waylandcompositors/xcomposite-egl/main.cpp deleted file mode 100644 index 3540d3517..000000000 --- a/src/plugins/waylandcompositors/xcomposite-egl/main.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "xcompositeeglintegration.h" - -QT_BEGIN_NAMESPACE - -class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "xcomposite-egl.json") -public: - QStringList keys() const; - QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); -}; - -QStringList QWaylandIntegrationPlugin::keys() const -{ - QStringList list; - list << "wayland-xcomposite"; - return list; -} - -QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - if (system.toLower() == "wayland-xcomposite") - return new XCompositeEglIntegration(); - - return 0; -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.json b/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.json deleted file mode 100644 index 8ccd5b46b..000000000 --- a/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "wayland-xcomposite" ] -} diff --git a/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.pro b/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.pro deleted file mode 100644 index 3d8f793e9..000000000 --- a/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.pro +++ /dev/null @@ -1,22 +0,0 @@ -PLUGIN_TYPE = waylandcompositors -load(qt_plugin) - -QT = compositor compositor-private core-private gui-private - -OTHER_FILES += xcomposite-egl.json - -include (../xcomposite_share/xcomposite_share.pri) - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += xcomposite egl x11 wayland-server -} else { - LIBS += -lXcomposite -lEGL -lX11 -} - -HEADERS += \ - xcompositeeglintegration.h - -SOURCES += \ - xcompositeeglintegration.cpp \ - main.cpp diff --git a/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.cpp b/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.cpp deleted file mode 100644 index b80858b2c..000000000 --- a/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "xcompositeeglintegration.h" - -#include "wayland-xcomposite-server-protocol.h" - -#include -#include -#include -#include - -#include "xcompositebuffer.h" -#include "xcompositehandler.h" -#include - -#include - -QT_BEGIN_NAMESPACE - -QVector eglbuildSpec() -{ - QVector spec; - - spec.append(EGL_SURFACE_TYPE); spec.append(EGL_WINDOW_BIT | EGL_PIXMAP_BIT); - spec.append(EGL_RENDERABLE_TYPE); spec.append(EGL_OPENGL_ES2_BIT); - spec.append(EGL_BIND_TO_TEXTURE_RGBA); spec.append(EGL_TRUE); - spec.append(EGL_ALPHA_SIZE); spec.append(8); - spec.append(EGL_NONE); - return spec; -} - -XCompositeEglIntegration::XCompositeEglIntegration() - : QWaylandGraphicsHardwareIntegration() - , mDisplay(0) -{ - -} - -void XCompositeEglIntegration::initializeHardware(QtWayland::Display *) -{ - QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); - if (nativeInterface) { - mDisplay = static_cast(nativeInterface->nativeResourceForWindow("Display",m_compositor->window())); - if (!mDisplay) - qFatal("could not retireve Display from platform integration"); - mEglDisplay = static_cast(nativeInterface->nativeResourceForWindow("EGLDisplay",m_compositor->window())); - if (!mEglDisplay) - qFatal("could not retrieve EGLDisplay from platform integration"); - } else { - qFatal("Platform integration doesn't have native interface"); - } - mScreen = XDefaultScreen(mDisplay); - new XCompositeHandler(m_compositor->handle(), mDisplay); -} - -GLuint XCompositeEglIntegration::createTextureFromBuffer(struct ::wl_resource *buffer, QOpenGLContext *) -{ - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(buffer); - Pixmap pixmap = XCompositeNameWindowPixmap(mDisplay, compositorBuffer->window()); - - QVector eglConfigSpec = eglbuildSpec(); - - EGLint matching = 0; - EGLConfig config; - bool matched = eglChooseConfig(mEglDisplay,eglConfigSpec.constData(),&config,1,&matching); - if (!matched || !matching) { - qWarning("Could not retrieve a suitable EGL config"); - return 0; - } - - QVector attribList; - - attribList.append(EGL_TEXTURE_FORMAT); - attribList.append(EGL_TEXTURE_RGBA); - attribList.append(EGL_TEXTURE_TARGET); - attribList.append(EGL_TEXTURE_2D); - attribList.append(EGL_NONE); - - EGLSurface surface = eglCreatePixmapSurface(mEglDisplay,config,pixmap,attribList.constData()); - if (surface == EGL_NO_SURFACE) { - qDebug() << "Failed to create eglsurface" << pixmap << compositorBuffer->window(); - } - - compositorBuffer->setInvertedY(true); - - GLuint textureId; - glGenTextures(1,&textureId); - glBindTexture(GL_TEXTURE_2D, textureId); - - if (!eglBindTexImage(mEglDisplay,surface,EGL_BACK_BUFFER)) { - qDebug() << "Failed to bind"; - } - - // eglDestroySurface(mEglDisplay,surface); - - return textureId; -} - -bool XCompositeEglIntegration::isYInverted(struct ::wl_resource *buffer) const -{ - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(buffer); - return compositorBuffer->isYInverted(); -} - -QSize XCompositeEglIntegration::bufferSize(struct ::wl_resource *buffer) const -{ - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(buffer); - - return compositorBuffer->size(); -} - -QT_END_NAMESPACE diff --git a/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.h b/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.h deleted file mode 100644 index 562fce140..000000000 --- a/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XCOMPOSITEEGLINTEGRATION_H -#define XCOMPOSITEEGLINTEGRATION_H - -#include - -#include "xlibinclude.h" - -#include - -QT_BEGIN_NAMESPACE - -class XCompositeEglIntegration : public QWaylandGraphicsHardwareIntegration -{ -public: - XCompositeEglIntegration(); - - void initializeHardware(QtWayland::Display *waylandDisplay) Q_DECL_OVERRIDE; - - GLuint createTextureFromBuffer(struct ::wl_resource *buffer, QOpenGLContext *context) Q_DECL_OVERRIDE; - bool isYInverted(struct ::wl_resource *) const Q_DECL_OVERRIDE; - - QSize bufferSize(struct ::wl_resource *buffer) const Q_DECL_OVERRIDE; - -private: - Display *mDisplay; - EGLDisplay mEglDisplay; - int mScreen; -}; - -QT_END_NAMESPACE - -#endif // XCOMPOSITEEGLINTEGRATION_H diff --git a/src/plugins/waylandcompositors/xcomposite-glx/main.cpp b/src/plugins/waylandcompositors/xcomposite-glx/main.cpp deleted file mode 100644 index fdc7037ea..000000000 --- a/src/plugins/waylandcompositors/xcomposite-glx/main.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "xcompositeglxintegration.h" - -QT_BEGIN_NAMESPACE - -class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "xcomposite-glx.json") -public: - QStringList keys() const; - QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); -}; - -QStringList QWaylandIntegrationPlugin::keys() const -{ - QStringList list; - list << "wayland-xcomposite"; - return list; -} - -QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) -{ - Q_UNUSED(paramList); - if (system.toLower() == "wayland-xcomposite") - return new XCompositeGLXIntegration(); - - return 0; -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.json b/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.json deleted file mode 100644 index 8ccd5b46b..000000000 --- a/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": [ "wayland-xcomposite" ] -} diff --git a/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.pro b/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.pro deleted file mode 100644 index 0d45d8c63..000000000 --- a/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.pro +++ /dev/null @@ -1,22 +0,0 @@ -PLUGIN_TYPE = waylandcompositors -load(qt_plugin) - -QT = compositor compositor-private core-private gui-private - -OTHER_FILES += xcomposite-glx.json - -include (../xcomposite_share/xcomposite_share.pri) - -!contains(QT_CONFIG, no-pkg-config) { - CONFIG += link_pkgconfig - PKGCONFIG += xcomposite gl x11 wayland-server -} else { - LIBS += -lXcomposite -lGL -lX11 -} - -HEADERS += \ - xcompositeglxintegration.h - -SOURCES += \ - xcompositeglxintegration.cpp \ - main.cpp diff --git a/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.cpp b/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.cpp deleted file mode 100644 index 421e5df1a..000000000 --- a/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "xcompositeglxintegration.h" - -#include -#include "wayland-xcomposite-server-protocol.h" - -#include -#include -#include - -#include "xcompositebuffer.h" -#include "xcompositehandler.h" -#include - -#include - -QT_BEGIN_NAMESPACE - -QVector qglx_buildSpec() -{ - QVector spec(48); - int i = 0; - - spec[i++] = GLX_LEVEL; - spec[i++] = 0; - spec[i++] = GLX_DRAWABLE_TYPE; spec[i++] = GLX_PIXMAP_BIT | GLX_WINDOW_BIT; - spec[i++] = GLX_BIND_TO_TEXTURE_TARGETS_EXT; spec[i++] = GLX_TEXTURE_2D_BIT_EXT; - spec[i++] = GLX_BIND_TO_TEXTURE_RGB_EXT; spec[i++] = true; - - spec[i++] = 0; - return spec; -} - - -XCompositeGLXIntegration::XCompositeGLXIntegration() - : QWaylandGraphicsHardwareIntegration() - , mDisplay(0) - , mHandler(0) -{ -} - -XCompositeGLXIntegration::~XCompositeGLXIntegration() -{ - delete mHandler; -} - -void XCompositeGLXIntegration::initializeHardware(QtWayland::Display *) -{ - QPlatformNativeInterface *nativeInterface = QGuiApplicationPrivate::platformIntegration()->nativeInterface(); - if (nativeInterface) { - mDisplay = static_cast(nativeInterface->nativeResourceForWindow("Display",m_compositor->window())); - if (!mDisplay) - qFatal("could not retireve Display from platform integration"); - } else { - qFatal("Platform integration doesn't have native interface"); - } - mScreen = XDefaultScreen(mDisplay); - - mHandler = new XCompositeHandler(m_compositor->handle(), mDisplay); - - QOpenGLContext *glContext = new QOpenGLContext(); - glContext->create(); - - m_glxBindTexImageEXT = reinterpret_cast(glContext->getProcAddress("glXBindTexImageEXT")); - if (!m_glxBindTexImageEXT) { - qDebug() << "Did not find glxBindTexImageExt, everything will FAIL!"; - } - m_glxReleaseTexImageEXT = reinterpret_cast(glContext->getProcAddress("glXReleaseTexImageEXT")); - if (!m_glxReleaseTexImageEXT) { - qDebug() << "Did not find glxReleaseTexImageExt"; - } - - delete glContext; -} - -GLuint XCompositeGLXIntegration::createTextureFromBuffer(struct ::wl_resource *buffer, QOpenGLContext *) -{ - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(buffer); - Pixmap pixmap = XCompositeNameWindowPixmap(mDisplay, compositorBuffer->window()); - - QVector glxConfigSpec = qglx_buildSpec(); - int numberOfConfigs; - GLXFBConfig *configs = glXChooseFBConfig(mDisplay,mScreen,glxConfigSpec.constData(),&numberOfConfigs); - - QVector attribList; - attribList.append(GLX_TEXTURE_FORMAT_EXT); - attribList.append(GLX_TEXTURE_FORMAT_RGB_EXT); - attribList.append(GLX_TEXTURE_TARGET_EXT); - attribList.append(GLX_TEXTURE_2D_EXT); - attribList.append(0); - GLXPixmap glxPixmap = glXCreatePixmap(mDisplay,*configs,pixmap,attribList.constData()); - - uint inverted = 0; - glXQueryDrawable(mDisplay, glxPixmap, GLX_Y_INVERTED_EXT,&inverted); - compositorBuffer->setInvertedY(!inverted); - - XFree(configs); - - GLuint textureId; - glGenTextures(1,&textureId); - glBindTexture(GL_TEXTURE_2D, textureId); - m_glxBindTexImageEXT(mDisplay,glxPixmap,GLX_FRONT_EXT, 0); - //Do we need to change the api so that we do bind and release in the painevent? - //The specification states that when deleting the texture the color buffer is deleted -// m_glxReleaseTexImageEXT(mDisplay,glxPixmap,GLX_FRONT_EXT); - return textureId; -} - -bool XCompositeGLXIntegration::isYInverted(struct ::wl_resource *buffer) const -{ - return XCompositeBuffer::fromResource(buffer)->isYInverted(); -} - -QSize XCompositeGLXIntegration::bufferSize(struct ::wl_resource *buffer) const -{ - XCompositeBuffer *compositorBuffer = XCompositeBuffer::fromResource(buffer); - - return compositorBuffer->size(); -} - -QT_END_NAMESPACE diff --git a/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.h b/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.h deleted file mode 100644 index 11146ef23..000000000 --- a/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XCOMPOSITEGLXINTEGRATION_H -#define XCOMPOSITEGLXINTEGRATION_H - -#include - -#include "xlibinclude.h" - -#define GLX_GLXEXT_PROTOTYPES -#include -#include - -QT_BEGIN_NAMESPACE - -class XCompositeHandler; - -class XCompositeGLXIntegration : public QWaylandGraphicsHardwareIntegration -{ -public: - XCompositeGLXIntegration(); - ~XCompositeGLXIntegration(); - - void initializeHardware(QtWayland::Display *waylandDisplay) Q_DECL_OVERRIDE; - - GLuint createTextureFromBuffer(struct ::wl_resource *buffer, QOpenGLContext *context) Q_DECL_OVERRIDE; - bool isYInverted(struct ::wl_resource *) const Q_DECL_OVERRIDE; - - QSize bufferSize(struct ::wl_resource *buffer) const Q_DECL_OVERRIDE; - -private: - PFNGLXBINDTEXIMAGEEXTPROC m_glxBindTexImageEXT; - PFNGLXRELEASETEXIMAGEEXTPROC m_glxReleaseTexImageEXT; - - Display *mDisplay; - int mScreen; - XCompositeHandler *mHandler; -}; - -QT_END_NAMESPACE - -#endif // XCOMPOSITEGLXINTEGRATION_H diff --git a/src/plugins/waylandcompositors/xcomposite_share/xcomposite_share.pri b/src/plugins/waylandcompositors/xcomposite_share/xcomposite_share.pri deleted file mode 100644 index 06937c412..000000000 --- a/src/plugins/waylandcompositors/xcomposite_share/xcomposite_share.pri +++ /dev/null @@ -1,15 +0,0 @@ -INCLUDEPATH += $$PWD - -CONFIG += wayland-scanner -WAYLANDSERVERSOURCES += $$PWD/../../../extensions/xcomposite.xml $$PWD/../../../3rdparty/protocol/wayland.xml - -HEADERS += \ - $$PWD/xcompositebuffer.h \ - $$PWD/xcompositehandler.h \ - $$PWD/xlibinclude.h - -SOURCES += \ - $$PWD/xcompositebuffer.cpp \ - $$PWD/xcompositehandler.cpp - -QT += gui-private diff --git a/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.cpp b/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.cpp deleted file mode 100644 index 0457214b4..000000000 --- a/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "xcompositebuffer.h" - -QT_BEGIN_NAMESPACE - -XCompositeBuffer::XCompositeBuffer(Window window, const QSize &size, - struct ::wl_client *client, uint32_t id) - : QtWaylandServer::wl_buffer(client, id) - , mWindow(window) - , mInvertedY(false) - , mSize(size) -{ -} - -void XCompositeBuffer::buffer_destroy_resource(Resource *) -{ - delete this; -} - -void XCompositeBuffer::buffer_destroy(Resource *resource) -{ - wl_resource_destroy(resource->handle); -} - -Window XCompositeBuffer::window() -{ - return mWindow; -} - -QT_END_NAMESPACE diff --git a/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.h b/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.h deleted file mode 100644 index 20cf399b6..000000000 --- a/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XCOMPOSITEBUFFER_H -#define XCOMPOSITEBUFFER_H - -#include -#include - -#include - -#include -#include -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class XCompositeBuffer : public QtWaylandServer::wl_buffer -{ -public: - XCompositeBuffer(Window window, const QSize &size, - struct ::wl_client *client, uint32_t id); - - Window window(); - - bool isYInverted() const { return mInvertedY; } - void setInvertedY(bool inverted) { mInvertedY = inverted; } - - QSize size() const { return mSize; } - - static XCompositeBuffer *fromResource(struct ::wl_resource *resource) { return static_cast(Resource::fromResource(resource)->buffer); } - -protected: - void buffer_destroy_resource(Resource *) Q_DECL_OVERRIDE; - void buffer_destroy(Resource *) Q_DECL_OVERRIDE; - -private: - Window mWindow; - bool mInvertedY; - QSize mSize; -}; - -QT_END_NAMESPACE - -#endif // XCOMPOSITORBUFFER_H diff --git a/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.cpp b/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.cpp deleted file mode 100644 index 0f10d38de..000000000 --- a/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "xcompositehandler.h" - -#include "wayland-xcomposite-server-protocol.h" - -#include "xcompositebuffer.h" -#include - -QT_BEGIN_NAMESPACE - -XCompositeHandler::XCompositeHandler(QtWayland::Compositor *compositor, Display *display) - : QtWaylandServer::qt_xcomposite(compositor->wl_display()) -{ - compositor->window()->create(); - - mFakeRootWindow = new QWindow(compositor->window()); - mFakeRootWindow->setGeometry(QRect(-1,-1,1,1)); - mFakeRootWindow->create(); - mFakeRootWindow->show(); - - int composite_event_base, composite_error_base; - if (!XCompositeQueryExtension(display, &composite_event_base, &composite_error_base)) - qFatal("XComposite required"); - - mDisplayString = QString::fromLocal8Bit(XDisplayString(display)); -} - -void XCompositeHandler::xcomposite_bind_resource(Resource *resource) -{ - send_root(resource->handle, mDisplayString, mFakeRootWindow->winId()); -} - -void XCompositeHandler::xcomposite_create_buffer(Resource *resource, uint32_t id, uint32_t window, - int32_t width, int32_t height) -{ - new XCompositeBuffer(Window(window), QSize(width, height), resource->client(), id); -} - -QT_END_NAMESPACE diff --git a/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.h b/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.h deleted file mode 100644 index 678ad4460..000000000 --- a/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XCOMPOSITEHANDLER_H -#define XCOMPOSITEHANDLER_H - -#include - -#include "xlibinclude.h" - -#include "qwayland-server-xcomposite.h" -#include - -QT_BEGIN_NAMESPACE - -class XCompositeHandler : public QtWaylandServer::qt_xcomposite -{ -public: - XCompositeHandler(QtWayland::Compositor *compositor, Display *display); - -private: - QWindow *mFakeRootWindow; - - QString mDisplayString; - - void xcomposite_bind_resource(Resource *resource) Q_DECL_OVERRIDE; - void xcomposite_create_buffer(Resource *resource, uint32_t id, uint32_t x_window, - int32_t width, int32_t height) Q_DECL_OVERRIDE; - -}; - -QT_END_NAMESPACE - -#endif // XCOMPOSITEHANDLER_H diff --git a/src/plugins/waylandcompositors/xcomposite_share/xlibinclude.h b/src/plugins/waylandcompositors/xcomposite_share/xlibinclude.h deleted file mode 100644 index 733fd6fd0..000000000 --- a/src/plugins/waylandcompositors/xcomposite_share/xlibinclude.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Compositor. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef XLIBINCLUDE_H -#define XLIBINCLUDE_H - -#include -#include -#include -#include -#include -#include -#include - -#include -#include "X11/extensions/Xcomposite.h" - -enum { - XFocusOut = FocusOut, - XFocusIn = FocusIn, - XKeyPress = KeyPress, - XKeyRelease = KeyRelease, - XNone = None, - XRevertToParent = RevertToParent, - XGrayScale = GrayScale, - XCursorShape = CursorShape -}; -#undef FocusOut -#undef FocusIn -#undef KeyPress -#undef KeyRelease -#undef None -#undef RevertToParent -#undef GrayScale -#undef CursorShape - -#ifdef FontChange -#undef FontChange -#endif - -#endif //XLIBINCLUDE_H -- cgit v1.2.3