summaryrefslogtreecommitdiff
path: root/fitz/dev_list.c
AgeCommit message (Collapse)Author
2012-02-07Rename a few functions.Tor Andersson
2012-02-03Be consistent about passing a fz_context in path/text/shade functions.Tor Andersson
2012-01-19Multi-threading support for MuPDFRobin Watts
When we moved over to a context based system, we laid the foundation for a thread-safe mupdf. This commit should complete that process. Firstly, fz_clone_context is properly implemented so that it makes a new context, but shares certain sections (currently just the allocator, and the store). Secondly, we add locking (to parts of the code that have previously just had placeholder LOCK/UNLOCK comments). Functions to lock and unlock a mutex are added to the allocator structure; omit these (as is the case today) and no multithreading is (safely) possible. The context will refuse to clone if these are not provided. Finally we flesh out the LOCK/UNLOCK comments to be real calls of the functions - unfortunately this requires us to plumb fz_context into the fz_keep_storable function (and all the fz_keep_xxx functions that call it). This is the largest section of the patch. No changes expected to any test files.
2012-01-13Clipping stack handling tweaks in dev_list.Robin Watts
Thanks to Zeniko for spotting these problems.
2012-01-11Calculate accurate per-glyph bounding boxes for fz_bound_text.Tor Andersson
2012-01-10Move fuzz from fz_execute_display_list into fz_bound_text.Robin Watts
Keep the fuzz in just one place. Hopefully will be rendered unnecessary by changes to make fz_bound_text accurate.
2012-01-04Bug 692739: Add ability to abort time consuming actionsRobin Watts
A new 'cookie' parameter is added to page rendering/interpretation functions. Supply this as NULL to get existing behaviour. If you supply a non-NULL cookie, then this is taken as a pointer to a struct that can be used for simple, non-thread locked communication between caller and library. The entire struct should be memset to zero before entry, except for specific flags (thus coping with future extensions to this struct). The abort flag should be zero on entry. It will be checked periodically by the library - if the caller sets it non-zero (via another thread) then the current operation will be aborted. No guarantees are given as to how often this will be checked, or how fast it will be responded to. The progress_max field will be set to an integer (-1 for unknown) representing the number of 'things' to do. The progress field will count up from 0 to this number as time goes by. No guarantees are made as to the accuracy of this information, but it should be useful for offering some sort of progress bar etc. Note that progress_max may increase during the job. In general, callers should be careful to accept out of range or invalid data in this structure as this is deliberately accessed 'unlocked'.
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-16More memsqueezing fixesRobin Watts
2011-12-08Stylistic changes when testing pointer values for NULL.Tor Andersson
Also: use 'cannot' instead of 'failed to' in error messages.
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-06Cosmetic style fixes.Tor Andersson
2011-08-03Tweak to list playback code to pass flags as 0 or 1.Robin Watts
When playing back from a list, previously flags would just be 0 or non-zero. This makes no real difference, but looks odd when traced.
2011-07-13Non-isolated group support, and fix Bug 692336.Robin Watts
Firstly, this takes on some of Zenikos patch to correct the clip stack handling that was broken by the fix to bug 692287 (in commit 2c3bbbf). This bug should now be solved. We add a new 'shape' field to the draw device structure (and clip stack). When we are inside non-isolated groups, this is set to be a pixmap where we accumulate the 'shape' of the objects drawn. When we come to blend back, if we are blending a non-isolated group back, we have to use a different blending function that takes account of the shape. Various internal groups (the page group, and groups used to force blending) are set to be isolated to avoid carrying shape planes around when this is not required. All our rendering code now has to know how to maintain the shape plane as well as doing the basic rendering.
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-10Make display list struct opaque.Tor Andersson
2011-04-10Make blendmode opaque.Tor Andersson
2011-04-08Tweak the display list visibility culling.Tor Andersson
2011-04-07Fix bug with gsave/grestore nesting when running tiled patterns.Tor Andersson
2011-04-05Update the display list device to use the new device functions.Tor Andersson
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-04Add device interface functions to draw tiled patterns.Tor Andersson
2011-04-04draw: Fix bug in display list culling.Tor Andersson
The node bbox was not transformed to device space before the visibility test.
2011-04-04draw: Speed up display list execution by using a visibility test.Tor Andersson
2010-07-23Support constant alpha for shadings, images and transparency groups.Tor Andersson
2010-07-17Remove all trailing whitespace.Tor Andersson
2010-07-16Plug memory leaks.Tor Andersson
2010-07-15Check page for transparency to install a page-level transparency group.Tor Andersson
2010-07-14Add transparency group/mask device calls and implement basic blend modes ↵Tor Andersson
when drawing primitive objects.
2010-07-09Rearrange and merge some files in the fitz directory.Tor Andersson
2010-06-19Floats everywhere!Tor Andersson
2010-05-11Accumulate text to be clipped in text render mode 7.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-13Fix some typos in the display list device.Tor Andersson
2010-04-08Add display list device.Tor Andersson