Drawing a sequence of line segments

ax487 <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Hello all,

I am using cairo to draw a stroke, that is a sequence of line segments,
onto a canvas, which is represented as a cairo_surface_t* internally.
The canvas is used in a Gtk+ application, the stroke is extended
whenever the mouse moves. Obviously, the redraw needs to be fast enough
such that there is no visible lag. A minimal example is here:
http://pastebin.com/RtaPajcU
I have tried the following approaches:

1: Redraw the entire stroke whenever the mouse moves. This works
correctly apart from the fact that there is a lag which increases as
more points are drawn.

2: Only draw the stroke between the last two points whenever the mouse
moves. This is noticeably faster but the drawing is incorrect: Pixels
are repeatedly overdrawn so the alpha value increases along certain
paths of the stroke.

I would like to go for fast and correct. Any ideas?

ax487
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.