summaryrefslogtreecommitdiff
path: root/fitz/res_path.c
AgeCommit message (Collapse)Author
2012-01-14Smarter path construction (avoid needless segments).Robin Watts
Automatically skip segments in a path that serve no purpose at construction time. * MOVE then MOVE -> the original MOVE is ignored. * LINETO the currentpoint -> ignored if previous segment was not a moveto. * CURVETO the currentpoint (with coincident coords) -> ignored if previous segment was not a moveto. * CLOSE then CLOSE -> second close ignored. It's worth noting here that in pdf a closepath leaves the current point at the point which it closes to - any new segments will begin a new subpath, but the current point is defined.
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-06Various fixes to avoid arithmetic problems.Robin Watts
Various fixes to avoid overflow problems, division by zeros, use of uninitialised variables etc. All from/suggested by Zenikos patch.
2011-12-19More Memory squeezing fixesRobin Watts
2011-12-16More memsqueezing fixes.Robin Watts
2011-12-16Add fz_malloc_struct, and make code use it.Robin Watts
The new fz_malloc_struct(A,B) macro allocates sizeof(B) bytes using fz_malloc, and then passes the resultant pointer to Memento_label to label it with "B". This costs nothing in non-memento builds, but gives much nicer listings of leaked blocks when memento is enabled.
2011-12-08Stylistic changes when testing pointer values for NULL.Tor Andersson
Also: use 'cannot' instead of 'failed to' in error messages.
2011-09-21Add warning context.Tor Andersson
2011-09-21Rename malloc functions for arrays (fz_calloc and fz_realloc).Tor Andersson
2011-09-15Add context to mupdf.Robin Watts
Huge pervasive change to lots of files, adding a context for exception handling and allocation. In time we'll move more statics into there. Also fix some for(i = 0; i < function(...); i++) calls.
2011-08-09Fix bug 692253: handle curvetov with no current point set.Tor Andersson
Also ignore path components with no current point set and print a warning rather than doing an implicit moveto(0,0).
2011-07-08Clip area optimisations for displaylist case:Robin Watts
First, we add clipping rects to clipping functions. Various functions (the ones that handle clipping) are now additionally passed a rectangle that represents an additional bound for this clip in device space (i.e. it has already been mapped through the current ctm). Next, when constructing the displaylist, keep track of the bounding box for the contents of each clip. While writing the list, on every node we add, we add the bbox for that node to the enclosing clips content bbox (if there is an enclosing clip). When we pop a clip, write back to the corresponding push to update the bbox. This means if we get large clip regions, with only small areas used within them, we will only do the slow blending for those small areas. Finally, we fix a calculation in fz_bound_path which was incorrectly accounting for mitrelimits. This was showing up in testing on page 630 of the PDF reference v1.7.
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-01xps: Respect PathGeometry.Transform attribute.Tor Andersson
2011-03-01Fix subtle path stroking bug where closepath did not update the pen position.Tor Andersson
2011-01-27Add fz_calloc function to check for integer overflow when allocating arrays, ↵Tor Andersson
and change the signature of fz_realloc to match.
2010-07-31Include all three bezier controlpoints when bounding curves in a path.Sebastian Rasmussen
2010-07-17Remove all trailing whitespace.Tor Andersson
2010-06-19Floats everywhere!Tor Andersson
2010-06-15Add missing break in fz_boundpath.Tor Andersson
2010-04-25Move stroking state to a separate struct in preparation for stroked text ↵Tor Andersson
rendering mode support.
2010-04-19Add support for patterns in stroked paths and text.Tor Andersson
2010-04-15XML-ify output of dev_trace.Tor Andersson
2010-04-08Add display list device.Tor Andersson
2010-04-08Rename the old path and text node files.Tor Andersson