summaryrefslogtreecommitdiff
path: root/sway/desktop/fx_renderer/fx_texture.c
diff options
context:
space:
mode:
authorErik Reider <[email protected]>2023-04-17 23:24:48 +0200
committerGitHub <[email protected]>2023-04-17 23:24:48 +0200
commitcbfb7af7fd4728f993124e81f8666a2e8cee6085 (patch)
tree081e51028d59da49480be6bff9c580bbdadca9cd /sway/desktop/fx_renderer/fx_texture.c
parent7d774f769cec2faec25d01120b05589a34b4eb0b (diff)
Add kawase blur (#120)
Co-authored-by: Erik Reider <[email protected]> Co-authored-by: Will McKinnon <[email protected]>
Diffstat (limited to 'sway/desktop/fx_renderer/fx_texture.c')
-rw-r--r--sway/desktop/fx_renderer/fx_texture.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sway/desktop/fx_renderer/fx_texture.c b/sway/desktop/fx_renderer/fx_texture.c
new file mode 100644
index 00000000..60aa9a26
--- /dev/null
+++ b/sway/desktop/fx_renderer/fx_texture.c
@@ -0,0 +1,19 @@
+#include <assert.h>
+#include <wlr/render/gles2.h>
+
+#include "sway/desktop/fx_renderer/fx_texture.h"
+
+struct fx_texture fx_texture_from_wlr_texture(struct wlr_texture* texture) {
+ assert(wlr_texture_is_gles2(texture));
+
+ struct wlr_gles2_texture_attribs texture_attrs;
+ wlr_gles2_texture_get_attribs(texture, &texture_attrs);
+
+ return (struct fx_texture) {
+ .target = texture_attrs.target,
+ .id = texture_attrs.tex,
+ .has_alpha = texture_attrs.has_alpha,
+ .width = texture->width,
+ .height = texture->height,
+ };
+}