summaryrefslogtreecommitdiff
path: root/src/cairo-bentley-ottmann-rectangular.c
Commit message (Collapse)AuthorAgeFilesLines
* fix warning: variable X might be clobbered by 'longjmp'Uli Schlachter2018-01-131-1/+3
| | | | | | | | | | | | | | | | | | | According to "man setjmp", one possible way to avoid variable clobbering is to declare them as volatile. Thus, this commit turns the variables that are changed between setjmp() and longjmp() and whose values are still needed after setjmp() returned the second time into volatile variables. The warning in cairo-bentley-ottmann-rectangular.c is worked around by not initializing the variable before setjmp(). To be honest, I don't understand why the compiler warns here at all since the value of update is clearly not used after setjmp()'s second return. This commit re-fixes the warnings that were reintroduced in commit 82f40285 which reverted b092b63. Signed-off-by: Uli Schlachter <psychon@znc.in> Acked-by: Bryce Harrington <bryce@osg.samsung.com>
* Revert "fix warning: variable X might be clobbered by 'longjmp'"Uli Schlachter2017-12-231-7/+1
| | | | | | | | | | | | | | This reverts commit b092b63119cbfe3cb4bc786eee81630998996acf which introduced a wrapper function around setjmp(). To quote from man setjmp: If the function which called setjmp() returns before longjmp() is called, the behavior is undefined. Some kind of subtle or unsubtle chaos is sure to result. Since after the above commit setjmp() is called from the wrapper function, the result might or might not work, depending on compiler settings. If the setjmp() wrapper is not inlined, then the state of the stack after longjmp() will likely be garbage.
* fix warning: variable X might be clobbered by 'longjmp'Adrian Johnson2017-10-211-1/+7
| | | | | Move calls to setjmp into separate function to avoid clobbering local variables.
* If more than one trap is passed in then it's guaranteed that theBryce Harrington2015-07-271-3/+12
| | | | | | | | | | | | | | | | | | | returned traps will have their left edge to the left of their right edge, but if only one trap is passed in then the function always returns without doing anything. This results in incorrect rendering of SVG paths with more than one subpath. Currently calls to _cairo_bentley_ottmann_tessellate_rectangular_traps are guarded by traps.has_intersections checks, so this is only a theoretical bug. But we'll eliminate the potential of the bug by making the left side to be left of the right side, similar to what was done in _cairo_bentley_ottmann_tessellate_boxes (commit 11b6c49c). Patch authored by Tom Klein for Mozilla. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90984 Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=853889 Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
* bo-rectangular: Emit subsummed boxes for overlapping edgesChris Wilson2012-05-231-2/+3
| | | | | | | Fixes bug-bo-collins Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49446 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Split cairo-combsort-privates into struct+inlinesChris Wilson2012-04-191-1/+1
| | | | | References: https://bugs.freedesktop.org/show_bug.cgi?id=48577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Introduce a new compositor architectureChris Wilson2011-09-121-21/+34
| | | | | | | | | | | | | | | | | | Having spent the last dev cycle looking at how we could specialize the compositors for various backends, we once again look for the commonalities in order to reduce the duplication. In part this is motivated by the idea that spans is a good interface for both the existent GL backend and pixman, and so they deserve a dedicated compositor. xcb/xlib target an identical rendering system and so they should be using the same compositor, and it should be possible to run that same compositor locally against pixman to generate reference tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> P.S. This brings massive upheaval (read breakage) I've tried delaying in order to fix as many things as possible but now this one patch does far, far, far too much. Apologies in advance for breaking your favourite backend, but trust me in that the end result will be much better. :)
* bo-rect: One step too far...Chris Wilson2011-08-131-1/+1
| | | | | | Fixes a1-rasterisation-rectangles. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* bo-rect: Micro-optimisationChris Wilson2011-08-131-29/+22
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* bo-rectangular: Correctly mergesort a doubly-linked listChris Wilson2011-08-091-12/+13
| | | | | | | Saves having to fixup the pointers afterwards by only having to update them on the list boundaries during merge. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* bo-rectangular: Use a mergesort to speedup insertionChris Wilson2011-08-091-66/+178
| | | | | | | | However, this is only useful for inserting multiple boxes within the pixel, so we maintain the cached insert cursor as this speeds up the general case (and aides this optimisation as well). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* bo-rectangular: Eliminate allocation for pqueueChris Wilson2011-08-091-178/+82
| | | | | | | | Since we only allocate a pointer to the rectangle after it is started and so decoupled from the start queue, we reuse the memory allocated for the start queue for the stop binary heap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* bo-rectangular: handle in==out specifically for the single box caseChris Wilson2011-08-051-10/+20
| | | | | | | In this case we do not need to copy anything, but may still need to re-orientate the box. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* bo-rectangular: perform an incremental sortChris Wilson2011-08-011-4/+50
| | | | | | | | Bucketing the rectangles together on their top-scanline and then sorting within that scanline is significantly faster for dragon despite the extra passes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* clip: Rudimentary support for clip-polygon extractionChris Wilson2011-07-191-2/+2
| | | | | | | Step 1, fix the failings sighted recently by tracking clip-boxes as an explicit property of the clipping and of composition. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* tessellator: Fixed to produce an output box with x1 <= x2 for single box inputTaekyun Kim2011-06-151-0/+7
| | | | | | | | | | Winding of a box is toggled by swapping x1, x2 coordinates. So we have to swap those coordinate rather than just copying. Many routines assume that boxes are left-top to right-bottom convention. So tessellator should produce such output boxes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* tessellator: Fix boxes tessellator to handle num_boxes <= 1 correctlyTaekyun Kim2011-06-081-1/+11
| | | | | | | | | | We cannot assume that parameter 'out' is empty. So we should make it empty before returning CAIRO_STATUS_SUCCESS when 'in' contains no boxes. When 'in' contains a single box, we should copy 'in' to 'out' rather than just returning CAIRO_STATUS_SUCCESS. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Update FSF addressAndrea Canciani2010-04-271-1/+1
| | | | | | | | | | | I updated the Free Software Foundation address using the following script. for i in $(git grep Temple | cut -d: -f1 ) do sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i" done Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
* bo-rectangular: Fix incorrect skipping of colinear eo edgesChris Wilson2010-02-231-17/+14
| | | | | | | Fixes test/bug-bo-rectangular After skipping edges, we need to bd careful to only terminate the box on a closing edge.
* bo-rectangular: Prevent invalid read during edge traversalChris Wilson2010-02-221-0/+6
| | | | | | | | | Benjamin Otte tracked down an invalid read triggered by WebKit. The cause is that we attempt to dereference the list_head as an edge as we failed to check that during the skipping of colinear edges we advanced to the end, under the false assumption that there would always be a closing edge in a rectangle. This assumption is broken if the tail rectangles having colinear right edges.
* boxes: Enable tessellationChris Wilson2010-01-221-367/+411
| | | | | Extend the special case rectangular tessellator to handle generation of cairo_boxes_t.
* Move _cairo_error() to a standalone headerChris Wilson2010-01-221-0/+1
| | | | | A pending commit will want to include some utility code from cairo and so we need to extricate the error handling from the PLT symbol hiding.
* [tessellator] Invalid conversion of list head to edge.Chris Wilson2009-09-291-0/+2
| | | | | When scanning for collinear right edges, we need to check that we do not go beyond the end of the array.
* [bo-rectangular] Fix assertion failure with insertion sortChris Wilson2009-08-301-0/+4
| | | | | | We remember the location of the last insert as the next edge is likely to be nearby. However, we need to be careful when the pointer rests upon the HEAD and ensure that we begin the search from the appropriate end.
* [tessellate] Rectangular special caseChris Wilson2009-08-291-0/+733
Add an even simpler sweep-line tessellator for rectangular trapezoids (as produced by the rectilinear stoker and box filler). This is so simple it even outperforms pixman's region validation code for the purposes of path-to-region conversion.