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
qplatformsharedgraphicscache.h
Go to the documentation of this file.
1// Copyright (C) 2016 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#ifndef QPLATFORMSHAREDGRAPHICSCACHE_H
5#define QPLATFORMSHAREDGRAPHICSCACHE_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is part of the QPA API and is not meant to be used
12// in applications. Usage of this API may make your code
13// source and binary incompatible with future versions of Qt.
14//
15
16#include <QtGui/qtguiglobal.h>
17#include <QtCore/qobject.h>
18#include <QtGui/qimage.h>
19
21
22class Q_GUI_EXPORT QPlatformSharedGraphicsCache: public QObject
23{
25public:
27 {
28 Alpha8
29 };
30
32 {
33 OpenGLTexture
34 };
35
36 explicit QPlatformSharedGraphicsCache(QObject *parent = nullptr) : QObject(parent) {}
37
38 virtual void beginRequestBatch() = 0;
39 virtual void ensureCacheInitialized(const QByteArray &cacheId, BufferType bufferType,
40 PixelFormat pixelFormat) = 0;
41 virtual void requestItems(const QByteArray &cacheId, const QList<quint32> &itemIds) = 0;
42 virtual void insertItems(const QByteArray &cacheId, const QList<quint32> &itemIds,
43 const QList<QImage> &items) = 0;
44 virtual void releaseItems(const QByteArray &cacheId, const QList<quint32> &itemIds) = 0;
45 virtual void endRequestBatch() = 0;
46
47 virtual bool requestBatchStarted() const = 0;
48
49 virtual uint textureIdForBuffer(void *bufferId) = 0;
50 virtual void referenceBuffer(void *bufferId) = 0;
51 virtual bool dereferenceBuffer(void *bufferId) = 0;
52 virtual QSize sizeOfBuffer(void *bufferId) = 0;
53 virtual void *eglImageForBuffer(void *bufferId) = 0;
54
56 void itemsMissing(const QByteArray &cacheId, const QList<quint32> &itemIds);
57 void itemsAvailable(const QByteArray &cacheId, void *bufferId, const QList<quint32> &itemIds,
58 const QList<QPoint> &positionsInBuffer);
59 void itemsInvalidated(const QByteArray &cacheId, const QList<quint32> &itemIds);
60 void itemsUpdated(const QByteArray &cacheId, void *bufferId, const QList<quint32> &itemIds,
61 const QList<QPoint> &positionsInBuffer);
62};
63
65
66#endif // QPLATFORMSHAREDGRAPHICSCACHE_H
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qobject.h:103
The QPlatformSharedGraphicsCache is an abstraction of a cross-process graphics cache.
void itemsUpdated(const QByteArray &cacheId, void *bufferId, const QList< quint32 > &itemIds, const QList< QPoint > &positionsInBuffer)
This signal is similar in usage to the itemsAvailable() signal, but will be emitted when the location...
virtual void requestItems(const QByteArray &cacheId, const QList< quint32 > &itemIds)=0
Requests all the items in itemIds from the cache with the name cacheId.
virtual void ensureCacheInitialized(const QByteArray &cacheId, BufferType bufferType, PixelFormat pixelFormat)=0
Initializes a cache named cacheId if it has not yet been initialized.
BufferType
Defines how the type of buffer required to contain a cache.
virtual void insertItems(const QByteArray &cacheId, const QList< quint32 > &itemIds, const QList< QImage > &items)=0
Inserts the items in itemIds into the cache named cacheId.
virtual bool requestBatchStarted() const =0
Returns true if a request batch has previously been started using beginRequestBatch() and not yet sto...
virtual QSize sizeOfBuffer(void *bufferId)=0
Returns the size of the buffer bufferId.
virtual void endRequestBatch()=0
Signals to the cache that the request sequence which has previously been commenced using beginRequest...
virtual void referenceBuffer(void *bufferId)=0
Registers a reference to the buffer bufferId.
void itemsMissing(const QByteArray &cacheId, const QList< quint32 > &itemIds)
This signal is emitted when requestItems() has been called for one or more items in the cache named c...
PixelFormat
Defines the pixel format of a cache.
virtual void * eglImageForBuffer(void *bufferId)=0
Returns an EGLImageKHR image corresponding to the buffer bufferId.
virtual bool dereferenceBuffer(void *bufferId)=0
Removed a previously registered reference to the buffer bufferId.
virtual uint textureIdForBuffer(void *bufferId)=0
Returns an OpenGL texture ID corresponding to the buffer bufferId, which has previously been passed t...
virtual void releaseItems(const QByteArray &cacheId, const QList< quint32 > &itemIds)=0
Releases the reference to the items in itemIds from the cache named cacheId.
void itemsAvailable(const QByteArray &cacheId, void *bufferId, const QList< quint32 > &itemIds, const QList< QPoint > &positionsInBuffer)
This signal can be emitted at any time when either requestItems() or insertItems() has been called by...
virtual void beginRequestBatch()=0
This is a hint to the cache that a burst of requests is pending.
void itemsInvalidated(const QByteArray &cacheId, const QList< quint32 > &itemIds)
This signal is emitted when the items given by itemIds in the cache named cacheId have been removed f...
QPlatformSharedGraphicsCache(QObject *parent=nullptr)
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
#define Q_OBJECT
#define Q_SIGNALS
unsigned int uint
Definition qtypes.h:34
QList< QTreeWidgetItem * > items