QtBase
v6.3.1
|
#include <qplatformsharedgraphicscache.h>
Public Types | |
enum | PixelFormat { Alpha8 } |
enum | BufferType { OpenGLTexture } |
Signals | |
void | itemsMissing (const QByteArray &cacheId, const QList< quint32 > &itemIds) |
void | itemsAvailable (const QByteArray &cacheId, void *bufferId, const QList< quint32 > &itemIds, const QList< QPoint > &positionsInBuffer) |
void | itemsInvalidated (const QByteArray &cacheId, const QList< quint32 > &itemIds) |
void | itemsUpdated (const QByteArray &cacheId, void *bufferId, const QList< quint32 > &itemIds, const QList< QPoint > &positionsInBuffer) |
Signals inherited from QObject | |
void | destroyed (QObject *=nullptr) |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
Definition at line 58 of file qplatformsharedgraphicscache.h.
Defines how the type of buffer required to contain a cache.
\value OpenGLTexture The buffer will be allocated in graphics memory, and an OpenGL texture for a buffer belonging to the cache can be requested using textureIdForBuffer().
Enumerator | |
---|---|
OpenGLTexture |
Definition at line 67 of file qplatformsharedgraphicscache.h.
Defines the pixel format of a cache.
\value Alpha8 The cache will use 8 bits to represent the alpha value of each pixel. If an OpenGL texture is created for a buffer belong to the cache, it will have the pixel format GL_ALPHA.
Enumerator | |
---|---|
Alpha8 |
Definition at line 62 of file qplatformsharedgraphicscache.h.
|
inlineexplicit |
Definition at line 72 of file qplatformsharedgraphicscache.h.
|
pure virtual |
This is a hint to the cache that a burst of requests is pending. In some implementations, this will improve performance, as the cache can focus on handling the requests and wait with the results until it is done. It should typically be called prior to a sequence of calls to requestItems() and releaseItems().
Any call to beginRequestBatch() must be followed at some point by a call to endRequestBatch(). Failing to do this may lead to the results of requests never being emitted.
|
pure virtual |
Removed a previously registered reference to the buffer bufferId. Returns true
if there are still more references to the buffer in question, or false if this was the last reference (in which case the buffer may have been deleted in the cache.)
Returns an EGLImageKHR image corresponding to the buffer bufferId.
|
pure virtual |
Signals to the cache that the request sequence which has previously been commenced using beginRequestBatch() has now finished.
|
pure virtual |
Initializes a cache named cacheId if it has not yet been initialized. The bufferType and pixelFormat gives the format of the buffers that will be used to contain the items in the cache. If a cache with the same cacheId has previously been initialized, the call will be ignored. The cache will keep its previously set buffer type and pixel format.
|
pure virtual |
Inserts the items in itemIds into the cache named cacheId. The appearance of each item is stored in items. The format of the QImage objects is expected to match the pixel format of the cache as it was initialized in ensureCacheInitialized().
When the items have been successfully entered into the cache, one or more itemsAvailable() signals will be emitted for the items.
If the cache already contains the items, the behavior is implementation-specific. The implementation may choose to ignore the items or it may overwrite the existing instances in the cache. Either way, itemsAvailable() signals corresponding to the inserted items will be emitted.
|
signal |
This signal can be emitted at any time when either requestItems() or insertItems() has been called by the application for one or more items in the cache named cacheId, as long as releaseItems() has not subsequently been called for the same items. It instructs the application on where to find the items that have been entered into the cache. When the application receives a buffer, it is expected to reference it using referenceBuffer() on it if it keeps a reference to the buffer.
The bufferId is an ID for the buffer that contains the items. The bufferId can be converted to a format usable by the application depending on which format it was given at initialization. If it is a OpenGLTexture, its texture ID can be requested using the textureIdForBuffer() function. The dimensions of the buffer are given by bufferSize.
The items provided by the cache are identified in the itemIds list. The positionsInBuffer list contains the locations inside the buffer of each item. Each entry in positionsInBuffer corresponds to an item in itemIds.
The buffer and the items' locations within the buffer can be considered valid until an itemsInvalidated() signal has been emitted for the items, or until releaseItems() is called for the items.
|
signal |
This signal is emitted when the items given by itemIds in the cache named cacheId have been removed from the cache and the previously reported information about them is considered invalid. It will only be emitted for items for which a buffer has previously been identified through the itemsAvailable() signal (either as response to a requestItems() call or an insertItems() call.)
The application is expected to throw away information about the items in the itemIds array and drop any references it might have to the memory held by the buffer. If the items are still required by the application, it can re-commit them to the cache using the insertItems() function.
If the application no longer holds any references to previously referenced items in a given cache, it should call releaseItems() for these items, at which point it will no longer receive any itemsInvalidated() signal for these items.
|
signal |
This signal is emitted when requestItems() has been called for one or more items in the cache named cacheId which are not yet available in the cache. The user is then expected to call insertItems() to update the cache with the respective items, at which point they will become available to all clients of the shared cache.
The itemIds list contains the IDs of the items that need to be inserted into the cache.
|
signal |
This signal is similar in usage to the itemsAvailable() signal, but will be emitted when the location of a previously requested or inserted item has been updated. The application must update its data for the respective items and release any references to old buffers held by the items.
If the application no longer holds any references to previously referenced items in a given cache, it should call releaseItems() for these items, at which point it will no longer receive any itemsUpdated() signal for these items.
Registers a reference to the buffer bufferId.
|
pure virtual |
Releases the reference to the items in itemIds from the cache named cacheId. This should only be called when all references to the items have been released by the user, and they are no longer needed.
|
pure virtual |
Returns true
if a request batch has previously been started using beginRequestBatch() and not yet stopped using endRequestBatch().
|
pure virtual |
Requests all the items in itemIds from the cache with the name cacheId.
If any or all of the items are available in the cache, one or more itemsAvailable() signals will be emitted corresponding to the items. If the cache does not contain all of the items in question, then an itemsMissing() signal will be emitted corresponding to the missing items. The user is at this point expected to call insertItems() to insert the missing items into the cache. If the inserted items have previously been requested by the user, at which point an itemsAvailable() signal will be emitted corresponding to the items.
Before requesting items from a cache, the user must call ensureCacheInitialized() with the correct parameters for the cache.
Returns the size of the buffer bufferId.
Returns an OpenGL texture ID corresponding to the buffer bufferId, which has previously been passed through signals itemsAvailable() or itemsUpdated(). The relevant OpenGL context should be current when calling this function.