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
"sharedtextureprovider_p.h"
9
10
/*!
11
\internal
12
\qmlmodule QtWayland.Client.TextureSharing 1
13
\title Qt Wayland Shared Texture Provider
14
\ingroup qmlmodules
15
\brief Adds an image provider which utilizes shared GPU memory
16
17
\section2 Summary
18
19
This module allows Qt Wayland clients to use graphical resources exported
20
by the compositor, without allocating any graphics memory in the client.
21
22
\note The texture sharing functionality is considered experimental and
23
currently unsupported in Qt 6.
24
25
\section2 Usage
26
27
To use this module, import it like this:
28
\code
29
import QtWayland.Client.TextureSharing 1.0
30
\endcode
31
32
The sharing functionality is provided through a QQuickImageProvider. Use
33
the "image:" scheme for the URL source of the image, followed by the
34
identifier \e wlshared, followed by the image file path. For example:
35
36
\code
37
Image { source: "image://wlshared/wallpapers/mybackground.jpg" }
38
\endcode
39
40
The shared texture module does not provide any directly usable QML types.
41
*/
42
43
QT_BEGIN_NAMESPACE
44
45
class
QWaylandTextureSharingPlugin
:
public
QQmlExtensionPlugin
46
{
47
Q_OBJECT
48
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
49
public
:
50
QWaylandTextureSharingPlugin
(
QObject
*
parent
=
nullptr
) :
QQmlExtensionPlugin
(
parent
) {}
51
52
void
registerTypes
(
const
char
*
uri
)
override
53
{
54
Q_ASSERT
(
uri
==
QStringLiteral
(
"QtWayland.Client.TextureSharing"
));
55
}
56
57
void
initializeEngine
(
QQmlEngine
*
engine
,
const
char
*
uri
)
override
58
{
59
Q_UNUSED
(
uri
);
60
engine
->
addImageProvider
(
"wlshared"
,
new
SharedTextureProvider
);
61
}
62
};
63
64
QT_END_NAMESPACE
65
66
#
include
"plugin.moc"
QWaylandTextureSharingPlugin
Adds an image provider which utilizes shared GPU memory.
Definition
plugin.cpp:46
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtwayland
src
imports
texture-sharing
plugin.cpp
Generated on
for Qt by
1.16.1