diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2023-02-13 08:10:29 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-16 07:58:44 +0000 |
commit | 7d6b144818774573e07edbd652ad2209377046b3 (patch) | |
tree | 45ae230b3cdb9684c68b038dfa06ef58d249c7c7 /tests/manual/server-buffer/compositor/sharebufferextension.h | |
parent | 90e2ade38721febbf2cb8897779153de4d789a10 (diff) | |
download | qtwayland-7d6b144818774573e07edbd652ad2209377046b3.tar.gz |
Move server-buffer example to manual tests
This is undocumented and demonstrates an experimental feature which
was never maintained or exercised. It's a nice feature, so we keep
the example around for when we get the time to bring it back.
Task-number: QTBUG-110993
Change-Id: I045cb2ef02a50017a26226c493607100ea0f1b95
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit acb68bd3bbbc0001bcf460dd175ff92cc3ce594a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests/manual/server-buffer/compositor/sharebufferextension.h')
-rw-r--r-- | tests/manual/server-buffer/compositor/sharebufferextension.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/manual/server-buffer/compositor/sharebufferextension.h b/tests/manual/server-buffer/compositor/sharebufferextension.h new file mode 100644 index 00000000..98dcc7d8 --- /dev/null +++ b/tests/manual/server-buffer/compositor/sharebufferextension.h @@ -0,0 +1,53 @@ +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#ifndef SHAREBUFFEREXTENSION_H +#define SHAREBUFFEREXTENSION_H + +#include "wayland-util.h" + +#include <QtCore/QMap> + +#include <QtWaylandCompositor/QWaylandCompositorExtensionTemplate> +#include <QtWaylandCompositor/QWaylandQuickExtension> +#include <QtWaylandCompositor/QWaylandCompositor> + +#include <QtWaylandCompositor/private/qwaylandcompositor_p.h> +#include <QtWaylandCompositor/private/qwlserverbufferintegration_p.h> + +#include "qwayland-server-share-buffer.h" + +QT_BEGIN_NAMESPACE + +namespace QtWayland +{ + class ServerBufferIntegration; +}; + + +class ShareBufferExtension : public QWaylandCompositorExtensionTemplate<ShareBufferExtension> + , public QtWaylandServer::qt_share_buffer +{ + Q_OBJECT +public: + ShareBufferExtension(QWaylandCompositor *compositor = nullptr); + void initialize() override; + +protected slots: + QtWayland::ServerBuffer *addImage(const QImage &image); + +protected: + void share_buffer_bind_resource(Resource *resource) override; + +private: + void createServerBuffers(); + QList<QtWayland::ServerBuffer *> m_server_buffers; + QtWayland::ServerBufferIntegration *m_server_buffer_integration = nullptr; + bool m_server_buffers_created = false; +}; + +Q_COMPOSITOR_DECLARE_QUICK_EXTENSION_CLASS(ShareBufferExtension) + +QT_END_NAMESPACE + +#endif // SHAREBUFFEREXTENSION_H |