summaryrefslogtreecommitdiff
path: root/randr/rrtransform.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-02-23 11:18:12 -0800
committerKeith Packard <keithp@keithp.com>2011-02-23 11:18:12 -0800
commita91d33917befd6719bb7f01007bc253a2aefb0bb (patch)
treedabf61fa7a6245b6417c7fce34d9f1b73a92b1dd /randr/rrtransform.c
parent3d4ee25a1e2e0ed2463ceaabea8f5a284a6ddd60 (diff)
Revert "randr: Add sprite position transforms"
Diffstat (limited to 'randr/rrtransform.c')
-rw-r--r--randr/rrtransform.c64
1 files changed, 5 insertions, 59 deletions
diff --git a/randr/rrtransform.c b/randr/rrtransform.c
index 3eda5f3cd..e1620498b 100644
--- a/randr/rrtransform.c
+++ b/randr/rrtransform.c
@@ -134,24 +134,6 @@ RRTransformRescale(struct pixman_f_transform *f_transform, double limit)
f_transform->m[j][i] *= scale;
}
-#define EPSILON (1e-20)
-#define IS_F_SAME(a,b) (fabs((a)-(b)) < EPSILON)
-#define IS_F_ZERO(a) (fabs(a) < EPSILON)
-
-static Bool
-pict_f_transform_is_identity (const struct pixman_f_transform *t)
-{
- return (IS_F_SAME (t->m[0][0], t->m[1][1]) &&
- IS_F_SAME (t->m[0][0], t->m[2][2]) &&
- !IS_F_ZERO (t->m[0][0]) &&
- IS_F_ZERO (t->m[0][1]) &&
- IS_F_ZERO (t->m[0][2]) &&
- IS_F_ZERO (t->m[1][0]) &&
- IS_F_ZERO (t->m[1][2]) &&
- IS_F_ZERO (t->m[2][0]) &&
- IS_F_ZERO (t->m[2][1]));
-}
-
/*
* Compute the complete transformation matrix including
* client-specified transform, rotation/reflection values and the crtc
@@ -166,39 +148,23 @@ RRTransformCompute (int x,
int height,
Rotation rotation,
RRTransformPtr rr_transform,
- struct pixman_f_transform *sprite_position_transform,
- struct pixman_f_transform *sprite_image_transform,
PictTransformPtr transform,
struct pixman_f_transform *f_transform,
- struct pixman_f_transform *f_inverse,
- struct pixman_f_transform *f_fb_to_sprite,
- struct pixman_f_transform *f_sprite_to_image,
- Bool *sprite_transform_in_use)
+ struct pixman_f_transform *f_inverse)
{
PictTransform t_transform, inverse;
struct pixman_f_transform tf_transform, tf_inverse;
- struct pixman_f_transform sf_position_transform, sf_image_transform;
- struct pixman_f_transform f_image_to_sprite;
Bool overflow = FALSE;
- Bool ret = TRUE;
if (!transform) transform = &t_transform;
if (!f_transform) f_transform = &tf_transform;
if (!f_inverse) f_inverse = &tf_inverse;
- if (!f_fb_to_sprite) f_fb_to_sprite = &sf_position_transform;
- if (!f_sprite_to_image) f_sprite_to_image = &sf_image_transform;
-
- /* invert the sprite image transform to have it go from dest to source */
- if (!pixman_f_transform_invert (&f_image_to_sprite, f_sprite_to_image))
- pixman_f_transform_init_identity(&f_image_to_sprite);
pixman_transform_init_identity (transform);
pixman_transform_init_identity (&inverse);
pixman_f_transform_init_identity (f_transform);
pixman_f_transform_init_identity (f_inverse);
- pixman_f_transform_init_identity (f_fb_to_sprite);
- pixman_f_transform_init_identity (f_sprite_to_image);
if (rotation != RR_Rotate_0)
{
double f_rot_cos, f_rot_sin, f_rot_dx, f_rot_dy;
@@ -280,14 +246,7 @@ RRTransformCompute (int x,
pixman_f_transform_translate (f_transform, f_inverse, f_scale_dx, f_scale_dy);
}
- /*
- * Sprite position is affected by the transform matrix,
- * but the image is not
- */
- pixman_f_transform_multiply(f_sprite_to_image,
- f_transform,
- &f_image_to_sprite);
-
+#ifdef RANDR_12_INTERFACE
if (rr_transform)
{
if (!pixman_transform_multiply (transform, &rr_transform->transform, transform))
@@ -295,7 +254,7 @@ RRTransformCompute (int x,
pixman_f_transform_multiply (f_transform, &rr_transform->f_transform, f_transform);
pixman_f_transform_multiply (f_inverse, f_inverse, &rr_transform->f_inverse);
}
-
+#endif
/*
* Compute the class of the resulting transform
*/
@@ -305,7 +264,7 @@ RRTransformCompute (int x,
pixman_f_transform_init_translate (f_transform, x, y);
pixman_f_transform_init_translate (f_inverse, -x, -y);
- ret = FALSE;
+ return FALSE;
}
else
{
@@ -319,19 +278,6 @@ RRTransformCompute (int x,
RRTransformRescale(&f_scaled, 16384.0);
pixman_transform_from_pixman_f_transform(transform, &f_scaled);
}
- ret = TRUE;
+ return TRUE;
}
-
- /*
- * Sprite position is affected by the transform matrix,
- * but the image is not
- */
- pixman_f_transform_multiply(f_fb_to_sprite,
- f_inverse,
- sprite_position_transform);
- if (sprite_transform_in_use)
- *sprite_transform_in_use = ret || !pict_f_transform_is_identity(f_fb_to_sprite);
- return ret;
}
-
-