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
4#include <QtQml/qqmlextensionplugin.h>
5#include <QtQml/qqmlengine.h>
6
7#include "QtWaylandCompositor/private/qwltexturesharingextension_p.h"
8
9#include "plugin_p.h"
10
11/*!
12 \internal
13 \qmlmodule QtWayland.Compositor.TextureSharingExtension 1
14 \title Qt Wayland Shared Texture Provider
15 \ingroup qmlmodules
16 \brief Adds a mechanism to share GPU memory
17
18 \section2 Summary
19
20 This module lets the compositor export graphical resources that can be used by clients,
21 without allocating any graphics memory in the client.
22
23 \note The texture sharing functionality is considered experimental and
24 currently unsupported in Qt 6.
25
26 \section2 Usage
27
28 This module is imported like this:
29
30 \code
31 import QtWayland.Compositor.TextureSharingExtension 1.0
32 \endcode
33
34 To use this module in a compositor, instantiate the extension object as a child of the compositor object, like this:
35
36
37 \code
38 WaylandCompositor {
39 //...
40 TextureSharingExtension {
41 }
42 }
43 \endcode
44
45 The sharing functionality is provided through a QQuickImageProvider. Use
46 the "image:" scheme for the URL source of the image, followed by the
47 identifier \e wlshared, followed by the image file path. For example:
48
49 \code
50 Image { source: "image://wlshared/wallpapers/mybackground.jpg" }
51 \endcode
52
53*/
54
56
58{
59 Q_OBJECT
60 Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
61public:
63
64 void registerTypes(const char *uri) override
65 {
66 Q_ASSERT(uri == QStringLiteral("QtWayland.Compositor.TextureSharingExtension"));
67 }
68
74};
75
76QT_END_NAMESPACE
77
78#include "plugin.moc"
Adds a mechanism to share GPU memory.
Definition plugin.cpp:58
Combined button and popup list for selecting options.