QPlatformSharedGraphicsCache Class
The QPlatformSharedGraphicsCache is an abstraction of a cross-process graphics cache. More...
Header: | #include <QPlatformSharedGraphicsCache> |
Inherits: | QObject |
Public Types
enum | BufferType { OpenGLTexture } |
enum | PixelFormat { Alpha8 } |
Detailed Description
\since
5.0 \internal
\preliminary
\ingroup
qpa
If supported, it is possible to retrieve a QPlatformSharedGraphicsCache object from the platform integration. This is typically used to store graphical items which should be shared between several processes.
Items are requested from the cache by calling requestItems(). If the cache contains the requested items in the requested cache, the itemsAvailable() signal is emitted with the ID of the graphical buffer and each item's coordinates inside the buffer. Before requesting items from a cache, the user must call ensureCacheInitialized() to set the correct parameters for the cache.
If the cache does not yet contain the requested items, it will emit a similar itemsMissing() signal. The client can then call updateItems() with rasterizations of the items and they will be entered into the shared cache. As the items are rendered into the cache, itemsAvailable() signals will be emitted for each of the items which have previously been requested and which have not yet been reported as ready.
Using beginRequestBatch() and endRequestBatch(), it's possible to batch glyph requests, which could improve performance in cases where you have a sequence of requests pending, and you do not need the results during this sequence.
Member Type Documentation
enum QPlatformSharedGraphicsCache::BufferType
Defines how the type of buffer required to contain a cache.
Constant | Value | Description |
---|---|---|
QPlatformSharedGraphicsCache::OpenGLTexture | 0 | The buffer will be allocated in graphics memory, and an OpenGL texture for a buffer belonging to the cache can be requested using textureIdForBuffer(). |
enum QPlatformSharedGraphicsCache::PixelFormat
Defines the pixel format of a cache.
Constant | Value | Description |
---|---|---|
QPlatformSharedGraphicsCache::Alpha8 | 0 | 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. |