mirror of
https://gitlab.freedesktop.org/emersion/libliftoff.git
synced 2025-01-13 20:01:35 +01:00
Don't re-use prev alloc on composition layer change
This commit is contained in:
parent
da59787f4a
commit
d8c20ddac2
4 changed files with 9 additions and 1 deletions
|
@ -30,7 +30,8 @@ struct liftoff_output {
|
||||||
struct liftoff_layer *composition_layer;
|
struct liftoff_layer *composition_layer;
|
||||||
|
|
||||||
struct liftoff_list layers; /* liftoff_layer.link */
|
struct liftoff_list layers; /* liftoff_layer.link */
|
||||||
bool layers_changed; /* layer added or removed */
|
/* layer added or removed, or composition layer changed */
|
||||||
|
bool layers_changed;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct liftoff_layer {
|
struct liftoff_layer {
|
||||||
|
|
3
output.c
3
output.c
|
@ -44,5 +44,8 @@ void liftoff_output_set_composition_layer(struct liftoff_output *output,
|
||||||
struct liftoff_layer *layer)
|
struct liftoff_layer *layer)
|
||||||
{
|
{
|
||||||
assert(layer->output == output);
|
assert(layer->output == output);
|
||||||
|
if (layer != output->composition_layer) {
|
||||||
|
output->layers_changed = true;
|
||||||
|
}
|
||||||
output->composition_layer = layer;
|
output->composition_layer = layer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,7 @@ tests = {
|
||||||
'fb',
|
'fb',
|
||||||
'add-layer',
|
'add-layer',
|
||||||
'remove-layer',
|
'remove-layer',
|
||||||
|
'change-composition-layer',
|
||||||
],
|
],
|
||||||
'priority': [
|
'priority': [
|
||||||
#'basic',
|
#'basic',
|
||||||
|
|
|
@ -91,6 +91,9 @@ int main(int argc, char *argv[]) {
|
||||||
liftoff_layer_destroy(other_layer);
|
liftoff_layer_destroy(other_layer);
|
||||||
other_layer = NULL;
|
other_layer = NULL;
|
||||||
want_reuse_prev_alloc = false;
|
want_reuse_prev_alloc = false;
|
||||||
|
} else if (strcmp(test_name, "change-composition-layer") == 0) {
|
||||||
|
liftoff_output_set_composition_layer(output, layer);
|
||||||
|
want_reuse_prev_alloc = false;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "no such test: %s\n", test_name);
|
fprintf(stderr, "no such test: %s\n", test_name);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue