aboutsummaryrefslogtreecommitdiff
path: root/include/sway/output.h
diff options
context:
space:
mode:
authorAlexander Orzechowski <alex@ozal.ski>2023-04-27 11:19:58 +0200
committerSimon Ser <contact@emersion.fr>2023-05-02 18:31:55 +0200
commitd5cc474aef6bf5a23694053ab9c8770ea3f21e6f (patch)
tree9bead7ab099de9675204d82ae397746cec232ff8 /include/sway/output.h
parent33cfdbe886144e8515593d96a80d850a7c6e382e (diff)
render: pass rendering state together in a struct
This lets us easily add rendering state that we need in the future
Diffstat (limited to 'include/sway/output.h')
-rw-r--r--include/sway/output.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/sway/output.h b/include/sway/output.h
index 04202976..b397c8e2 100644
--- a/include/sway/output.h
+++ b/include/sway/output.h
@@ -65,6 +65,12 @@ struct sway_output_non_desktop {
struct wl_listener destroy;
};
+struct render_context {
+ struct sway_output *output;
+ struct wlr_renderer *renderer;
+ const pixman_region32_t *output_damage;
+};
+
struct sway_output *output_create(struct wlr_output *wlr_output);
void output_destroy(struct sway_output *output);
@@ -115,7 +121,7 @@ bool output_has_opaque_overlay_layer_surface(struct sway_output *output);
struct sway_workspace *output_get_active_workspace(struct sway_output *output);
-void output_render(struct sway_output *output, pixman_region32_t *damage);
+void output_render(struct render_context *ctx);
void output_surface_for_each_surface(struct sway_output *output,
struct wlr_surface *surface, double ox, double oy,
@@ -168,8 +174,7 @@ void output_get_box(struct sway_output *output, struct wlr_box *box);
enum sway_container_layout output_get_default_layout(
struct sway_output *output);
-void render_rect(struct sway_output *output,
- const pixman_region32_t *output_damage, const struct wlr_box *_box,
+void render_rect(struct render_context *ctx, const struct wlr_box *_box,
float color[static 4]);
void premultiply_alpha(float color[4], float opacity);