From 51fe874ad4152fceaf2de50db96c1ec5e08bca1b Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 15 Jun 2022 21:11:40 +0100 Subject: [PATCH] libweston: Use weston_surface_has_content() in core compositor Used when taking the size from a buffer, as well as in subsurface handling. Signed-off-by: Daniel Stone --- libweston/compositor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 6b48d74d..a176626e 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -2121,7 +2121,7 @@ weston_surface_calculate_size_from_buffer(struct weston_surface *surface) { struct weston_buffer_viewport *vp = &surface->buffer_viewport; - if (!surface->buffer_ref.buffer) { + if (!weston_surface_has_content(surface)) { surface->width_from_buffer = 0; surface->height_from_buffer = 0; return; @@ -4531,7 +4531,7 @@ subsurface_committed(struct weston_surface *surface, int32_t dx, int32_t dy) */ if (!weston_surface_is_mapped(surface)) { - surface->is_mapped = surface->buffer_ref.buffer != NULL; + surface->is_mapped = weston_surface_has_content(surface); /* Cannot call weston_view_update_transform(), * because that would call it also for the parent surface,