aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index c9fdfd95..f25055b8 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -29,10 +29,7 @@
#include "sway/tree/workspace.h"
struct render_data {
- struct root_geometry root_geo;
- struct sway_output *output;
pixman_region32_t *damage;
- struct sway_view *view;
float alpha;
};
@@ -92,11 +89,11 @@ damage_finish:
pixman_region32_fini(&damage);
}
-static void render_surface_iterator(struct wlr_surface *surface, int sx, int sy,
+static void render_surface_iterator(struct sway_output *output,
+ struct wlr_surface *surface, struct wlr_box *_box, float rotation,
void *_data) {
struct render_data *data = _data;
- struct wlr_output *wlr_output = data->output->wlr_output;
- float rotation = data->root_geo.rotation;
+ struct wlr_output *wlr_output = output->wlr_output;
pixman_region32_t *output_damage = data->damage;
float alpha = data->alpha;
@@ -105,13 +102,7 @@ static void render_surface_iterator(struct wlr_surface *surface, int sx, int sy,
return;
}
- struct wlr_box box;
- bool intersects = output_get_surface_box(&data->root_geo, data->output,
- surface, sx, sy, &box);
- if (!intersects) {
- return;
- }
-
+ struct wlr_box box = *_box;
scale_box(&box, wlr_output->scale);
float matrix[9];
@@ -126,33 +117,32 @@ static void render_surface_iterator(struct wlr_surface *surface, int sx, int sy,
static void render_layer(struct sway_output *output,
pixman_region32_t *damage, struct wl_list *layer_surfaces) {
struct render_data data = {
- .output = output,
.damage = damage,
.alpha = 1.0f,
};
- output_layer_for_each_surface(layer_surfaces, &data.root_geo,
+ output_layer_for_each_surface(output, layer_surfaces,
render_surface_iterator, &data);
}
+
#ifdef HAVE_XWAYLAND
static void render_unmanaged(struct sway_output *output,
pixman_region32_t *damage, struct wl_list *unmanaged) {
struct render_data data = {
- .output = output,
.damage = damage,
.alpha = 1.0f,
};
- output_unmanaged_for_each_surface(unmanaged, output, &data.root_geo,
+ output_unmanaged_for_each_surface(output, unmanaged,
render_surface_iterator, &data);
}
#endif
+
static void render_drag_icons(struct sway_output *output,
pixman_region32_t *damage, struct wl_list *drag_icons) {
struct render_data data = {
- .output = output,
.damage = damage,
.alpha = 1.0f,
};
- output_drag_icons_for_each_surface(drag_icons, output, &data.root_geo,
+ output_drag_icons_for_each_surface(output, drag_icons,
render_surface_iterator, &data);
}
@@ -199,13 +189,10 @@ static void premultiply_alpha(float color[4], float opacity) {
static void render_view_surfaces(struct sway_view *view,
struct sway_output *output, pixman_region32_t *damage, float alpha) {
struct render_data data = {
- .output = output,
.damage = damage,
- .view = view,
.alpha = alpha,
};
- output_view_for_each_surface(view, output, &data.root_geo,
- render_surface_iterator, &data);
+ output_view_for_each_surface(output, view, render_surface_iterator, &data);
}
static void render_saved_view(struct sway_view *view,