render/pixman: Remove half-pixel shift

Reverts 77006e5565.  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.
master
David Turner 7 months ago committed by Simon Ser
parent 36c0d5fe3a
commit d7f63ab76c

@ -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) {

Loading…
Cancel
Save