[cairo] Optimize horizontal/vertical gradients

Carl Worth cworth at cworth.org
Mon Feb 14 09:38:41 PST 2005


On Mon, 14 Feb 2005 07:14:27 -0500, Keith Packard wrote:
> Around 23 o'clock on Feb 13, Owen Taylor wrote:
> 
> +	} else if (pattern->u.linear.point0.x == pattern->u.linear.point1.x) {
> +	  height = 1;
> 
> Are you sure this one is right?

Heh, can you guess that Owen's test had a vertical, not a horizontal
gradient. ;-)

> (and yes, we should probably have some general 'near' function that tests the 
> equivalence of two doubles too).

So far, everywhere we've needed something like this in the
implementation, we've been able to do a computation in device space
and compare with the tolerance value. So maybe we want a "within"
function.

Postscript has a notion of a "smoothness" variable that lets the user
influence pattern accuracy independently from "flatness" which
determines geometric accuracy. My idea was to just use "tolerance" for
both purposes.

-Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050214/e3469721/attachment.pgp


More information about the cairo mailing list