[cairo] [PATCH] Stroking fixes

Andrea Canciani ranma42 at gmail.com
Tue Nov 10 15:55:24 PST 2009


Here is a patchset for improving cairo stroking.
0001 shows that currently the dash offset computation is broken and
0002 fixes that.
0003 fixes another problem not really tested in the testsuite, i.e. it
avoids long (useless) loops in _cairo_stroker_dash_start, which could
be otherwise triggered by setting a dash pattern like {1} with offset
1+e15.
0004 reverts a change that was only useful to avoid swapping to disk
when running the dash-infinite-loop test as the change is not
effective anymore after 0003 and the test reference image was not
updated to reflect the code (also because the previous disposition was
preferred)
0005 fixes dash-infinite-loop (and bug #24207)

0002 and 0003 are trivial changes. They should be correct unless I
missed some weird corner case.
0005 is much more complex and can probably be improved. Right now when
stroking a dense dash pattern which is just 50% on, the outputs
heavily depends on the tolerance settings and on the stroked path
because of the sampling in the rasterizer.
Also, following 0005 I would expect raster backends to use the dash
pattern approximation to avoid infinite looping (I'll prepare a patch
for quartz soon).
Andrea Canciani
Please disregard my previous stroke patches. They are the same as 0001
and 0002 except for minor code cleanup.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-test-Add-dash-offset-test.patch
Type: application/octet-stream
Size: 5576 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091111/0bf07ed8/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-odd-length-dashing-with-negative-offset.patch
Type: application/octet-stream
Size: 1225 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091111/0bf07ed8/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Improve-stroke-offset-computation.patch
Type: application/octet-stream
Size: 1436 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091111/0bf07ed8/attachment-0002.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Revert-test-Reorder-dash-infinite-loop-to-not-hit-a-.patch
Type: application/octet-stream
Size: 1302 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091111/0bf07ed8/attachment-0003.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-Improve-stroking-of-densely-dashed-styles.patch
Type: application/octet-stream
Size: 7174 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091111/0bf07ed8/attachment-0004.obj 


More information about the cairo mailing list