summaryrefslogtreecommitdiff
path: root/src/cairo-path-stroke-polygon.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix -Wunused-function warningsKhaled Hosny2023-02-061-11/+0
|
* Round joins fix (spline_cusp_tolerance)Christian Rohlfs2022-12-281-18/+77
| | | | https://gitlab.freedesktop.org/cairo/cairo/-/issues/520
* build: Fix various compiler warningsGeorge Matsumura2020-11-071-1/+1
| | | | | | This fixes a few compiler warnings that were encountered with gcc 9.3.0. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
* replace _BSD_SOURCE with _DEFAULT_SOURCEAdrian Johnson2017-09-161-1/+1
| | | | | | fixes the warning: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
* Revert "stroker: Check for scaling overflow in computing half line widths"Uli Schlachter2017-05-131-1/+0
| | | | | This reverts commit 91b25005d62fe4ca178f45d349374e42c29a5e11 because it causes lots of new crashes due to assertion failures.
* stroker: Check for scaling overflow in computing half line widthsChris Wilson2017-05-041-0/+1
| | | | | | | | | | | | | | | Given a combination of a large scaling matrix and a large line, we can easily generate a half line width that is unrepresentable in our 24.8 fixed-point. This leads to spurious errors later, such as generating negative height boxes, and so asking pixman to fill to infinity. To avoid this, we can check for overflow in calculating the half line with, though we still lack adequate range checking on the final stroke path. References: https://bugs.webkit.org/show_bug.cgi?id=16793 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: magomez@igalia.com Tested-by: Bryce Harrington <bryce@osg.samsung.com> Acked-by: Bryce Harrington <bryce@osg.samsung.com>
* Remove some useless declarations found by scan-build, the LLVM/clang static ↵Sylvestre Ledru2014-05-061-10/+0
| | | | | | analyzer Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* stroke: Fix calling '_cairo_spline_intersect' for in-bounds checking of splinesChris Wilson2012-11-021-1/+1
| | | | | | | | | | Fixes stroke-clipped, within reason. There still remains some antialiasing noise (between rendering the circle piecewise and wholly) worth investigating - but that is probably an artefact of switching between analytical rendering modes in the scanline rasterisation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke: Convert a very small round-join into a miterChris Wilson2012-08-261-1/+1
| | | | | | Avoid adding a bevel join if the miter point is within tolerance. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke: Precompute the line half-widthChris Wilson2012-08-261-44/+38
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke: Use new pen vertex range findersChris Wilson2012-08-261-66/+27
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke: Skip spline evaluation when stroking to a polygonChris Wilson2012-08-261-0/+37
| | | | | | | | If the spline is wholly outside the clip region, accounting for the stroke width and additional rendering, then we can simplify that spline with a straight line. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke: Skip inserting a round-join if within toleranceChris Wilson2012-06-241-5/+9
| | | | | | | | | | | If the angle between two segments is small we can simply replace the round-join with a bevel-join. This is done automatically by the insertion of the triangle fan as it will not be able to find a point around the pen between the two vectors. However, we can make that search cheaper by inspecting whether the bisection angle is small enough that the bevel-join will be within geometric tolerance of the round-join. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke: Use round-joins near inflection points of splinesChris Wilson2012-06-241-3/+14
| | | | | | | | | | | | | | | Near an inflection, the angle between two segments of a spline increases rapidly (as the radius of curvature decreases for the cusp). The angle may increase so much that a simple line connecting the two outside points of the spline is not within the user specified geometric tolerance (with the result that you can generate severe ugliness around a cusp). Extend the current detection of the exact inflection to cover the sharp joins near the cusp by inspecting whether the bisection angle is larger than acceptable. Fixes bug-spline. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke: Don't drop clockwise==0 linesChris Wilson2012-05-141-11/+3
| | | | | | | | | | | | If the join indicates the pair of edges are parallel, we may be considering the final segment of the spline with a different tangent vector than the slope of the final edge and so lead to false dropping of an edge. This has the effect that the line segments between 'arc arc arc arc' (a rounded rectangle) are no longer horizontal or vertical. As path construction tries to eliminate joins between colinear segments, this optimisation should not be required anyway. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Remove some unused functionsUli Schlachter2012-05-051-44/+0
| | | | | | | | | | | All of these are unused since af9fbd176b145f0424 "Introduce a new compositor architecture". Since no one complained yet, I guess that means that we don't need these any more. :-) This was noticed while looking into the build log provided by http://lists.cairographics.org/archives/cairo/2012-April/022993.html Signed-off-by: Uli Schlachter <psychon@znc.in>
* Split cairo-contour-privates into struct+inlinesChris Wilson2012-04-191-0/+1
| | | | | References: https://bugs.freedesktop.org/show_bug.cgi?id=48577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Split cairo-box-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>
* stroke: Do not initialise the pen if will not use itChris Wilson2012-03-101-11/+19
| | | | | | | The pen is only used for ensuring that we generate consist vertices around a fan used for end-capping or line-joining when set to ROUND. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke: Fix typosAndrea Canciani2011-11-021-2/+2
| | | | | | | The condition was comparing out with itself (always resulting in a true result) instead of out and in. Pointed out by Clang as "idempotent operation".
* Introduce a new compositor architectureChris Wilson2011-09-121-12/+59
| | | | | | | | | | | | | | | | | | 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. :)
* stroke: Convert the outlines into contour and then into a polygonChris Wilson2011-08-151-422/+783
| | | | | | | | | | | | In step 1 of speeding up stroking, we introduce contours as a means for tracking the connected edges around the stroke. By keeping track of these chains, we can analyse the edges as we proceed and eliminate redundant vertices speeding up rasterisation. Coincidentally fixes line-width-tolerance (looks like a combination of using spline tangent vectors and tolerance). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke: move normal stroker to new fileChris Wilson2011-08-151-0/+1002
Step 1 of enhancing the speed of the stroker is to segregate from the rest of the complex code. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>