From 7506cf5240450620349b04085cd43492107b1ff2 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 14 Jan 2022 02:10:22 +0000 Subject: [PATCH] gl-renderer: Simplify surface->is_opaque We already have the format; no need to go chasing it again. Signed-off-by: Daniel Stone --- libweston/renderer-gl/gl-renderer.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index bf4435b6..99d80df6 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -2846,19 +2846,6 @@ gl_renderer_import_dmabuf(struct weston_compositor *ec, return true; } -static bool -dmabuf_is_opaque(struct linux_dmabuf_buffer *dmabuf) -{ - const struct pixel_format_info *info; - - info = pixel_format_get_info(dmabuf->attributes.format & - ~DRM_FORMAT_BIG_ENDIAN); - if (!info) - return false; - - return pixel_format_is_opaque(info); -} - static void gl_renderer_attach_dmabuf(struct weston_surface *surface, struct weston_buffer *buffer, @@ -2879,7 +2866,7 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface, gs->buffer_type = BUFFER_TYPE_EGL; gs->y_inverted = (buffer->buffer_origin == ORIGIN_TOP_LEFT); gs->direct_display = dmabuf->direct_display; - surface->is_opaque = dmabuf_is_opaque(dmabuf); + surface->is_opaque = pixel_format_is_opaque(buffer->pixel_format); if (dmabuf->direct_display) return;