From d7f63ab76c06737217189b2733ab2ae5fa13fc9b Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 21 May 2024 15:41:05 +0100 Subject: [PATCH] render/pixman: Remove half-pixel shift Reverts 77006e55652c9e2777ad51755cea30e3ed6142a8. It turns out this change really breaks the labwc drop-shadow implementation (which relies on scaling up single-pixel-wide buffers). After reverting this there's still something subtley wrong with scaling pixel locations (shown by `weston-scaler -b`) but I can't see an obvious way to make both weston-scaler and labwc drop-shadows work in the same way with pixman and gles2. I'll have a harder look at this but in the mean time reverting this patch seems to make things less broken on average. --- render/pixman/pass.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/render/pixman/pass.c b/render/pixman/pass.c index ccd629ede..24b8a1b98 100644 --- a/render/pixman/pass.c +++ b/render/pixman/pass.c @@ -155,13 +155,6 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass, pixman_transform_translate(&transform, NULL, pixman_int_to_fixed(src_box.x), pixman_int_to_fixed(src_box.y)); - // GPUs have a half pixel shift compared to pixman because GPU coordinates refer - // to the centre of each pixel rather than its top-left. This makes no difference - // when there's no transforms as we still copy the correct pixel across. But when - // we do scaling it does make a visible difference, so account for it here. - pixman_transform_translate(&transform, NULL, - -pixman_double_to_fixed(0.5), -pixman_double_to_fixed(0.5)); - pixman_image_set_transform(texture->image, &transform); switch (options->filter_mode) {