sna: Refactor test for a rotation matrix
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
347c5a7b33
commit
bdd0cca4e1
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -619,6 +619,12 @@ bool sna_transform_is_integer_translation(const PictTransform *t,
|
|||
int16_t *tx, int16_t *ty);
|
||||
bool sna_transform_is_translation(const PictTransform *t,
|
||||
pixman_fixed_t *tx, pixman_fixed_t *ty);
|
||||
static inline bool
|
||||
sna_affine_transform_is_rotation(const PictTransform *t)
|
||||
{
|
||||
assert(sna_transform_is_affine(t));
|
||||
return t->matrix[0][1] | t->matrix[1][0];
|
||||
}
|
||||
|
||||
static inline bool
|
||||
sna_transform_equal(const PictTransform *a, const PictTransform *b)
|
||||
|
|
|
|||
Loading…
Reference in New Issue