From c64d2572bafeacae25e9b58c8372ce91858c3832 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 14 Mar 2014 13:08:43 +0000 Subject: sna: Allow some leeway when deciding to discard common translations Under PictFilterNearest, we can ignore fractional translations (not all renderers discard those.) And if we are being approximate, we can loosen our tolerance as well. Signed-off-by: Chris Wilson --- src/sna/gen6_render.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'src/sna/gen6_render.c') diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 577d1c0b..f1f79463 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -1713,8 +1713,8 @@ gen6_composite_picture(struct sna *sna, uint32_t color; int16_t dx, dy; - DBG(("%s: (%d, %d)x(%d, %d), dst=(%d, %d)\n", - __FUNCTION__, x, y, w, h, dst_x, dst_y)); + DBG(("%s: (%d, %d)x(%d, %d), dst=(%d, %d), precise=%d\n", + __FUNCTION__, x, y, w, h, dst_x, dst_y, precise)); channel->is_solid = false; channel->card_format = -1; @@ -1766,7 +1766,7 @@ gen6_composite_picture(struct sna *sna, y += dy + picture->pDrawable->y; channel->is_affine = sna_transform_is_affine(picture->transform); - if (sna_transform_is_integer_translation(picture->transform, &dx, &dy)) { + if (sna_transform_is_imprecise_integer_translation(picture->transform, picture->filter, precise, &dx, &dy)) { DBG(("%s: integer translation (%d, %d), removing\n", __FUNCTION__, dx, dy)); x += dx; @@ -1790,6 +1790,36 @@ gen6_composite_picture(struct sna *sna, x, y, w, h, dst_x, dst_y); } + DBG(("%s: pixmap, repeat=%d, filter=%d, transform?=%d [affine? %d], format=%08x\n", + __FUNCTION__, + channel->repeat, channel->filter, + channel->transform != NULL, channel->is_affine, + channel->pict_format)); + if (channel->transform) { +#define f2d(x) (((double)(x))/65536.) + DBG(("%s: transform=[%f %f %f, %f %f %f, %f %f %f] (raw [%x %x %x, %x %x %x, %x %x %x])\n", + __FUNCTION__, + f2d(channel->transform->matrix[0][0]), + f2d(channel->transform->matrix[0][1]), + f2d(channel->transform->matrix[0][2]), + f2d(channel->transform->matrix[1][0]), + f2d(channel->transform->matrix[1][1]), + f2d(channel->transform->matrix[1][2]), + f2d(channel->transform->matrix[2][0]), + f2d(channel->transform->matrix[2][1]), + f2d(channel->transform->matrix[2][2]), + channel->transform->matrix[0][0], + channel->transform->matrix[0][1], + channel->transform->matrix[0][2], + channel->transform->matrix[1][0], + channel->transform->matrix[1][1], + channel->transform->matrix[1][2], + channel->transform->matrix[2][0], + channel->transform->matrix[2][1], + channel->transform->matrix[2][2])); +#undef f2d + } + return sna_render_pixmap_bo(sna, channel, pixmap, x, y, w, h, dst_x, dst_y); } -- cgit v1.2.3