mirror of
https://github.com/labwc/labwc.git
synced 2025-11-07 13:30:06 -05:00
scaled_scene_buffer: make dropping the buffer optional
In preparation to also use the scaled_scene_buffer for theme components like rounded corner images and button icons. No functional change intended.
This commit is contained in:
parent
7aa540b8ab
commit
8d17ab2d60
4 changed files with 51 additions and 10 deletions
|
|
@ -30,10 +30,12 @@ static void
|
|||
_destroy(struct scaled_scene_buffer *scaled_buffer)
|
||||
{
|
||||
struct scaled_font_buffer *self = scaled_buffer->data;
|
||||
scaled_buffer->data = NULL;
|
||||
|
||||
zfree(self->text);
|
||||
zfree(self->font.name);
|
||||
zfree(self->arrow);
|
||||
zfree(scaled_buffer->data);
|
||||
free(self);
|
||||
}
|
||||
|
||||
static const struct scaled_scene_buffer_impl impl = {
|
||||
|
|
@ -48,7 +50,7 @@ scaled_font_buffer_create(struct wlr_scene_tree *parent)
|
|||
assert(parent);
|
||||
struct scaled_font_buffer *self = znew(*self);
|
||||
struct scaled_scene_buffer *scaled_buffer =
|
||||
scaled_scene_buffer_create(parent, &impl);
|
||||
scaled_scene_buffer_create(parent, &impl, /* drop_buffer */ true);
|
||||
if (!scaled_buffer) {
|
||||
free(self);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue