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>
dev
Daniel Stone 3 years ago
parent 4f88b2655e
commit 7506cf5240
  1. 15
      libweston/renderer-gl/gl-renderer.c

@ -2846,19 +2846,6 @@ gl_renderer_import_dmabuf(struct weston_compositor *ec,
return true; 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 static void
gl_renderer_attach_dmabuf(struct weston_surface *surface, gl_renderer_attach_dmabuf(struct weston_surface *surface,
struct weston_buffer *buffer, struct weston_buffer *buffer,
@ -2879,7 +2866,7 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface,
gs->buffer_type = BUFFER_TYPE_EGL; gs->buffer_type = BUFFER_TYPE_EGL;
gs->y_inverted = (buffer->buffer_origin == ORIGIN_TOP_LEFT); gs->y_inverted = (buffer->buffer_origin == ORIGIN_TOP_LEFT);
gs->direct_display = dmabuf->direct_display; 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) if (dmabuf->direct_display)
return; return;

Loading…
Cancel
Save