summaryrefslogtreecommitdiff
path: root/src/cairo-stroke-style.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix typos in doxygen and source commentsluz paz2022-03-281-1/+1
|
* Added hairline support to cairoRick Yorgason2021-08-151-0/+4
|
* Avoid indiscriminate use of VALGRIND_MAKE_MEM_NOACCESS.John Lindgren2015-06-261-1/+1
| | | | | | | | | Marking stack-allocated objects as no-access creates false positives, which distract from finding real memory errors. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52548 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* stroke: Make the incremental trapezoid stroker optionally available againChris Wilson2013-01-031-0/+39
| | | | | | | | | | | Whilst it cannot handle self-intersecting strokes (which includes the antialias region of neighbouring lines and joints), it is about 3x faster to use than the more robust algorithm. As some backends delegate the rendering, the quality may still be preserved and so they should be responsible for choosing the appropriate method for generation of the stroke geometry. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* stroke-style: Silence gcc warningAndrea Canciani2012-02-201-1/+1
| | | | | | | | | | | | | and make it more obvious that we're not doing OOB accesses. They were not possible because of the parity constraint, but by guarding the highest index with which we access the data in the loop, the correctness information is completely contained in the loop code. Fixes: cairo-stroke-style.c:199:2: warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
* Introduce a new compositor architectureChris Wilson2011-09-121-2/+8
| | | | | | | | | | | | | | | | | | 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. :)
* Remove useless checks for NULL before freeingAndrea Canciani2011-07-311-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + free (E); + E = NULL; - if (unlikely (E != NULL)) { - free(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + free (E); - if (unlikely (E != NULL)) { - free (E); - }
* 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
* Improve comments style consistencyAndrea Canciani2010-02-011-2/+2
| | | | Each line of a multi-line comment should begin with '*'.
* Improve dash pattern approximationAndrea Canciani2010-02-011-2/+54
| | | | | | | | | Dash pattern approximation was taking the caps style into account only for coverage computation, but not when computing the new pattern, thus the computed approximation had a higher coverage if the caps style was SQUARE or ROUND. Reviewed-by: M. Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* Round caps coverage extimate explanationAndrea Canciani2010-02-011-0/+16
| | | | | | | | | Comment on how the round caps coverage has been computed, explaining the complete procedure. The comments doesn't contain intermediate (verbose and ugly) results, but when executed in a symbolic math program (sage, for example) computes the expected results. Reviewed-by: M. Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* Constify stroke style and matrices.Chris Wilson2010-01-221-1/+1
| | | | | | As a simple step to ensure that we do not inadvertently modify (or at least generate compiler warns if we try) user data, mark the incoming style and matrices as constant.
* 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.
* Satisfy make checkBenjamin Otte2009-11-271-1/+1
|
* Improve stroking of densely dashed stylesAndrea Canciani2009-11-111-0/+119
| | | | | | | | | | Add some auxiliary functions to cairo-stroke-style to compute properties of the dashed patterns (period, "on" coverage) and to generate approximations when the dash pattern is sub-tolerance. These functions are used in cairo-path-stroke to simplify dash patterns stroked by cairo. Fixes dash-infinite-loop See http://bugs.freedesktop.org/show_bug.cgi?id=24702
* Remove clip handling from generic surface layer.Chris Wilson2009-07-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling clip as part of the surface state, as opposed to being part of the operation state, is cumbersome and a hindrance to providing true proxy surface support. For example, the clip must be copied from the surface onto the fallback image, but this was forgotten causing undue hassle in each backend. Another example is the contortion the meta surface endures to ensure the clip is correctly recorded. By contrast passing the clip along with the operation is quite simple and enables us to write generic handlers for providing surface wrappers. (And in the future, we should be able to write more esoteric wrappers, e.g. automatic 2x FSAA, trivially.) In brief, instead of the surface automatically applying the clip before calling the backend, the backend can call into a generic helper to apply clipping. For raster surfaces, clip regions are handled automatically as part of the composite interface. For vector surfaces, a clip helper is introduced to replay and callback into an intersect_clip_path() function as necessary. Whilst this is not primarily a performance related change (the change should just move the computation of the clip from the moment it is applied by the user to the moment it is required by the backend), it is important to track any potential regression: ppc: Speedups ======== image-rgba evolution-20090607-0 1026085.22 0.18% -> 672972.07 0.77%: 1.52x speedup ▌ image-rgba evolution-20090618-0 680579.98 0.12% -> 573237.66 0.16%: 1.19x speedup ▎ image-rgba swfdec-fill-rate-4xaa-0 460296.92 0.36% -> 407464.63 0.42%: 1.13x speedup ▏ image-rgba swfdec-fill-rate-2xaa-0 128431.95 0.47% -> 115051.86 0.42%: 1.12x speedup ▏ Slowdowns ========= image-rgba firefox-periodic-table-0 56837.61 0.78% -> 66055.17 3.20%: 1.09x slowdown ▏
* valgrindify init/fini routinesChris Wilson2009-06-041-0/+6
| | | | | Annotate object init/fini routines to detect use-after-free for on-stack/embedded objects.
* [memfault] Manually inject faults when using stack allocationsChris Wilson2009-04-231-0/+3
| | | | | | | | | | Ensure that no assumptions are made that a small allocation will succeed by manually injecting faults when we may be simply allocating from an embedded memory pool. The main advantage in manual fault injection is improved code coverage - from within the test suite most allocations are handled by the embedded memory pools.
* [stroker] Rectilinear dashing.Chris Wilson2009-01-291-4/+14
| | | | | Extend the rectilinear stroker to handle dashes, so that for pixel-aligned dashed strokes we completely avoid tessellation overhead.
* Mark allocation failures as unlikely.Chris Wilson2008-11-291-1/+1
| | | | | Use the gcc likelihood annotation to indicate that allocation failures are extremely unlikely.
* Do correct calculation of pen dimensions for stroke optimizationVladimir Vukicevic2008-02-061-0/+17
|
* [cairo-error] Clean up all the warnings and missing _cairo_error() calls.Chris Wilson2007-10-041-4/+2
| | | | | | | | | | | Every time we assign or return a hard-coded error status wrap that value with a call to _cairo_error(). So the idiom becomes: status = _cairo_error (CAIRO_STATUS_NO_MEMORY); or return _cairo_error (CAIRO_STATUS_INVALID_DASH); This ensures that a breakpoint placed on _cairo_error() will trigger immediately cairo detects the error.
* [malloc/error] Add call to _cairo_error() after a failed malloc.Chris Wilson2007-10-041-1/+3
| | | | | Blitz all allocations to ensure that they raise a _cairo_error(CAIRO_STATUS_NO_MEMORY) on failure.
* [fix] Avoid int overflow when allocating large buffersVladimir Vukicevic2007-06-291-1/+1
| | | | | | | | This patch introduces three macros: _cairo_malloc_ab, _cairo_malloc_abc, _cairo_malloc_ab_plus_c and replaces various calls to malloc(a*b), malloc(a*b*c), and malloc(a*b+c) with them. The macros return NULL if int overflow would occur during the allocation. See CODING_STYLE for more information.
* Remove initial, final, and duplicate blank lines.Carl Worth2006-06-061-1/+0
| | | | | | This patch was produced by running git-stripspace on all *.[ch] files within cairo. Note that this script would have also created all the changes from the previous commits to remove trailing whitespace.
* Add functions to initialize and copy cairo_stroke_style_t objects.Carl Worth2005-11-071-0/+87
Use new _cairo_stroke_style functions rather than direct modification. Add missing prototype for _cairo_font_options_init_copy.