summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed.c
AgeCommit message (Collapse)AuthorFilesLines
2007-11-05[cairo-path-fixed] Exponentially enlarge cairo_path_buf_t.Chris Wilson1-35/+54
Allocate subsequent path bufs twice as large as the previous buf, whilst still embedding a small initial buf into cairo_path_fixed_t that handles the most frequent usage.
2007-10-30Simplify return value from cairo_path_fixed_get_current_point().Chris Wilson1-7/+4
The only caller of cairo_path_fixed_get_current_point(), used the status return to determine whether or not the path had a current point (and did not propagate the error) - for which we had already removed the _cairo_error() markup. Now we reduce the boolean status return to a cairo_bool_t, with a net reduction in code.
2007-10-16[cairo-path-fixed] Drop the _cairo_error() markup.Chris Wilson1-2/+5
Do not use _cairo_error(CAIRO_STATUS_NO_CURRENT_POINT) within _cairo_path_fixed_get_current_point() as the only caller, cairo_get_current_point(), expects and handles that status.
2007-10-04[cairo-error] Clean up all the warnings and missing _cairo_error() calls.Chris Wilson1-7/+7
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.
2007-10-04[malloc/error] Add call to _cairo_error() after a failed malloc.Chris Wilson1-2/+6
Blitz all allocations to ensure that they raise a _cairo_error(CAIRO_STATUS_NO_MEMORY) on failure.
2007-08-25Add a new fill_stroke surface backend method.Emmanuel Pacaud1-0/+27
This method is for use in vector backends, where fill immediatly followed by stroke command with the same path can be emited in the same backend command. This commit also factorize the detection of such cases in the meta surface backend and automatically call the fill_stroke method on replay.
2007-08-20Fix path_fixed_offset_and_scale to apply scale and offset in right orderVladimir Vukicevic1-15/+9
2007-07-18[fixpt] Use _cairo_fixed_mul insted of manual multiplicationVladimir Vukicevic1-8/+3
2007-04-03[src] Make sure all source files #include "cairoint.h" as their first includeBehdad Esfahbod1-1/+0
This is necessary to avoid many portability problems as cairoint.h includes config.h. Without a test, we will regress again, hence add it. The inclusion idiom for cairo now is: #include "cairoint.h" #include "cairo-something.h" #include "cairo-anotherthing-private.h" #include <some-library.h> #include <other-library/other-file.h> Moreover, some standard headers files are included from cairoint.h and need not be included again.
2007-03-20[cairo-path-fixed] Fix "comparison between signed and unsigned" warningsBehdad Esfahbod1-2/+2
2007-03-13[cairo-path-fixed] Merge op and arg bufsBehdad Esfahbod1-206/+107
This means, we have to malloc only one buffer, not two. Worst case is that one always draws curves, which fills the arg (point) buffer six times faster than op buffer. But that's not a big deal since each op takes 1 byte, while each point takes 8 bytes. So op space is cheap to spare, so to speak (about 10% memory waste at worst).
2007-03-13[cairo-path-fixed] Avoid malloc for small pathsBehdad Esfahbod1-28/+38
We do this by including an initial op and arg buf in cairo_path_fixed_t, so for small paths we don't have to alloc those buffers. The way this is done is a bit unusual. Specifically, using an array of length one instead of a normal member: - cairo_path_op_buf_t *op_buf_head; + cairo_path_op_buf_t op_buf_head[1]; Has the advantage that read-only use of the buffers does not need any change as arrays act like pointers syntactically. All manipulation code however needs to be updates, which the patch supposed does. Still, there seems to be bugs remaining as cairo-perf quits with a Bad X Request error with this patch.
2007-01-17cairo-path-fixed: Don't add redundant, succesive MOVE_TO operations to the pathCarl Worth1-3/+13
Instead, we can simply tweak the argument value for the last MOVE_TO operation that's already at the end of the path. This helps backends like pdf that are currently emitting all of the redundant MOVE_TO operations in the output.
2006-12-22Add optimization for rectilinear strokeCarl Worth1-0/+4
This custom stroking code allows backends to use optimized region-based drawing operations for rectilinear strokes. This results in a 5-25x performance improvement when drawing rectilinear shapes: image-rgb box-outline-stroke-100 0.18 -> 0.01: 25.58x speedup ████████████████████████▋ image-rgba box-outline-stroke-100 0.18 -> 0.01: 25.57x speedup ████████████████████████▋ xlib-rgb box-outline-stroke-100 0.49 -> 0.06: 8.67x speedup ███████▋ xlib-rgba box-outline-stroke-100 0.22 -> 0.04: 5.39x speedup ████▍ In other words, using cairo_stroke instead of cairo_fill to draw the same shape was 5-15x slower before, but is 1.2-2x faster now.
2006-12-19Rename cairo-path.c to cairo-path-fixed.cCarl Worth1-0/+639