diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-21 14:20:23 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-21 14:20:23 +0000 |
commit | bdd0cca4e1192df0038621925c4e6243ba419a81 (patch) | |
tree | 3334b7c3f5a13a3b8a2757854cf0fc2ea0acdb00 /src/sna/gen4_vertex.c | |
parent | 347c5a7b33729f1bedd408d2ef24756d51b66f1d (diff) |
sna: Refactor test for a rotation matrix
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen4_vertex.c')
-rw-r--r-- | src/sna/gen4_vertex.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c index b3022330..a70c3c81 100644 --- a/src/sna/gen4_vertex.c +++ b/src/sna/gen4_vertex.c @@ -691,8 +691,7 @@ void gen4_choose_composite_emitter(struct sna_composite_op *tmp) DBG(("%s: identity source, identity mask\n", __FUNCTION__)); tmp->prim_emit = emit_primitive_identity_source_mask; } else if (tmp->src.is_affine) { - if (tmp->src.transform->matrix[0][1] == 0 && - tmp->src.transform->matrix[1][0] == 0) { + if (!sna_affine_transform_is_rotation(tmp->src.transform)) { DBG(("%s: simple src, identity mask\n", __FUNCTION__)); tmp->src.scale[0] /= tmp->src.transform->matrix[2][2]; tmp->src.scale[1] /= tmp->src.transform->matrix[2][2]; @@ -713,8 +712,7 @@ void gen4_choose_composite_emitter(struct sna_composite_op *tmp) DBG(("%s: identity src, no mask\n", __FUNCTION__)); tmp->prim_emit = emit_primitive_identity_source; } else if (tmp->src.is_affine) { - if (tmp->src.transform->matrix[0][1] == 0 && - tmp->src.transform->matrix[1][0] == 0) { + if (!sna_affine_transform_is_rotation(tmp->src.transform)) { DBG(("%s: simple src, no mask\n", __FUNCTION__)); tmp->src.scale[0] /= tmp->src.transform->matrix[2][2]; tmp->src.scale[1] /= tmp->src.transform->matrix[2][2]; @@ -883,8 +881,7 @@ void gen4_choose_spans_emitter(struct sna_composite_spans_op *tmp) } else if (tmp->base.src.transform == NULL) { tmp->prim_emit = emit_spans_identity; } else if (tmp->base.is_affine) { - if (tmp->base.src.transform->matrix[0][1] == 0 && - tmp->base.src.transform->matrix[1][0] == 0) { + if (!sna_affine_transform_is_rotation(tmp->base.src.transform)) { tmp->base.src.scale[0] /= tmp->base.src.transform->matrix[2][2]; tmp->base.src.scale[1] /= tmp->base.src.transform->matrix[2][2]; tmp->prim_emit = emit_spans_simple; |