Don't re-use prev alloc on composition layer change

This commit is contained in:
Simon Ser 2019-12-12 23:22:18 +01:00
parent da59787f4a
commit d8c20ddac2
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 9 additions and 1 deletions

View file

@ -30,7 +30,8 @@ struct liftoff_output {
struct liftoff_layer *composition_layer;
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 {

View file

@ -44,5 +44,8 @@ void liftoff_output_set_composition_layer(struct liftoff_output *output,
struct liftoff_layer *layer)
{
assert(layer->output == output);
if (layer != output->composition_layer) {
output->layers_changed = true;
}
output->composition_layer = layer;
}

View file

@ -47,6 +47,7 @@ tests = {
'fb',
'add-layer',
'remove-layer',
'change-composition-layer',
],
'priority': [
#'basic',

View file

@ -91,6 +91,9 @@ int main(int argc, char *argv[]) {
liftoff_layer_destroy(other_layer);
other_layer = NULL;
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 {
fprintf(stderr, "no such test: %s\n", test_name);
return 1;