diff options
author | Keith Packard <keithp@keithp.com> | 2008-03-19 00:46:35 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2008-11-24 13:24:40 -0800 |
commit | 49db14e4ac26070ed86088419483888dda18b603 (patch) | |
tree | 24f45d2c6117e204cf489633ac29eedccce9688f /render/picturestr.h | |
parent | 6f734aecaec4f5c6152c3ebca197ef65bb4523da (diff) |
Handle RandR transform matrices in floating point.
RandR matrix computations lose too much precision in fixed point;
computations using the inverted matrix can be as much as 10 pixels off.
Convert them to double precision values and pass those around. These API
changes are fairly heavyweight; the official Render interface remains fixed
point, so the fixed point matrix comes along for the ride everywhere.
Diffstat (limited to 'render/picturestr.h')
-rw-r--r-- | render/picturestr.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/render/picturestr.h b/render/picturestr.h index 658e221b4..b18f3168c 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -56,6 +56,14 @@ typedef struct _PictFormat { typedef struct pixman_vector PictVector, *PictVectorPtr; typedef struct pixman_transform PictTransform, *PictTransformPtr; +struct pict_f_vector { + double v[3]; +}; + +struct pict_f_transform { + double m[3][3]; +}; + #define PICT_GRADIENT_STOPTABLE_SIZE 1024 #define SourcePictTypeSolidFill 0 #define SourcePictTypeLinear 1 @@ -745,4 +753,59 @@ void xRenderTransform_from_PictTransform (xRenderTransform *render, PictTransformPtr pict); +void +pict_f_transform_from_pixman_transform (struct pict_f_transform *ft, + struct pixman_transform *t); + +Bool +pixman_transform_from_pict_f_transform (struct pixman_transform *t, + struct pict_f_transform *ft); + +Bool +pict_f_transform_invert (struct pict_f_transform *r, + struct pict_f_transform *m); + + +Bool +pict_f_transform_point (struct pict_f_transform *t, + struct pict_f_vector *v); + +void +pict_f_transform_point_3d (struct pict_f_transform *t, + struct pict_f_vector *v); + +void +pict_f_transform_multiply (struct pict_f_transform *dst, + struct pict_f_transform *l, struct pict_f_transform *r); + +void +pict_f_transform_init_scale (struct pict_f_transform *t, double sx, double sy); + +Bool +pict_f_transform_scale (struct pict_f_transform *forward, + struct pict_f_transform *reverse, + double sx, double sy); + +void +pict_f_transform_init_rotate (struct pict_f_transform *t, double c, double s); + +Bool +pict_f_transform_rotate (struct pict_f_transform *forward, + struct pict_f_transform *reverse, + double c, double s); + +void +pict_f_transform_init_translate (struct pict_f_transform *t, double tx, double ty); + +Bool +pict_f_transform_translate (struct pict_f_transform *forward, + struct pict_f_transform *reverse, + double tx, double ty); + +Bool +pict_f_transform_bounds (struct pict_f_transform *t, BoxPtr b); + +void +pict_f_transform_init_identity (struct pict_f_transform *t); + #endif /* _PICTURESTR_H_ */ |