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
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
27QT_BEGIN_NAMESPACE
28
29class TextureSharingExtension;
30
32{
34public:
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
44public Q_SLOTS:
46
48 void replyReceived(const QString &id);
49
50private Q_SLOTS:
52
53private:
54 TextureSharingExtension *m_extension = nullptr;
55 QHash<QString, QtWaylandClient::QWaylandServerBuffer *> m_buffers;
56 QStringList m_pendingBuffers;
57};
58
60{
61public:
64
65 QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) override;
66
67private:
68 SharedTextureRegistry *m_registry = nullptr;
69 bool m_sharingAvailable = false;
70};
71
72QT_END_NAMESPACE
73
74#endif // SHAREDTEXTUREPROVIDER_H
Adds an image provider which utilizes shared GPU memory.
Definition plugin.cpp:46
QQuickImageResponse * requestImageResponse(const QString &id, const QSize &requestedSize) override
Implement this method to return the job that will provide the texture with id.
const QtWaylandClient::QWaylandServerBuffer * bufferForId(const QString &id) const
void abandonBuffer(const QString &id)
void requestBuffer(const QString &id)
Combined button and popup list for selecting options.