diff --git a/src/guacenc/layer.c b/src/guacenc/layer.c index 890ad149..f6cd12b7 100644 --- a/src/guacenc/layer.c +++ b/src/guacenc/layer.c @@ -40,6 +40,14 @@ guacenc_layer* guacenc_layer_alloc() { 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 */ layer->opacity = 0xFF; @@ -56,6 +64,9 @@ void guacenc_layer_free(guacenc_layer* layer) { if (layer == NULL) return; + /* Free internal frame buffer */ + guacenc_buffer_free(layer->frame); + /* Free underlying buffer */ guacenc_buffer_free(layer->buffer); diff --git a/src/guacenc/layer.h b/src/guacenc/layer.h index 50f47040..d2a9d5a4 100644 --- a/src/guacenc/layer.h +++ b/src/guacenc/layer.h @@ -74,6 +74,12 @@ typedef struct guacenc_layer { */ 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; /**