neuwld

patched neuwld library (tracked)
git clone https://git.daat.foo/neuwld.git
Log | Files | Refs | README | LICENSE

commit dbf96c577e651d152fa842537e636907a7784adb
parent a586b031f18229087413922cd731631dbbe3bd87
Author: Michael Forney <mforney@mforney.org>
Date:   Sat,  4 Jan 2020 13:13:52 -0800

pixman: Use destination clipping for copy_region

Source clipping is ignored by default unless set explicitly with
pixman_image_set_has_client_clip and pixman_image_set_source_clipping.

Diffstat:
Mpixman.c | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/pixman.c b/pixman.c @@ -313,18 +313,25 @@ renderer_copy_region(struct wld_renderer *base, struct buffer *buffer, { struct pixman_renderer *renderer = pixman_renderer(base); pixman_image_t *src = pixman_image(buffer), *dst = renderer->target; + pixman_region32_t clip; if (!src) return; - pixman_image_set_clip_region32(src, region); + pixman_region32_init(&clip); + pixman_region32_copy(&clip, region); + pixman_region32_translate(&clip, dst_x, dst_y); + + pixman_image_set_clip_region32(dst, &clip); pixman_image_composite32(PIXMAN_OP_SRC, src, NULL, dst, region->extents.x1, region->extents.y1, 0, 0, region->extents.x1 + dst_x, region->extents.y1 + dst_y, region->extents.x2 - region->extents.x1, region->extents.y2 - region->extents.y1); - pixman_image_set_clip_region32(src, NULL); + pixman_image_set_clip_region32(dst, NULL); + + pixman_region32_fini(&clip); } static inline uint8_t