summaryrefslogtreecommitdiff
path: root/fitz/res_path.c
AgeCommit message (Collapse)Author
2013-06-20Rearrange source files.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-05-10Update fz_bound_{text,path} functions.Robin Watts
Pass stroke state into fz_bound_text to allow for stroked text. Simplifies some calling code. Add consts to clarify the meanings of the calls.
2013-02-19Fix whitespace.Tor Andersson
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.
2013-01-30Always pass value structs (rect, matrix, etc) as values not by pointer.Tor Andersson
2012-08-06Fix locking bug in path strokingSebastian Rasmussen
Thanks to Zeniko for pointing out this fix.
2012-07-17Handle glyphs that are too large to render as pixmaps.Tor Andersson
2012-07-06Remove debugging functions for release builds.Sebastian Rasmussen
2012-06-27Fix clipping of stroked text seen in displaylist cases.Robin Watts
When calculating the displaylist node rectangles, we were failing to adjust for linewidth/mitrewidth etc. This could result in glyphs being clipped; see normal_130.pdf for example.
2012-03-28Whitespace fixes.Tor Andersson
2012-03-14Bug 692917: Move to dynamic stroke_states.Robin Watts
Move fz_stroke_state from being a simple structure whose contents are copied repeatedly to being a dynamically allocated reference counted object so we can cope with large numbers of entries in the dash array.
2012-03-14When bounding paths, only apply miterlimit when mitering.Robin Watts
From SumatraMuPDF.patch - Many thanks.
2012-03-14Ignore trailing movetos in path bounding calculations.Robin Watts
Taken from SumatraPDF.patch - Many thanks.
2012-03-13Make fz_print functions all take a FILE *.Robin Watts
Also tidy up the taking of fz_context *'s, and hide an unwanted indent param.
2012-03-13Rename some functions and accessors to be more consistent.Tor Andersson
Debug printing functions: debug -> print. Accessors: get noun attribute -> noun attribute. Find -> lookup when the returned value is not reference counted. pixmap_with_rect -> pixmap_with_bbox. We are reserving the word "find" to mean lookups that give ownership of objects to the caller. Lookup is used in other places where the ownership is not transferred, or simple values are returned. The rename is done by the sed script in scripts/rename3.sed
2012-03-06Split fitz.h/mupdf.h into internal/external headers.Robin Watts
Attempt to separate public API from internal functions.
2012-02-03Be consistent about passing a fz_context in path/text/shade functions.Tor Andersson
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