aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-05-10 23:20:00 +0100
committeremersion <contact@emersion.fr>2018-05-10 23:22:00 +0100
commit44fcc06efd1a3d4bc37141c723c6654f60d8f923 (patch)
tree7b74a17124cb1d8a0adf777b9cb337574bea52a7 /sway/desktop
parent90614f3a6399b0f86b4dea2256ea42703c13edd4 (diff)
Fix damage tracking on HiDPI
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/output.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index d1c6dbf9..c150270e 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -191,17 +191,14 @@ static void scissor_output(struct wlr_output *wlr_output,
static void render_texture(struct wlr_output *wlr_output,
pixman_region32_t *output_damage, struct wlr_texture *texture,
- const struct wlr_box *_box, const float matrix[static 9], float alpha) {
+ const struct wlr_box *box, const float matrix[static 9], float alpha) {
struct wlr_renderer *renderer =
wlr_backend_get_renderer(wlr_output->backend);
- struct wlr_box box = *_box;
- scale_box(&box, wlr_output->scale);
-
pixman_region32_t damage;
pixman_region32_init(&damage);
- pixman_region32_union_rect(&damage, &damage, box.x, box.y,
- box.width, box.height);
+ pixman_region32_union_rect(&damage, &damage, box->x, box->y,
+ box->width, box->height);
pixman_region32_intersect(&damage, &damage, output_damage);
bool damaged = pixman_region32_not_empty(&damage);
if (!damaged) {
@@ -238,6 +235,8 @@ static void render_surface_iterator(struct wlr_surface *surface, int sx, int sy,
return;
}
+ scale_box(&box, wlr_output->scale);
+
float matrix[9];
enum wl_output_transform transform =
wlr_output_transform_invert(surface->current->transform);
@@ -384,7 +383,11 @@ static void render_container_simple_border_normal(struct sway_output *output,
// Title text
if (title_texture) {
- struct wlr_box texture_box = { .x = box.x, .y = box.y };
+ float output_scale = output->wlr_output->scale;
+ struct wlr_box texture_box = {
+ .x = box.x * output_scale,
+ .y = box.y * output_scale,
+ };
wlr_texture_get_size(title_texture,
&texture_box.width, &texture_box.height);
@@ -392,8 +395,8 @@ static void render_container_simple_border_normal(struct sway_output *output,
wlr_matrix_project_box(matrix, &texture_box, WL_OUTPUT_TRANSFORM_NORMAL,
0.0, output->wlr_output->transform_matrix);
- render_texture(output->wlr_output, output_damage, title_texture, &box,
- matrix, 1.0);
+ render_texture(output->wlr_output, output_damage, title_texture,
+ &texture_box, matrix, 1.0);
}
}
@@ -566,7 +569,7 @@ static void render_output(struct sway_output *output, struct timespec *when,
goto renderer_end;
}
- //wlr_renderer_clear(renderer, (float[]){1, 1, 0, 0});
+ //wlr_renderer_clear(renderer, (float[]){1, 1, 0, 1});
struct sway_container *workspace = output_get_active_workspace(output);