[cairo] several questions about cairo with image backend

xigcw xigcw at 163.com
Sun Jul 18 23:01:49 PDT 2010


Hi,
I am learning cairo with image backend for several weeks , and 
I have several questions whitch troubles me a lot.
 
1. There are two data changes in cairo:
    (1) fdx = _cairo_fixed_from_double(dx)
    (2) x_off_fixed = pixman_int_to_fixed(x_off)
    that , fdx = dx * 256  , x_off_fixed = x_off * 256 * 256,
    What's the meaning about the two changes?
2. I use a debugger to see how the thick stroking works.
    After cairo_traps_add_trap,the polygon will be reduced 
    to trapezoid, and then the pixman will compute the right and
    left edge of the trapezoid .is that right?
    When compute the edge of trapezoid ,the algorithms is different
    from Bresenham algorithms, so I would like to know what computer 
    graphics algorithms does cairo use?(draw line)
3.  #define RENDER_EDGE_STEP_SMALL(edge)
    {  edge->x += edge->stepx_small;
       edge->e += edge->dx_small;
       if(edge->e > 0)
       {  edge->e -= edge->dy;
          edge->x += edge->signdx;
       }
    }
    What's the meaning of edge->e or What's the meaning of if(edge->e > 0)?
    What's the different between  RENDER_EDGE_STEP_SMALL(edge)  and
    RENDER_EDGE_STEP_BIG(edge)?
 
    Thanks a lot for your help.
     chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100719/6de4fa32/attachment.html>


More information about the cairo mailing list