GUAC-236: Store and preseve frame buffer within each layer.
This commit is contained in:
parent
80b3d51a49
commit
79181567e5
@ -40,6 +40,14 @@ guacenc_layer* guacenc_layer_alloc() {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Allocate buffer for frame rendering */
|
||||||
|
layer->frame = guacenc_buffer_alloc();
|
||||||
|
if (layer->frame== NULL) {
|
||||||
|
guacenc_buffer_free(layer->buffer);
|
||||||
|
free(layer);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Layers default to fully opaque */
|
/* Layers default to fully opaque */
|
||||||
layer->opacity = 0xFF;
|
layer->opacity = 0xFF;
|
||||||
|
|
||||||
@ -56,6 +64,9 @@ void guacenc_layer_free(guacenc_layer* layer) {
|
|||||||
if (layer == NULL)
|
if (layer == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Free internal frame buffer */
|
||||||
|
guacenc_buffer_free(layer->frame);
|
||||||
|
|
||||||
/* Free underlying buffer */
|
/* Free underlying buffer */
|
||||||
guacenc_buffer_free(layer->buffer);
|
guacenc_buffer_free(layer->buffer);
|
||||||
|
|
||||||
|
@ -74,6 +74,12 @@ typedef struct guacenc_layer {
|
|||||||
*/
|
*/
|
||||||
int opacity;
|
int opacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The internal buffer used by to record the state of this layer in the
|
||||||
|
* previous frame and to render additional frames.
|
||||||
|
*/
|
||||||
|
guacenc_buffer* frame;
|
||||||
|
|
||||||
} guacenc_layer;
|
} guacenc_layer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user