From 070bd541e4a99fbc0d5918d2ad99e5e528576354 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Wed, 24 Jul 2013 13:13:33 +0800 Subject: [PATCH] sna/dri: fix can_blit() In case the origin of the drawable is outside the clip space, we have the right w/h Signed-off-by: Xiang, Haihao --- src/sna/sna_dri.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index 94721ba..ed43a99 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -927,8 +927,8 @@ can_blit(struct sna *sna, assert(get_private(src)->bo->flush); clip = &((WindowPtr)draw)->clipList; - w = clip->extents.x2 - draw->x; - h = clip->extents.y2 - draw->y; + w = clip->extents.x2 - max(clip->extents.x1, draw->x); + h = clip->extents.y2 - max(clip->extents.y1, draw->y); if ((w|h) <= 0) { DBG(("%s: reject, outside clip (%d, %d), (%d, %d)\n", __func__, -- 1.7.9.5