From d8f2e87473eae81e07922271b5f608fdceb4ae5e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 29 Nov 2011 10:59:48 +0000 Subject: [PATCH] sna/render: Fix check for "migrate whole pixmap" The whole pixmap means the sample covers the full width and height, not just either! Signed-off-by: Chris Wilson --- src/sna/sna_render.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index badde7c1..cf227c6e 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -259,14 +259,18 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box) w = box->x2 - box->x1; h = box->y2 - box->y1; - if (w == pixmap->drawable.width || h == pixmap->drawable.height) { - DBG(("%s: migrating whole pixmap (%dx%d) for source\n", + if (w == pixmap->drawable.width && h == pixmap->drawable.height) { + DBG(("%s: migrating whole pixmap (%dx%d) for source (%d,%d),(%d,%d)\n", __FUNCTION__, - pixmap->drawable.width, - pixmap->drawable.height)); + pixmap->drawable.width, pixmap->drawable.height, + box->x1, box->y1, box->x2, box->y2)); return TRUE; } + /* ignore tiny fractions */ + if (64*w*h < pixmap->drawable.width * pixmap->drawable.height) + return FALSE; + count = SOURCE_BIAS; priv = sna_pixmap(pixmap); if (priv)