From 29291cb47cdaa72d1142a008fef3301dcb86dfac Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 16 Jun 2022 14:43:24 +0200 Subject: render/texture: drop wlr_texture_is_opaque Whether a texture is opaque or not doesn't depend on the renderer at all, it just depends on the source buffer. Instead of forcing all renderers to implement wlr_texture_impl.is_opaque, let's move this in common code and use the wlr_buffer format to know whether a texture will be opaque. --- render/gles2/texture.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'render/gles2') diff --git a/render/gles2/texture.c b/render/gles2/texture.c index 57420744..d794e436 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -29,11 +29,6 @@ struct wlr_gles2_texture *gles2_get_texture( return (struct wlr_gles2_texture *)wlr_texture; } -static bool gles2_texture_is_opaque(struct wlr_texture *wlr_texture) { - struct wlr_gles2_texture *texture = gles2_get_texture(wlr_texture); - return !texture->has_alpha; -} - static bool check_stride(const struct wlr_pixel_format_info *fmt, uint32_t stride, uint32_t width) { if (stride % (fmt->bpp / 8) != 0) { @@ -161,7 +156,6 @@ static void gles2_texture_unref(struct wlr_texture *wlr_texture) { } static const struct wlr_texture_impl texture_impl = { - .is_opaque = gles2_texture_is_opaque, .write_pixels = gles2_texture_write_pixels, .destroy = gles2_texture_unref, }; -- cgit v1.2.3