diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-07-13 04:09:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 04:09:31 -0700 |
commit | 3ae423b0e35fb35cc4cee972c4f29f020efad877 (patch) | |
tree | b3c01080ead17997e8fe186d9bdeeabc79547c4c /render/gles2 | |
parent | d8bbdf3bd5edce03c550bb0982ac997392ac5711 (diff) | |
parent | 5bb272d7f398647a227344f86a232c8cc0181cce (diff) |
Merge pull request #1130 from emersion/surface-opaque
Add wlr_surface.opaque_region
Diffstat (limited to 'render/gles2')
-rw-r--r-- | render/gles2/texture.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/render/gles2/texture.c b/render/gles2/texture.c index 3c70a235..1e55f4c4 100644 --- a/render/gles2/texture.c +++ b/render/gles2/texture.c @@ -36,6 +36,11 @@ static void gles2_texture_get_size(struct wlr_texture *wlr_texture, int *width, *height = texture->height; } +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 gles2_texture_write_pixels(struct wlr_texture *wlr_texture, enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width, uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x, @@ -129,6 +134,7 @@ static void gles2_texture_destroy(struct wlr_texture *wlr_texture) { static const struct wlr_texture_impl texture_impl = { .get_size = gles2_texture_get_size, + .is_opaque = gles2_texture_is_opaque, .write_pixels = gles2_texture_write_pixels, .to_dmabuf = gles2_texture_to_dmabuf, .destroy = gles2_texture_destroy, |