diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-14 13:08:43 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-14 13:40:55 +0000 |
commit | c64d2572bafeacae25e9b58c8372ce91858c3832 (patch) | |
tree | 0c79534b73c4da3bc44f67182bce058fd9b87456 /src/sna/gen6_render.c | |
parent | b61e6398f0cf94d3c483e30c05ceae4a8383d16c (diff) |
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen6_render.c')
-rw-r--r-- | src/sna/gen6_render.c | 36 |
1 files changed, 33 insertions, 3 deletions
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); } |