[Xr] XrSetPattern added
Carl Worth
cworth at east.isi.edu
Mon May 12 09:59:13 PDT 2003
I just committed a long-overdue function to Xr:
void XrSetPattern(XrState *xrs, XrSurface *pattern);
which allows you to draw using a pattern rather than a solid color.
This should be quite helpful for those who want to do things like
gradients.
I also updated the xrknockout program, (in the xrtest module in CVS),
to use this function to draw the checked background. That also
demonstrates the use of XrSurfaceSetRepeat to allow a repeated
pattern.
One thing still missing from the pattern API is a way to set a
transformation matrix for the pattern. To simplify the API, it may
make sense to expose an XrTransform object which could be used both
for the Xr user->device space transformation as well as surface
transformations.
One complication is that the user->device space matrix only supports
affine transformations while the surface code has support for a full
projective transformation matrix.
Once the surface transformation is in place, it should be possible to
use this to easily and efficiently drawing some gradients.
-Carl
--
Carl Worth
USC Information Sciences Institute cworth at isi.edu
More information about the cairo
mailing list