[cairo] Very large number of lines

Andrea Canciani ranma42 at gmail.com
Tue Aug 31 07:54:00 PDT 2010


On Tue, Aug 31, 2010 at 4:39 PM, necko necko <opustenom at hotmail.com> wrote:
> Thank you very much for your email.
> I'll try to adjust my code, and accept your suggestions.
> "The question is: do all the lines you draw with cairo pass
>> through the bounding box?"
> YES. Every line I draw has to be visible. The preprocessing goes through
> the input coordinates, determines min/max and prepares appropriate bounding
> box. Having said that, is applying your suggestions going to be reasonable
> in terms of the speedup?
Clipping is only useful if some lines will fall outside of the bounding box.
Instead, choosing the best STROKE_EVERY will be beneficial, so please
check that changing it doesn't affect in a visible way the output.

To speed up drawing on image (not on pdf) you might try tiling your image.
You would divide your surface in smaller parts, clip and draw on each one,
then join them.
This might be non-trivial if your code is not structured in a way that easily
allows this, but could be a big win on multiprocessor systems.

Andrea


More information about the cairo mailing list