gl-renderer: Simplify surface->is_opaque

We already have the format; no need to go chasing it again.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2022-01-14 02:10:22 +00:00
parent 4f88b2655e
commit 7506cf5240
1 changed files with 1 additions and 14 deletions

View File

@ -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;