The current raw drawing context of a guac_display_layer, including the underlying drawing buffer of the guac_display_layer and memory layout information. More...
Data Fields | |
unsigned char * | buffer |
The raw, underlying image buffer of the guac_display_layer. | |
size_t | stride |
The number of bytes in each row of image data. | |
guac_rect | bounds |
A rectangle covering the current bounds of the graphical surface. | |
guac_rect | dirty |
A rectangle covering the region of the guac_display_layer that has changed since the last frame. | |
guac_display_layer * | hint_from |
The layer that should be searched for possible scroll/copy operations related to the changes being made via this guac_display_layer_raw_context. | |
The current raw drawing context of a guac_display_layer, including the underlying drawing buffer of the guac_display_layer and memory layout information.
After making graphical changes, the dirty rectangle of this context must be updated such that it includes the regions modified by those changes.
guac_rect guac_display_layer_raw_context::bounds |
A rectangle covering the current bounds of the graphical surface.
The buffer must not be addressed outside these bounds.
If the buffer for this layer is replaced with an external buffer, or if the external buffer changes size, then the dimensions of this bounds rect must be manually kept up-to-date with the dimensions of the external buffer. These dimensions will also be passed through to become the dimensions of the layer, since layers with external buffers cannot be resized with guac_display_layer_resize().
NOTE: If an external buffer is used and bounds dimensions are provided that are greater than GUAC_DISPLAY_MAX_WIDTH and GUAC_DISPLAY_MAX_HEIGHT, those values will instead be interpreted as equal to GUAC_DISPLAY_MAX_WIDTH and GUAC_DISPLAY_MAX_HEIGHT.
unsigned char* guac_display_layer_raw_context::buffer |
The raw, underlying image buffer of the guac_display_layer.
If the layer was created as opaque, this image is 32-bit RGB with 8 bits per color component, where the lowest-order byte is the blue component and the highest-order byte is ignored. If the layer was not created as opaque, this image is 32-bit ARGB with 8 bits per color component, where the lowest-order byte is the blue component and the highest-order byte is alpha.
This value may be replaced with a manually-allocated buffer if the associated layer should instead use that manually-allocated buffer for future rendering operations. If the buffer is replaced, it must be maintained manually going forward, including when the buffer needs to be resized or after the corresponding layer/display have been freed.
If necessary (such as when a manually-allocated buffer must be freed before freeing the guac_display), all guac_display references to a manually-allocated buffer may be removed by setting this value to NULL and closing the context. Layers with a NULL buffer will not be considered for graphical changes in subsequent frames.
guac_rect guac_display_layer_raw_context::dirty |
A rectangle covering the region of the guac_display_layer that has changed since the last frame.
This rectangle is initially empty and must be manually updated to cover any additional changed regions before closing the guac_display_layer_raw_context.
guac_display_layer* guac_display_layer_raw_context::hint_from |
The layer that should be searched for possible scroll/copy operations related to the changes being made via this guac_display_layer_raw_context.
This value is initially the layer being drawn to and must be updated before closing the context if a different source layer should be considered for scroll/copy optimizations. This value may be set to NULL to hint that no scroll/copy optimization should be performed.
size_t guac_display_layer_raw_context::stride |
The number of bytes in each row of image data.
This value is not necessarily the same as the width of the image multiplied by the size of each pixel. Additional space may be allocated to allow for memory alignment or to make future resize operations more efficient.
If the buffer for this layer is replaced with an external buffer, or if the external buffer changes structure, then this value must be manually kept up-to-date with the stride of the external buffer.