summaryrefslogtreecommitdiff
path: root/source/fitz/path.c
AgeCommit message (Collapse)Author
2016-01-18Add consts to fz_keep/drop_path.Robin Watts
Forgot these in my previous pass.
2016-01-13Add lots of consts.Robin Watts
In general, we should use 'const fz_blah' in device calls whenever the callee should not alter the fz_blah. Push this through. This shows up various places where we fz_keep and fz_drop these const things. I've updated the fz_keep and fz_drops with appropriate casts to remove the consts. We may need to do the union dance to avoid the consts for some compilers, but will only do that if required. I think this is nicer overall, even allowing for the const<->no const problems.
2015-12-14Add fz_clone_pathRobin Watts
Will be required for JNI bindings.
2015-12-11Use fz_output instead of FILE* for most of our output needs.Tor Andersson
Use fz_output in debug printing functions. Use fz_output in pdfshow. Use fz_output in fz_trace_device instead of stdout. Use fz_output in pdf-write.c. Rename fz_new_output_to_filename to fz_new_output_with_path. Add seek and tell to fz_output. Remove unused functions like fz_fprintf. Fix typo in pdf_print_obj.
2015-08-20Remove duplicate inclusions of headers.Sebastian Rasmussen
These headers are already included by mupdf/fitz/system.h.
2015-05-05Fix typo in fz_pack_path that caused us to malloc much more than needed.Tor Andersson
2015-03-24Path packing for memory efficiency.Robin Watts
Introduce the concept of 'packed' paths. These reduce the header overhead for most common paths (ones with less than 256 commands and 256 coords) to a single 32bit int once stored in the display list. The previous commit reduces the torture-test.pdf from 95 to 87Meg. This commit futher reduces it to 70Meg.
2015-03-24Path rework for improved memory usage.Robin Watts
Firstly, we make the definition of the path structures local to path.c. This is achieved by using an fz_path_processor function to step through paths enumerating each section using callback functions. Next, we extend the internal path representation to include other section types, including quads, beziers with common control points rectangles, horizontal, vertical and degenerate lines. We also roll close path sections up into the previous sections commands. The hairiest part of this is that fz_transform_path has to cope with changing the path commands depending on the matrix. This is a relatively rare operation though.
2015-02-20Add fz_trim_path and call it.Robin Watts
Whenever we fz_keep a path, it's an indication that we're going to be keeping the path around for a while (anod not changing it any more). We therefore take the opportunity to trim the path buffers down.
2015-02-17Add helper functions to keep/drop reference counts with locking.Tor Andersson
Add locks around fz_path and fz_text reference counting.
2015-02-17Add ctx parameter and remove embedded contexts for API regularity.Tor Andersson
Purge several embedded contexts: Remove embedded context in fz_output. Remove embedded context in fz_stream. Remove embedded context in fz_device. Remove fz_rebind_stream (since it is no longer necessary). Remove embedded context in svg_device. Remove embedded context in XML parser. Add ctx argument to fz_document functions. Remove embedded context in fz_document. Remove embedded context in pdf_document. Remove embedded context in pdf_obj. Make fz_page independent of fz_document in the interface. We shouldn't need to pass the document to all functions handling a page. If a page is tied to the source document, it's redundant; otherwise it's just pointless. Fix reference counting oddity in fz_new_image_from_pixmap.
2015-02-17Reference count fz_path and fz_text.Tor Andersson
Disallow modification of shared fz_path and fz_text objects. They should follow a create once, consume often pattern, and as such should be immutable once created.
2013-11-05Allow stroke states to be kept on the stack.Tor Andersson
Add a function to clone stroke states, a magic number to keep in the reference count to signal that a stroke state is stack-stored, and automatically clone stack stored stroke states in the keep function. Use fz_default_stroke_state to initialise stack stored stroke states.
2013-11-05Improve stroke state function names that take the dash array length.Tor Andersson
2013-09-08Separate command and coordinate arrays in fz_path structure.Tor Andersson
2013-06-20Rearrange source files.Tor Andersson