Force re-alloc when setting FB to 0

This commit is contained in:
Simon Ser 2020-12-05 12:18:36 +01:00
parent b4bddc77a2
commit 1700cbf1c9
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48

10
alloc.c
View file

@ -496,12 +496,18 @@ static bool layer_needs_realloc(struct liftoff_layer *layer)
if (!prop->changed) { if (!prop->changed) {
continue; continue;
} }
/* If FB_ID changes from non-zero to zero, we don't need to
* display this layer anymore, so we may be able to re-use its
* plane for another layer. If FB_ID changes from
* non-zero to non-zero, we can try to re-use the previous
* allocation. */
if (strcmp(prop->name, "FB_ID") == 0) { if (strcmp(prop->name, "FB_ID") == 0) {
if (layer->force_composition) { if (layer->force_composition || prop->value == 0) {
return true; return true;
} }
/* TODO: check format/modifier is the same. Check /* TODO: check format/modifier is the same. Check
* previous/next value isn't zero. */ * previous value isn't zero. */
continue; continue;
} }