Add serverbufferintegration to the qpa plugin
Change-Id: I3802ec2c2b69fa56d6a64962590ebaa7314b3eea Reviewed-by: Andy Nichols <andy.nichols@digia.com>
This commit is contained in:
parent
ba54fc0bb1
commit
11b385740b
@ -38,7 +38,7 @@
|
|||||||
$QT_END_LICENSE$
|
$QT_END_LICENSE$
|
||||||
</copyright>
|
</copyright>
|
||||||
|
|
||||||
<interface name="qt_server_buffer_extension" version="1">
|
<interface name="qt_server_buffer" version="1">
|
||||||
<description summary="buffers managed by the compositor">
|
<description summary="buffers managed by the compositor">
|
||||||
Server buffer is an extension which makes it possible to share a
|
Server buffer is an extension which makes it possible to share a
|
||||||
buffer created by the compositor to share it with arbitrary
|
buffer created by the compositor to share it with arbitrary
|
||||||
@ -47,9 +47,6 @@
|
|||||||
|
|
||||||
Server buffers main purpose is to help implement caches
|
Server buffers main purpose is to help implement caches
|
||||||
</description>
|
</description>
|
||||||
<event name="destroy" type="destructor">
|
|
||||||
</event>
|
|
||||||
|
|
||||||
<request name="release">
|
<request name="release">
|
||||||
</request>
|
</request>
|
||||||
</interface>
|
</interface>
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
|
WAYLANDCLIENTSOURCES += \
|
||||||
|
$$PWD/../../extensions/server-buffer-extension.xml
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/qwaylandclientbufferintegration.cpp \
|
$$PWD/qwaylandclientbufferintegration.cpp \
|
||||||
$$PWD/qwaylandclientbufferintegrationplugin.cpp \
|
$$PWD/qwaylandclientbufferintegrationplugin.cpp \
|
||||||
$$PWD/qwaylandclientbufferintegrationfactory.cpp
|
$$PWD/qwaylandclientbufferintegrationfactory.cpp \
|
||||||
|
$$PWD/qwaylandserverbufferintegration.cpp \
|
||||||
|
$$PWD/qwaylandserverbufferintegrationplugin.cpp \
|
||||||
|
$$PWD/qwaylandserverbufferintegrationfactory.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/qwaylandclientbufferintegration.h \
|
$$PWD/qwaylandclientbufferintegration.h \
|
||||||
$$PWD/qwaylandclientbufferintegrationplugin.h \
|
$$PWD/qwaylandclientbufferintegrationplugin.h \
|
||||||
$$PWD/qwaylandclientbufferintegrationfactory.h
|
$$PWD/qwaylandclientbufferintegrationfactory.h \
|
||||||
|
$$PWD/qwaylandserverbufferintegration.h \
|
||||||
|
$$PWD/qwaylandserverbufferintegrationplugin.h \
|
||||||
|
$$PWD/qwaylandserverbufferintegrationfactory.h
|
||||||
|
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
#include "qwaylandserverbufferintegration.h"
|
||||||
|
|
||||||
|
QWaylandServerBufferIntegration::QWaylandServerBufferIntegration()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
QWaylandServerBufferIntegration::~QWaylandServerBufferIntegration()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** 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$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QWAYLANDSERVERBUFFERINTEGRATION_H
|
||||||
|
#define QWAYLANDSERVERBUFFERINTEGRATION_H
|
||||||
|
|
||||||
|
#include <QtGui/qopengl.h>
|
||||||
|
|
||||||
|
#include <QtWaylandClient/private/qwayland-server-buffer-extension.h>
|
||||||
|
#include <QtWaylandClient/qwaylandclientexport.h>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
class QWaylandDisplay;
|
||||||
|
|
||||||
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegration
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QWaylandServerBufferIntegration();
|
||||||
|
virtual ~QWaylandServerBufferIntegration();
|
||||||
|
|
||||||
|
virtual void initialize(QWaylandDisplay *display) = 0;
|
||||||
|
|
||||||
|
//creates new texture for buffer
|
||||||
|
virtual GLuint createTextureFor(struct qt_server_buffer *buffer) = 0;
|
||||||
|
|
||||||
|
//does not clean up textures. Just lets server know that it does
|
||||||
|
//not intend to use the buffer anymore. Textures should have been
|
||||||
|
//deleted prior to calling this function
|
||||||
|
virtual void release(struct qt_server_buffer *buffer) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,96 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of the QtGui module 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 "qwaylandserverbufferintegrationfactory.h"
|
||||||
|
#include "qwaylandserverbufferintegrationplugin.h"
|
||||||
|
|
||||||
|
#include <QtCore/private/qfactoryloader_p.h>
|
||||||
|
#include <QtCore/QCoreApplication>
|
||||||
|
#include <QtCore/QDir>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
#ifndef QT_NO_LIBRARY
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
||||||
|
(QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration/client"), Qt::CaseInsensitive))
|
||||||
|
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
|
||||||
|
(QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QStringList QWaylandServerBufferIntegrationFactory::keys(const QString &pluginPath)
|
||||||
|
{
|
||||||
|
#ifndef QT_NO_LIBRARY
|
||||||
|
QStringList list;
|
||||||
|
if (!pluginPath.isEmpty()) {
|
||||||
|
QCoreApplication::addLibraryPath(pluginPath);
|
||||||
|
list = directLoader()->keyMap().values();
|
||||||
|
if (!list.isEmpty()) {
|
||||||
|
const QString postFix = QStringLiteral(" (from ")
|
||||||
|
+ QDir::toNativeSeparators(pluginPath)
|
||||||
|
+ QLatin1Char(')');
|
||||||
|
const QStringList::iterator end = list.end();
|
||||||
|
for (QStringList::iterator it = list.begin(); it != end; ++it)
|
||||||
|
(*it).append(postFix);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
list.append(loader()->keyMap().values());
|
||||||
|
return list;
|
||||||
|
#else
|
||||||
|
return QStringList();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
QWaylandServerBufferIntegration *QWaylandServerBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
|
||||||
|
{
|
||||||
|
#ifndef QT_NO_LIBRARY
|
||||||
|
// Try loading the plugin from platformPluginPath first:
|
||||||
|
if (!pluginPath.isEmpty()) {
|
||||||
|
QCoreApplication::addLibraryPath(pluginPath);
|
||||||
|
if (QWaylandServerBufferIntegration *ret = qLoadPlugin1<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(directLoader(), name, args))
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
if (QWaylandServerBufferIntegration *ret = qLoadPlugin1<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(loader(), name, args))
|
||||||
|
return ret;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
@ -0,0 +1,61 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of the QtGui module 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$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H
|
||||||
|
#define QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H
|
||||||
|
|
||||||
|
#include <QtWaylandClient/qwaylandclientexport.h>
|
||||||
|
#include <QtCore/QStringList>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
class QWaylandServerBufferIntegration;
|
||||||
|
|
||||||
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static QStringList keys(const QString &pluginPath = QString());
|
||||||
|
static QWaylandServerBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
|
||||||
|
};
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif // QWAYLANDSERVERBUFFERINTEGRATIONFACTORY_H
|
@ -0,0 +1,54 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of the QtGui module 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 "qwaylandserverbufferintegrationplugin.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
QWaylandServerBufferIntegrationPlugin::QWaylandServerBufferIntegrationPlugin(QObject *parent)
|
||||||
|
: QObject(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
QWaylandServerBufferIntegrationPlugin::~QWaylandServerBufferIntegrationPlugin()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
@ -0,0 +1,69 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||||
|
** Contact: http://www.qt-project.org/legal
|
||||||
|
**
|
||||||
|
** This file is part of the QtGui module 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$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H
|
||||||
|
#define QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H
|
||||||
|
|
||||||
|
#include <QtWaylandClient/qwaylandclientexport.h>
|
||||||
|
|
||||||
|
#include <QtCore/qplugin.h>
|
||||||
|
#include <QtCore/qfactoryinterface.h>
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
class QWaylandServerBufferIntegration;
|
||||||
|
|
||||||
|
#define QWaylandServerBufferIntegrationFactoryInterface_iid "org.qt-project.Qt.WaylandClient.QWaylandServerBufferIntegrationFactoryInterface.5.1"
|
||||||
|
|
||||||
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationPlugin : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit QWaylandServerBufferIntegrationPlugin(QObject *parent = 0);
|
||||||
|
~QWaylandServerBufferIntegrationPlugin();
|
||||||
|
|
||||||
|
virtual QWaylandServerBufferIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
#endif // QWAYLANDSERVERBUFFERINTEGRATIONPLUGIN_H
|
@ -68,6 +68,8 @@
|
|||||||
#include "qwaylandclientbufferintegration.h"
|
#include "qwaylandclientbufferintegration.h"
|
||||||
#include "qwaylandclientbufferintegrationfactory.h"
|
#include "qwaylandclientbufferintegrationfactory.h"
|
||||||
|
|
||||||
|
#include "qwaylandserverbufferintegration.h"
|
||||||
|
#include "qwaylandserverbufferintegrationfactory.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -110,6 +112,7 @@ QWaylandIntegration::QWaylandIntegration()
|
|||||||
, mAccessibility(0)
|
, mAccessibility(0)
|
||||||
#endif
|
#endif
|
||||||
, mClientBufferIntegrationInitialized(false)
|
, mClientBufferIntegrationInitialized(false)
|
||||||
|
, mServerBufferIntegrationInitialized(false)
|
||||||
{
|
{
|
||||||
mDisplay = new QWaylandDisplay(this);
|
mDisplay = new QWaylandDisplay(this);
|
||||||
mClipboard = new QWaylandClipboard(mDisplay);
|
mClipboard = new QWaylandClipboard(mDisplay);
|
||||||
@ -240,12 +243,20 @@ QPlatformTheme *QWaylandIntegration::createPlatformTheme(const QString &name) co
|
|||||||
QWaylandClientBufferIntegration *QWaylandIntegration::clientBufferIntegration() const
|
QWaylandClientBufferIntegration *QWaylandIntegration::clientBufferIntegration() const
|
||||||
{
|
{
|
||||||
if (!mClientBufferIntegrationInitialized)
|
if (!mClientBufferIntegrationInitialized)
|
||||||
const_cast<QWaylandIntegration *>(this)->initializeBufferIntegration();
|
const_cast<QWaylandIntegration *>(this)->initializeClientBufferIntegration();
|
||||||
|
|
||||||
return mClientBufferIntegration;
|
return mClientBufferIntegration;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandIntegration::initializeBufferIntegration()
|
QWaylandServerBufferIntegration *QWaylandIntegration::serverBufferIntegration() const
|
||||||
|
{
|
||||||
|
if (!mServerBufferIntegrationInitialized)
|
||||||
|
const_cast<QWaylandIntegration *>(this)->initializeServerBufferIntegration();
|
||||||
|
|
||||||
|
return mServerBufferIntegration;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QWaylandIntegration::initializeClientBufferIntegration()
|
||||||
{
|
{
|
||||||
mClientBufferIntegrationInitialized = true;
|
mClientBufferIntegrationInitialized = true;
|
||||||
|
|
||||||
@ -262,4 +273,21 @@ void QWaylandIntegration::initializeBufferIntegration()
|
|||||||
mClientBufferIntegration->initialize(mDisplay);
|
mClientBufferIntegration->initialize(mDisplay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QWaylandIntegration::initializeServerBufferIntegration()
|
||||||
|
{
|
||||||
|
mServerBufferIntegrationInitialized = true;
|
||||||
|
|
||||||
|
QByteArray serverBufferIntegrationName = qgetenv("QT_WAYLAND_SERVER_BUFFER_INTEGRATION");
|
||||||
|
if (serverBufferIntegrationName.isEmpty())
|
||||||
|
serverBufferIntegrationName = QByteArrayLiteral("wayland-egl");
|
||||||
|
|
||||||
|
QStringList keys = QWaylandServerBufferIntegrationFactory::keys();
|
||||||
|
QString targetKey = QString::fromLocal8Bit(serverBufferIntegrationName);
|
||||||
|
if (keys.contains(targetKey)) {
|
||||||
|
mServerBufferIntegration = QWaylandServerBufferIntegrationFactory::create(targetKey, QStringList());
|
||||||
|
}
|
||||||
|
if (mServerBufferIntegration)
|
||||||
|
mServerBufferIntegration->initialize(mDisplay);
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QWaylandBuffer;
|
class QWaylandBuffer;
|
||||||
class QWaylandDisplay;
|
class QWaylandDisplay;
|
||||||
class QWaylandClientBufferIntegration;
|
class QWaylandClientBufferIntegration;
|
||||||
|
class QWaylandServerBufferIntegration;
|
||||||
|
|
||||||
class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandIntegration : public QPlatformIntegration
|
||||||
{
|
{
|
||||||
@ -88,10 +89,13 @@ public:
|
|||||||
QPlatformTheme *createPlatformTheme(const QString &name) const;
|
QPlatformTheme *createPlatformTheme(const QString &name) const;
|
||||||
|
|
||||||
virtual QWaylandClientBufferIntegration *clientBufferIntegration() const;
|
virtual QWaylandClientBufferIntegration *clientBufferIntegration() const;
|
||||||
|
virtual QWaylandServerBufferIntegration *serverBufferIntegration() const;
|
||||||
protected:
|
protected:
|
||||||
QWaylandClientBufferIntegration *mClientBufferIntegration;
|
QWaylandClientBufferIntegration *mClientBufferIntegration;
|
||||||
|
QWaylandServerBufferIntegration *mServerBufferIntegration;
|
||||||
private:
|
private:
|
||||||
void initializeBufferIntegration();
|
void initializeClientBufferIntegration();
|
||||||
|
void initializeServerBufferIntegration();
|
||||||
QPlatformFontDatabase *mFontDb;
|
QPlatformFontDatabase *mFontDb;
|
||||||
QPlatformClipboard *mClipboard;
|
QPlatformClipboard *mClipboard;
|
||||||
QPlatformDrag *mDrag;
|
QPlatformDrag *mDrag;
|
||||||
@ -100,6 +104,7 @@ private:
|
|||||||
QScopedPointer<QPlatformInputContext> mInputContext;
|
QScopedPointer<QPlatformInputContext> mInputContext;
|
||||||
QPlatformAccessibility *mAccessibility;
|
QPlatformAccessibility *mAccessibility;
|
||||||
bool mClientBufferIntegrationInitialized;
|
bool mClientBufferIntegrationInitialized;
|
||||||
|
bool mServerBufferIntegrationInitialized;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user