[cairo] Isn't there a way to pass multiple points to Cairo? (sorry for duplicate)

Jonathan Morton jonathan.morton at movial.com
Mon Aug 1 03:02:34 PDT 2011


On Sat, 2011-07-30 at 18:04 +0200, Andrej Mitrovic wrote:
> If I want to draw a waveform made out of 400 points and connect the
> points together to form lines (meaning point one has a line to point
> two, point two to pint three, etc.), I have to call cairo_move_to()
> and cairo_line_to() 400 times each.

Why are you calling cairo_move_to() each time?  If you call it once at
the beginning, and then just cairo_line_to() for each subsequent point,
you get:

1) Half the number of API calls.

2) A single line, instead of many lines whose beginnings and ends
overlap.

-- 
------
From: Jonathan Morton
      jonathan.morton at movial.com




More information about the cairo mailing list