aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/gles2/texture.c14
-rw-r--r--render/wlr_renderer.c12
-rw-r--r--render/wlr_texture.c5
3 files changed, 12 insertions, 19 deletions
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index 875affe2..ea05cde2 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -227,7 +227,6 @@ static bool gles2_texture_upload_eglimage(struct wlr_texture *wlr_tex,
return true;
}
-
static bool gles2_texture_upload_dmabuf(struct wlr_texture *_tex,
struct wl_resource *dmabuf_resource) {
struct wlr_gles2_texture *tex = (struct wlr_gles2_texture *)_tex;
@@ -263,17 +262,6 @@ static bool gles2_texture_upload_dmabuf(struct wlr_texture *_tex,
return true;
}
-static void gles2_texture_get_matrix(struct wlr_texture *_texture,
- float mat[static 9], const float projection[static 9], int x, int y) {
- struct wlr_gles2_texture *texture = (struct wlr_gles2_texture *)_texture;
- wlr_matrix_identity(mat);
- wlr_matrix_translate(mat, x, y);
- wlr_matrix_scale(mat, texture->wlr_texture.width,
- texture->wlr_texture.height);
- wlr_matrix_multiply(mat, projection, mat);
-}
-
-
static bool gles2_texture_get_dmabuf_size(struct wlr_texture *texture, struct
wl_resource *resource, int *width, int *height) {
if (!wlr_dmabuf_resource_is_buffer(resource)) {
@@ -287,7 +275,6 @@ static bool gles2_texture_get_dmabuf_size(struct wlr_texture *texture, struct
return true;
}
-
static void gles2_texture_get_buffer_size(struct wlr_texture *texture, struct
wl_resource *resource, int *width, int *height) {
struct wl_shm_buffer *buffer = wl_shm_buffer_get(resource);
@@ -344,7 +331,6 @@ static struct wlr_texture_impl wlr_texture_impl = {
.upload_drm = gles2_texture_upload_drm,
.upload_dmabuf = gles2_texture_upload_dmabuf,
.upload_eglimage = gles2_texture_upload_eglimage,
- .get_matrix = gles2_texture_get_matrix,
.get_buffer_size = gles2_texture_get_buffer_size,
.bind = gles2_texture_bind,
.destroy = gles2_texture_destroy,
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index e847fcc2..c4f91d5e 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -1,6 +1,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <wlr/render/interface.h>
+#include <wlr/types/wlr_matrix.h>
void wlr_renderer_init(struct wlr_renderer *renderer,
struct wlr_renderer_impl *impl) {
@@ -35,6 +36,17 @@ struct wlr_texture *wlr_render_texture_create(struct wlr_renderer *r) {
return r->impl->texture_create(r);
}
+bool wlr_render_texture(struct wlr_renderer *r, struct wlr_texture *texture,
+ const float projection[static 9], int x, int y, float alpha) {
+ float mat[9];
+ wlr_matrix_identity(mat);
+ wlr_matrix_translate(mat, x, y);
+ wlr_matrix_scale(mat, texture->width, texture->height);
+ wlr_matrix_multiply(mat, projection, mat);
+
+ return wlr_render_texture_with_matrix(r, texture, mat, alpha);
+}
+
bool wlr_render_texture_with_matrix(struct wlr_renderer *r,
struct wlr_texture *texture, const float matrix[static 9],
float alpha) {
diff --git a/render/wlr_texture.c b/render/wlr_texture.c
index 3685185a..48f76c8e 100644
--- a/render/wlr_texture.c
+++ b/render/wlr_texture.c
@@ -58,11 +58,6 @@ bool wlr_texture_upload_dmabuf(struct wlr_texture *texture,
return texture->impl->upload_dmabuf(texture, dmabuf_resource);
}
-void wlr_texture_get_matrix(struct wlr_texture *texture,
- float mat[static 9], const float projection[static 9], int x, int y) {
- texture->impl->get_matrix(texture, mat, projection, x, y);
-}
-
void wlr_texture_get_buffer_size(struct wlr_texture *texture, struct wl_resource
*resource, int *width, int *height) {
texture->impl->get_buffer_size(texture, resource, width, height);