[cairo] Optimize spans in the trapezoid rasterizer

Billy Biggs vektor at dumbterm.net
Mon Jul 25 11:37:45 PDT 2005


Keith Packard (keithp at keithp.com):

> On Sun, 2005-07-24 at 22:14 -0500, Billy Biggs wrote:
> > The attached patch modifies the 8-bit alpha trapezoid rasterizer
> > [...]
> 
> I note that the clip255 function includes a branch, while the normal
> saturation function does not. I thought branches were "really bad"...

  My understanding is that a branch at this level is no problem for
modern processors.  I could not measure any difference on my G4 or P4.
The code with the if statement is clearer, and we probably want a
CPU-specific optimized version of the saturate loop anyway.

  -Billy




More information about the cairo mailing list