From 4b8b6b98e5b6aa404a7c92f2ac7c25065ef66756 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 17 Mar 2016 09:37:14 +0100 Subject: [PATCH xserver RFC v2] glamor: fix wrong offset on composite rectangles When using PictOpSrc, the destination is wrongly shifted back to (0, 0). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94568 Signed-off-by: Olivier Fourdan --- v2: Cleaup-up, move relevant code where it's actually used; Note: I am not entirely confident with this patch, it fixes the issue for me but I am definitely not certain it's correct... glamor/glamor_compositerects.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/glamor/glamor_compositerects.c b/glamor/glamor_compositerects.c index 885a6c0..199e627 100644 --- a/glamor/glamor_compositerects.c +++ b/glamor/glamor_compositerects.c @@ -107,7 +107,6 @@ glamor_composite_rectangles(CARD8 op, struct glamor_pixmap_private *priv; pixman_region16_t region; pixman_box16_t *boxes; - int dst_x, dst_y; int num_boxes; PicturePtr source = NULL; Bool need_free_region = FALSE; @@ -225,17 +224,18 @@ glamor_composite_rectangles(CARD8 op, RegionExtents(®ion)->x2, RegionExtents(®ion)->y2, RegionNumRects(®ion)); - glamor_get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y); - pixman_region_translate(®ion, dst_x, dst_y); - - DEBUGF("%s: pixmap +(%d, %d) extents (%d, %d),(%d, %d)\n", - __FUNCTION__, dst_x, dst_y, - RegionExtents(®ion)->x1, RegionExtents(®ion)->y1, - RegionExtents(®ion)->x2, RegionExtents(®ion)->y2); - boxes = pixman_region_rectangles(®ion, &num_boxes); if (op == PictOpSrc || op == PictOpClear) { CARD32 pixel; + int dst_x, dst_y; + + glamor_get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y); + pixman_region_translate(®ion, dst_x, dst_y); + + DEBUGF("%s: pixmap +(%d, %d) extents (%d, %d),(%d, %d)\n", + __FUNCTION__, dst_x, dst_y, + RegionExtents(®ion)->x1, RegionExtents(®ion)->y1, + RegionExtents(®ion)->x2, RegionExtents(®ion)->y2); if (op == PictOpClear) pixel = 0; -- 2.5.0