summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@armlinux.org.uk>2018-06-23 09:38:39 +0100
committerRussell King <rmk@armlinux.org.uk>2018-06-25 16:07:46 +0100
commitd52ffe9d313bfd2bf7dd26909f4de21827789453 (patch)
tree18983356df7be41b21e32bf450e3caa1afc23808
parent8b48fda5c572f7f897fc452527b20a9fac63b41e (diff)
etnaviv: handle translations with rotations
Signed-off-by: Russell King <rmk@armlinux.org.uk>
-rw-r--r--etnaviv/etnaviv_render.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/etnaviv/etnaviv_render.c b/etnaviv/etnaviv_render.c
index ee9da31..c22e58d 100644
--- a/etnaviv/etnaviv_render.c
+++ b/etnaviv/etnaviv_render.c
@@ -148,31 +148,25 @@ static Bool picture_transform(PicturePtr pict, struct transform_properties *p)
p->rot_mode = DE_ROT_MODE_ROT0;
return TRUE;
} else if (t->matrix[0][0] == pixman_int_to_fixed(-1) &&
- t->matrix[1][1] == pixman_int_to_fixed(-1) &&
- p->translation.x == pict->pDrawable->width &&
- p->translation.y == pict->pDrawable->height) {
+ t->matrix[1][1] == pixman_int_to_fixed(-1)) {
/* 180° rotation */
p->rot_mode = DE_ROT_MODE_ROT180;
- p->translation.x = 0;
- p->translation.y = 0;
+ p->translation.x -= pict->pDrawable->width;
+ p->translation.y -= pict->pDrawable->height;
return TRUE;
}
} else if (t->matrix[0][0] == 0 && t->matrix[1][1] == 0) {
if (t->matrix[0][1] == pixman_int_to_fixed(-1) &&
- t->matrix[1][0] == pixman_int_to_fixed(1) &&
- p->translation.x == pict->pDrawable->width &&
- p->translation.y == 0) {
+ t->matrix[1][0] == pixman_int_to_fixed(1)) {
/* Rotate left (90° anti-clockwise) */
p->rot_mode = DE_ROT_MODE_ROT90;
- p->translation.x = 0;
+ p->translation.x -= pict->pDrawable->width;
return TRUE;
} else if (t->matrix[0][1] == pixman_int_to_fixed(1) &&
- t->matrix[1][0] == pixman_int_to_fixed(-1) &&
- p->translation.x == 0 &&
- p->translation.y == pict->pDrawable->height) {
+ t->matrix[1][0] == pixman_int_to_fixed(-1)) {
/* Rotate right (90° clockwise) */
p->rot_mode = DE_ROT_MODE_ROT270;
- p->translation.y = 0;
+ p->translation.y -= pict->pDrawable->height;
return TRUE;
}
}