summaryrefslogtreecommitdiffstats
path: root/src/plugins/hardwareintegration/client
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-06-23 12:43:31 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2017-08-16 09:56:39 +0000
commitb858ac992839b5f59de1a865be6460f00ac8f061 (patch)
treef98099107dbcd4ef3cdb86bface0ef3093cced47 /src/plugins/hardwareintegration/client
parent9661da8e5d7f0ebaa1a02b1f52b55fc3fe043c81 (diff)
shm-based server buffer for testing on desktop
Change-Id: I2ea03f3366524d3133a65870abad9d9389dfec9c Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/plugins/hardwareintegration/client')
-rw-r--r--src/plugins/hardwareintegration/client/client.pro3
-rw-r--r--src/plugins/hardwareintegration/client/shm-emulation-server/main.cpp66
-rw-r--r--src/plugins/hardwareintegration/client/shm-emulation-server/shm-emulation-server.json3
-rw-r--r--src/plugins/hardwareintegration/client/shm-emulation-server/shm-emulation-server.pro15
4 files changed, 87 insertions, 0 deletions
diff --git a/src/plugins/hardwareintegration/client/client.pro b/src/plugins/hardwareintegration/client/client.pro
index a5967c710..f1c71f084 100644
--- a/src/plugins/hardwareintegration/client/client.pro
+++ b/src/plugins/hardwareintegration/client/client.pro
@@ -13,3 +13,6 @@ qtConfig(drm-egl-server): \
SUBDIRS += drm-egl-server
qtConfig(libhybris-egl-server): \
SUBDIRS += libhybris-egl-server
+
+### TODO: make shm-emulation configurable
+SUBDIRS += shm-emulation-server
diff --git a/src/plugins/hardwareintegration/client/shm-emulation-server/main.cpp b/src/plugins/hardwareintegration/client/shm-emulation-server/main.cpp
new file mode 100644
index 000000000..8c3ba8420
--- /dev/null
+++ b/src/plugins/hardwareintegration/client/shm-emulation-server/main.cpp
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtWaylandClient/private/qwaylandserverbufferintegrationplugin_p.h>
+#include "shmserverbufferintegration.h"
+
+QT_BEGIN_NAMESPACE
+
+namespace QtWaylandClient {
+
+class ShmServerBufferPlugin : public QWaylandServerBufferIntegrationPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID QWaylandServerBufferIntegrationFactoryInterface_iid FILE "shm-emulation-server.json")
+public:
+ QWaylandServerBufferIntegration *create(const QString&, const QStringList&) override;
+};
+
+QWaylandServerBufferIntegration *ShmServerBufferPlugin::create(const QString& system, const QStringList& paramList)
+{
+ Q_UNUSED(paramList);
+ Q_UNUSED(system);
+ return new ShmServerBufferIntegration();
+}
+
+}
+
+QT_END_NAMESPACE
+
+#include "main.moc"
diff --git a/src/plugins/hardwareintegration/client/shm-emulation-server/shm-emulation-server.json b/src/plugins/hardwareintegration/client/shm-emulation-server/shm-emulation-server.json
new file mode 100644
index 000000000..1bf8ded87
--- /dev/null
+++ b/src/plugins/hardwareintegration/client/shm-emulation-server/shm-emulation-server.json
@@ -0,0 +1,3 @@
+{
+ "Keys": [ "shm-emulation-server" ]
+}
diff --git a/src/plugins/hardwareintegration/client/shm-emulation-server/shm-emulation-server.pro b/src/plugins/hardwareintegration/client/shm-emulation-server/shm-emulation-server.pro
new file mode 100644
index 000000000..8b1c6e5f2
--- /dev/null
+++ b/src/plugins/hardwareintegration/client/shm-emulation-server/shm-emulation-server.pro
@@ -0,0 +1,15 @@
+# We have a bunch of C code with casts, so we can't have this option
+QMAKE_CXXFLAGS_WARN_ON -= -Wcast-qual
+
+QT += waylandclient-private
+
+include(../../../../hardwareintegration/client/shm-emulation-server/shm-emulation-server.pri)
+
+OTHER_FILES += \
+ shm-emulation-server.json
+
+SOURCES += main.cpp
+
+PLUGIN_TYPE = wayland-graphics-integration-client
+PLUGIN_CLASS_NAME = ShmServerBufferPlugin
+load(qt_plugin)