aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-08-28 15:00:43 -0400
committerAlexander Orzechowski <alex@ozal.ski>2023-09-21 02:25:34 -0400
commit5299d973d5f497180b0ccf80d09a4aed4ebbfea2 (patch)
treea7685c9882bb45bc328f255d4b9153f6b0b48f3f /render
parentdbc7a5cada37d192821e1104b356ff891b8bd787 (diff)
render/pass: Introduce wlr_render_rect_options_get_box
Diffstat (limited to 'render')
-rw-r--r--render/pass.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/render/pass.c b/render/pass.c
index 0fa31556..a36b9dc1 100644
--- a/render/pass.c
+++ b/render/pass.c
@@ -74,6 +74,20 @@ float wlr_render_texture_options_get_alpha(const struct wlr_render_texture_optio
return *options->alpha;
}
+void wlr_render_rect_options_get_box(const struct wlr_render_rect_options *options,
+ const struct wlr_buffer *buffer, struct wlr_box *box) {
+ if (wlr_box_empty(&options->box)) {
+ *box = (struct wlr_box){
+ .width = buffer->width,
+ .height = buffer->height,
+ };
+
+ return;
+ }
+
+ *box = options->box;
+}
+
static const struct wlr_render_pass_impl legacy_impl;
static struct wlr_render_pass_legacy *legacy_pass_from_pass(struct wlr_render_pass *pass) {