aboutsummaryrefslogtreecommitdiff
path: root/include/wlr/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-04-27 12:27:01 +0200
committerDrew DeVault <sir@cmpwn.com>2020-06-17 09:10:54 -0600
commit315bf08733f4bc132a23200df26cb2145ac629b3 (patch)
treeb5e0c382c6ef343466e9a67e488337dbed1a5558 /include/wlr/render
parent00ccb89288d8d64c2f47282e74cf59967be7178b (diff)
render: add wlr_render_subtexture_with_matrix
This renders only a subset of the texture, instead of the full texture.
Diffstat (limited to 'include/wlr/render')
-rw-r--r--include/wlr/render/interface.h6
-rw-r--r--include/wlr/render/wlr_renderer.h7
2 files changed, 10 insertions, 3 deletions
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index 6eb6c22f..93c987b7 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -32,9 +32,9 @@ struct wlr_renderer_impl {
void (*end)(struct wlr_renderer *renderer);
void (*clear)(struct wlr_renderer *renderer, const float color[static 4]);
void (*scissor)(struct wlr_renderer *renderer, struct wlr_box *box);
- bool (*render_texture_with_matrix)(struct wlr_renderer *renderer,
- struct wlr_texture *texture, const float matrix[static 9],
- float alpha);
+ bool (*render_subtexture_with_matrix)(struct wlr_renderer *renderer,
+ struct wlr_texture *texture, const struct wlr_fbox *box,
+ const float matrix[static 9], float alpha);
void (*render_quad_with_matrix)(struct wlr_renderer *renderer,
const float color[static 4], const float matrix[static 9]);
void (*render_ellipse_with_matrix)(struct wlr_renderer *renderer,
diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h
index e6140f3e..513f412a 100644
--- a/include/wlr/render/wlr_renderer.h
+++ b/include/wlr/render/wlr_renderer.h
@@ -55,6 +55,13 @@ bool wlr_render_texture(struct wlr_renderer *r, struct wlr_texture *texture,
bool wlr_render_texture_with_matrix(struct wlr_renderer *r,
struct wlr_texture *texture, const float matrix[static 9], float alpha);
/**
+ * Renders the requested texture using the provided matrix, after cropping it
+ * to the provided rectangle.
+ */
+bool wlr_render_subtexture_with_matrix(struct wlr_renderer *r,
+ struct wlr_texture *texture, const struct wlr_fbox *box,
+ const float matrix[static 9], float alpha);
+/**
* Renders a solid rectangle in the specified color.
*/
void wlr_render_rect(struct wlr_renderer *r, const struct wlr_box *box,