mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
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.
This commit is contained in:
parent
f28c0e2046
commit
29291cb47c
10 changed files with 42 additions and 35 deletions
|
|
@ -46,11 +46,6 @@ static struct wlr_pixman_texture *get_texture(
|
|||
return (struct wlr_pixman_texture *)wlr_texture;
|
||||
}
|
||||
|
||||
static bool texture_is_opaque(struct wlr_texture *wlr_texture) {
|
||||
struct wlr_pixman_texture *texture = get_texture(wlr_texture);
|
||||
return !texture->format_info->has_alpha;
|
||||
}
|
||||
|
||||
static void texture_destroy(struct wlr_texture *wlr_texture) {
|
||||
struct wlr_pixman_texture *texture = get_texture(wlr_texture);
|
||||
wl_list_remove(&texture->link);
|
||||
|
|
@ -61,7 +56,6 @@ static void texture_destroy(struct wlr_texture *wlr_texture) {
|
|||
}
|
||||
|
||||
static const struct wlr_texture_impl texture_impl = {
|
||||
.is_opaque = texture_is_opaque,
|
||||
.destroy = texture_destroy,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue