commit dbf96c5

Michael Forney  ·  2020-01-04 21:13:52 +0000 UTC
parent a586b03
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.
1 files changed,  +9, -2
+9, -2
 1@@ -313,18 +313,25 @@ renderer_copy_region(struct wld_renderer *base, struct buffer *buffer,
 2 {
 3 	struct pixman_renderer *renderer = pixman_renderer(base);
 4 	pixman_image_t *src = pixman_image(buffer), *dst = renderer->target;
 5+	pixman_region32_t clip;
 6 
 7 	if (!src)
 8 		return;
 9 
10-	pixman_image_set_clip_region32(src, region);
11+	pixman_region32_init(&clip);
12+	pixman_region32_copy(&clip, region);
13+	pixman_region32_translate(&clip, dst_x, dst_y);
14+
15+	pixman_image_set_clip_region32(dst, &clip);
16 	pixman_image_composite32(PIXMAN_OP_SRC, src, NULL, dst,
17 	                         region->extents.x1, region->extents.y1, 0, 0,
18 	                         region->extents.x1 + dst_x,
19 	                         region->extents.y1 + dst_y,
20 	                         region->extents.x2 - region->extents.x1,
21 	                         region->extents.y2 - region->extents.y1);
22-	pixman_image_set_clip_region32(src, NULL);
23+	pixman_image_set_clip_region32(dst, NULL);
24+
25+	pixman_region32_fini(&clip);
26 }
27 
28 static inline uint8_t