summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-03-12 19:03:44 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-03-12 19:03:44 +0000
commitb1d0ca266cc67df65c81a9dbb9cc83027ff240ea (patch)
tree5575c0d05bec9f17bbb0cf706921e5824d9a1d07
parent50374fb4947e6682b6c8aced639b422110b6ec98 (diff)
sna/gen3: Reduce another use of transforms
Prefer the slightly cheaper _sna_get_transformed_scaled(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen3_render.c50
1 files changed, 20 insertions, 30 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 28b950fe..59d13db5 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -853,31 +853,25 @@ gen3_emit_composite_primitive_affine_source_mask(struct sna *sna,
v[0] = dst_x + w;
v[1] = dst_y + h;
- sna_get_transformed_coordinates(src_x + r->width, src_y + r->height,
- op->src.transform,
- &v[2], &v[3]);
- v[2] *= op->src.scale[0];
- v[3] *= op->src.scale[1];
+ _sna_get_transformed_scaled(src_x + r->width, src_y + r->height,
+ op->src.transform, op->src.scale,
+ &v[2], &v[3]);
v[4] = (msk_x + w) * op->mask.scale[0];
v[5] = (msk_y + h) * op->mask.scale[1];
v[6] = dst_x;
v[7] = v[1];
- sna_get_transformed_coordinates(src_x, src_y + r->height,
- op->src.transform,
- &v[8], &v[9]);
- v[8] *= op->src.scale[0];
- v[9] *= op->src.scale[1];
+ _sna_get_transformed_scaled(src_x, src_y + r->height,
+ op->src.transform, op->src.scale,
+ &v[8], &v[9]);
v[10] = msk_x * op->mask.scale[0];
v[11] =v[5];
v[12] = v[6];
v[13] = dst_y;
- sna_get_transformed_coordinates(src_x, src_y,
- op->src.transform,
- &v[14], &v[15]);
- v[14] *= op->src.scale[0];
- v[15] *= op->src.scale[1];
+ _sna_get_transformed_scaled(src_x, src_y,
+ op->src.transform, op->src.scale,
+ &v[14], &v[15]);
v[16] = v[10];
v[17] = msk_y * op->mask.scale[1];
}
@@ -1399,31 +1393,25 @@ gen3_emit_composite_primitive_affine_source_mask__sse2(struct sna *sna,
v[0] = dst_x + w;
v[1] = dst_y + h;
- sna_get_transformed_coordinates(src_x + r->width, src_y + r->height,
- op->src.transform,
- &v[2], &v[3]);
- v[2] *= op->src.scale[0];
- v[3] *= op->src.scale[1];
+ _sna_get_transformed_scaled(src_x + r->width, src_y + r->height,
+ op->src.transform, op->src.scale,
+ &v[2], &v[3]);
v[4] = (msk_x + w) * op->mask.scale[0];
v[5] = (msk_y + h) * op->mask.scale[1];
v[6] = dst_x;
v[7] = v[1];
- sna_get_transformed_coordinates(src_x, src_y + r->height,
- op->src.transform,
- &v[8], &v[9]);
- v[8] *= op->src.scale[0];
- v[9] *= op->src.scale[1];
+ _sna_get_transformed_scaled(src_x, src_y + r->height,
+ op->src.transform, op->src.scale,
+ &v[8], &v[9]);
v[10] = msk_x * op->mask.scale[0];
v[11] =v[5];
v[12] = v[6];
v[13] = dst_y;
- sna_get_transformed_coordinates(src_x, src_y,
- op->src.transform,
- &v[14], &v[15]);
- v[14] *= op->src.scale[0];
- v[15] *= op->src.scale[1];
+ _sna_get_transformed_scaled(src_x, src_y,
+ op->src.transform, op->src.scale,
+ &v[14], &v[15]);
v[16] = v[10];
v[17] = msk_y * op->mask.scale[1];
}
@@ -3789,6 +3777,8 @@ gen3_render_composite(struct sna *sna,
tmp->prim_emit = gen3_emit_composite_primitive_identity_source_mask;
}
} else if (tmp->src.is_affine) {
+ tmp->src.scale[0] /= tmp->src.transform->matrix[2][2];
+ tmp->src.scale[1] /= tmp->src.transform->matrix[2][2];
#if defined(sse2) && !defined(__x86_64__)
if (sna->cpu_features & SSE2) {
tmp->prim_emit = gen3_emit_composite_primitive_affine_source_mask__sse2;