Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef SHAREDTEXTUREPROVIDER_H
16#define SHAREDTEXTUREPROVIDER_H
17
18#include <QOpenGLFunctions>
19#include <QQuickImageProvider>
20#include <QtQuick/QSGTexture>
21#include <QScopedPointer>
22#include <QHash>
23
24#include <QtWaylandClient/private/qwaylandserverbufferintegration_p.h>
25
27
29
31{
33public:
35 ~SharedTextureRegistry() override;
36
38 void requestBuffer(const QString &id);
39 void abandonBuffer(const QString &id);
40
41 static bool preinitialize();
42
43public Q_SLOTS:
45
47 void replyReceived(const QString &id);
48
49private Q_SLOTS:
50 void handleExtensionActive();
51
52private:
53 TextureSharingExtension *m_extension = nullptr;
54 QHash<QString, QtWaylandClient::QWaylandServerBuffer *> m_buffers;
55 QStringList m_pendingBuffers;
56};
57
59{
60public:
62 ~SharedTextureProvider() override;
63
64 QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) override;
65
66private:
67 SharedTextureRegistry *m_registry = nullptr;
68 bool m_sharingAvailable = false;
69};
70
72
73#endif // SHAREDTEXTUREPROVIDER_H
\inmodule QtCore
Definition qobject.h:103
The QQuickAsyncImageProvider class provides an interface for asynchronous control of QML image reques...
The QQuickImageResponse class provides an interface for asynchronous image loading in QQuickAsyncImag...
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
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 receiveBuffer(QtWaylandClient::QWaylandServerBuffer *buffer, const QString &id)
void abandonBuffer(const QString &id)
void requestBuffer(const QString &id)
void replyReceived(const QString &id)
Combined button and popup list for selecting options.
GLenum GLuint buffer
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS