Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
sharedtextureprovider_p.h
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
//
6
// W A R N I N G
7
// -------------
8
//
9
// This file is not part of the Qt API. It exists purely as an
10
// implementation detail. This header file may change from version to
11
// version without notice, or even be removed.
12
//
13
// We mean it.
14
//
15
16
#
ifndef
SHAREDTEXTUREPROVIDER_H
17
#
define
SHAREDTEXTUREPROVIDER_H
18
19
#
include
<
QOpenGLFunctions
>
20
#
include
<
QQuickImageProvider
>
21
#
include
<
QtQuick
/
QSGTexture
>
22
#
include
<
QScopedPointer
>
23
#
include
<
QHash
>
24
25
#
include
<
QtWaylandClient
/
private
/
qwaylandserverbufferintegration_p
.
h
>
26
27
QT_BEGIN_NAMESPACE
28
29
class
TextureSharingExtension;
30
31
class
SharedTextureRegistry
:
public
QObject
32
{
33
Q_OBJECT
34
public
:
35
SharedTextureRegistry
();
36
~
SharedTextureRegistry
()
override
;
37
38
const
QtWaylandClient
::
QWaylandServerBuffer
*
bufferForId
(
const
QString &id)
const
;
39
void
requestBuffer
(
const
QString &id);
40
void
abandonBuffer
(
const
QString &id);
41
42
static
bool
preinitialize
();
43
44
public
Q_SLOTS
:
45
void
receiveBuffer
(
QtWaylandClient
::
QWaylandServerBuffer
*
buffer
,
const
QString
&
id
);
46
47
Q_SIGNALS
:
48
void
replyReceived
(
const
QString
&
id
);
49
50
private
Q_SLOTS
:
51
void
handleExtensionActive
();
52
53
private
:
54
TextureSharingExtension
*m_extension =
nullptr
;
55
QHash<QString, QtWaylandClient::QWaylandServerBuffer *> m_buffers;
56
QStringList m_pendingBuffers;
57
};
58
59
class
SharedTextureProvider
:
public
QQuickAsyncImageProvider
60
{
61
public
:
62
SharedTextureProvider
();
63
~
SharedTextureProvider
()
override
;
64
65
QQuickImageResponse
*
requestImageResponse
(
const
QString &id,
const
QSize &requestedSize)
override
;
66
67
private
:
68
SharedTextureRegistry
*m_registry =
nullptr
;
69
bool
m_sharingAvailable =
false
;
70
};
71
72
QT_END_NAMESPACE
73
74
#
endif
// SHAREDTEXTUREPROVIDER_H
QWaylandTextureSharingPlugin
Adds an image provider which utilizes shared GPU memory.
Definition
plugin.cpp:46
SharedTextureProvider
Definition
sharedtextureprovider_p.h:60
SharedTextureProvider::SharedTextureProvider
SharedTextureProvider()
Definition
sharedtextureprovider.cpp:229
SharedTextureProvider::~SharedTextureProvider
~SharedTextureProvider() override
Definition
sharedtextureprovider.cpp:240
SharedTextureProvider::requestImageResponse
QQuickImageResponse * requestImageResponse(const QString &id, const QSize &requestedSize) override
Implement this method to return the job that will provide the texture with id.
Definition
sharedtextureprovider.cpp:245
SharedTextureRegistry
Definition
sharedtextureprovider_p.h:32
SharedTextureRegistry::bufferForId
const QtWaylandClient::QWaylandServerBuffer * bufferForId(const QString &id) const
Definition
sharedtextureprovider.cpp:87
SharedTextureRegistry::preinitialize
static bool preinitialize()
Definition
sharedtextureprovider.cpp:117
SharedTextureRegistry::abandonBuffer
void abandonBuffer(const QString &id)
Definition
sharedtextureprovider.cpp:102
SharedTextureRegistry::requestBuffer
void requestBuffer(const QString &id)
Definition
sharedtextureprovider.cpp:92
SharedTextureRegistry::~SharedTextureRegistry
~SharedTextureRegistry() override
Definition
sharedtextureprovider.cpp:82
TextureSharingExtension
Definition
texturesharingextension_p.h:34
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtwayland
src
imports
texture-sharing
sharedtextureprovider_p.h
Generated on
for Qt by
1.18.0