summaryrefslogtreecommitdiff
path: root/draw/draw_path.c
AgeCommit message (Collapse)Author
2013-06-18Split fitz.h into subheaders.Tor Andersson
2013-06-18Merge common and internal headers into one.Tor Andersson
2013-06-18Move header files into separate include directory.Tor Andersson
2013-04-26Squash 2 const warnings.Robin Watts
Add some more consts's and use void *'s where appropriate.
2013-02-06Change to pass structures by reference rather than value.Robin Watts
This is faster on ARM in particular. The primary changes involve fz_matrix, fz_rect and fz_bbox. Rather than passing 'fz_rect r' into a function, we now consistently pass 'const fz_rect *r'. Where a rect is passed in and modified, we miss the 'const' off. Where possible, we return the pointer to the modified structure to allow 'chaining' of expressions. The basic upshot of this work is that we do far fewer copies of rectangle/matrix structures, and all the copies we do are explicit. This has opened the way to other optimisations, also performed in this commit. Rather than using expressions like: fz_concat(fz_scale(sx, sy), fz_translate(tx, ty)) we now have fz_pre_{scale,translate,rotate} functions. These can be implemented much more efficiently than doing the fully fledged matrix multiplication that fz_concat requires. We add fz_rect_{min,max} functions to return pointers to the min/max points of a rect. These can be used to in transformations to directly manipulate values. With a little casting in the path transformation code we can avoid more needless copying. We rename fz_widget_bbox to the more consistent fz_bound_widget.
2012-07-18Remove pointless test.Robin Watts
Variable i can never be zero at this point. The desired point of testing against i was to ensure that the test did not evaluate true at the first run, and the other parts of the condition are sufficent to ensure this, so just remove the test on i.
2012-07-05Move to static inline functions from macros.Robin Watts
Instead of using macros for min/max/abs/clamp, we move to using inline functions. These are more typesafe, and should produce equivalent code on compilers that support inline (i.e. pretty much everything we care about these days). People can always do their own macro versions if they prefer.
2012-04-23Fix whitespace and indentation.Tor Andersson
2012-04-19Bug 692990: Fix 'underjoin' of strokes.Robin Watts
See Bug 688655 for analysis of what we SHOULD be doing. The code changes to do this are actually quite small. Essentially, when we join we only draw the 'top' (or 'outer') join in a join dependent way. The 'under' join was always joined as a bevel before as this was easy. This produces bad effects when the lines have a significant angle between them and a large linewidth. The correct (i.e. matching Acrobat and others) way to work is to join the bottom of the line via the centre point. The sole exception to this is when drawing under beziers, as we don't want to make our approximation-by-lines obvious. All fixed in this patch.
2012-03-06Split fitz.h/mupdf.h into internal/external headers.Robin Watts
Attempt to separate public API from internal functions.
2012-02-03Remove extraneous blank lines.Tor Andersson
2012-01-23Do XPS mitering properly.Robin Watts
Modified version of Sumatras patch. Thanks for this.
2012-01-12Support proper XPS mitering. (And stroke fixes).Robin Watts
XPS differs from PS/PDF/etc in the way it handles miters; rather than simply converting a miter that's overly long to a bevel, it truncates it at the miter limit. As such it needs to be handled correctly. For clarity, expose new enumerated types for linejoins and linecaps, and use these throughout code. When we upgrade our freetype, we can move to using proper xps mitering in that too. Add new fz_matrix_max_expansion function to return a safer expansion value that works in the case where we scale up in one direction and down in another. In the xps path drawing code, avoid generating unnecessary linetos. Thanks to Zeniko for spotting these and providing implementations.
2012-01-09Fix Bug 692356 (comment #2)Robin Watts
Take on a modified version of Zenikos patch; only take the quick exit if the whole dash length is small, or if the dash_length scaled up by the maximum possible scale in the ctm is less than 1/2 a pixel.
2011-09-21Add warning context.Tor Andersson
2011-09-02Fix bug 692356: use stricter limit for dash pattern lengths.Tor Andersson
2011-09-02Fix minor regression in fix for zero-length line segment dots.Tor Andersson
2011-09-01Only draw dots for zero-length line segments with round line caps.Tor Andersson
2011-04-11Add triangle caps; separate start, dash and end cap styles for XPS.Tor Andersson
2011-04-07Check for zero length dash arrays.Tor Andersson
2011-04-05Add wrapper functions around device calls.Tor Andersson
They test for NULL and make the code look nicer.
2011-04-04Le Roi est mort, vive le Roi!Tor Andersson
The run-together words are dead! Long live the underscores! The postscript inspired naming convention of using all run-together words has served us well, but it is now time for more readable code. In this commit I have also added the sed script, rename.sed, that I used to convert the source. Use it on your patches and application code.
2011-04-04draw: Rename files in draw directory.Tor Andersson