Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
plugin.cpp
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#include <QtQml/qqmlextensionplugin.h>
6#include <QtQml/qqmlengine.h>
7
8#include "QtWaylandCompositor/private/qwltexturesharingextension_p.h"
9
10#include "plugin_p.h"
11
12/*!
13 \internal
14 \qmlmodule QtWayland.Compositor.TextureSharingExtension 1
15 \title Qt Wayland Shared Texture Provider
16 \ingroup qmlmodules
17 \brief Adds a mechanism to share GPU memory
18
19 \section2 Summary
20
21 This module lets the compositor export graphical resources that can be used by clients,
22 without allocating any graphics memory in the client.
23
24 \note The texture sharing functionality is considered experimental and
25 currently unsupported in Qt 6.
26
27 \section2 Usage
28
29 This module is imported like this:
30
31 \code
32 import QtWayland.Compositor.TextureSharingExtension 1.0
33 \endcode
34
35 To use this module in a compositor, instantiate the extension object as a child of the compositor object, like this:
36
37
38 \code
39 WaylandCompositor {
40 //...
41 TextureSharingExtension {
42 }
43 }
44 \endcode
45
46 The sharing functionality is provided through a QQuickImageProvider. Use
47 the "image:" scheme for the URL source of the image, followed by the
48 identifier \e wlshared, followed by the image file path. For example:
49
50 \code
51 Image { source: "image://wlshared/wallpapers/mybackground.jpg" }
52 \endcode
53
54*/
55
57
59{
60 Q_OBJECT
61 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
62public:
64
65 void registerTypes(const char *uri) override
66 {
67 Q_ASSERT(uri == QStringLiteral("QtWayland.Compositor.TextureSharingExtension"));
68 }
69
75};
76
77QT_END_NAMESPACE
78
79#include "plugin.moc"
Adds a mechanism to share GPU memory.
Definition plugin.cpp:59
Combined button and popup list for selecting options.