compositor: Downgrade rather than drop buffer reference when copied

When the renderer/backend indicate that they do not need a surface's
buffer content to be preserved, most often because they have copied it,
simply downgrade the buffer reference to 'will not access', rather than
drop the buffer reference altogether.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2022-01-15 02:18:32 +00:00
parent a42908204f
commit 7a27f6cbe4
1 changed files with 1 additions and 1 deletions

View File

@ -2734,7 +2734,7 @@ output_accumulate_damage(struct weston_output *output)
*/
if (!pnode->surface->keep_buffer) {
weston_buffer_reference(&pnode->surface->buffer_ref,
NULL,
pnode->surface->buffer_ref.buffer,
BUFFER_WILL_NOT_BE_ACCESSED);
weston_buffer_release_reference(
&pnode->surface->buffer_release_ref, NULL);