summaryrefslogtreecommitdiff
path: root/src/cairo-path-fixed-private.h
Commit message (Collapse)AuthorAgeFilesLines
* Use uintptr_t for all casts between pointer and integerAdrian Johnson2021-07-251-1/+1
| | | | | | | | | | | | On 64-bit windows, long is 32-bit. When compiling there are a large number of warnings about mismatched sizes when casting long to/from a pointer. Use the (u)intptr_t type for any integer that will have a pointer stored in it. Use a (u)intptr_t cast when integers are stored in pointers to silence warnings. Fixes #263
* Mark _cairo_path_is_simple_quad as privateChris Wilson2013-01-271-1/+1
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* gl/msaa: Add a fast path for fills that are simple quadsMartin Robinson2013-01-251-0/+17
| | | | | Instead of invoking Bentley-Ottman for fills that are simple quadrilaterals, just pass the geometry straight to OpenGL.
* Introduce a new compositor architectureChris Wilson2011-09-121-0/+4
| | | | | | | | | | | | | | | | | | 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. :)
* path: Always interpret in forward directionAndrea Canciani2010-12-101-1/+0
| | | | | | Path are always interpreted in forward direction, so the ability of interpreting in the opposite direction (which is very unlikely to be useful at all) can be removed.
* path: Solve co-dependency problemAndrea Canciani2010-10-301-4/+4
| | | | | | | | FALSE and TRUE are defined in cairoint.h, but cairoint.h depends on cairo-path-fixed-private.h, so just use 0/1 to avoid the depencency loop. Fixes a number of errors reported by 'make check'.
* path: Rename fill optimization flagsAndrea Canciani2010-10-291-4/+11
| | | | Rename fill optimization flags making fill_ their common prefix.
* path: Add stroke_is_rectilinear flagAndrea Canciani2010-10-291-4/+5
| | | | | | Stroke and fill rectilinearity cannot be represented by a single flag without missing the opportunity of considering some strokes rectilinear.
* path: New path construction logicAndrea Canciani2010-10-291-4/+5
| | | | | | | | | | | Now move_to's are actually added to the path when followed by a drawing operation (line_to, curve_to or close_path). This is implemented by updating the current_point and setting the needs_move_to when a move_to operation is requested. Whenever a drawing operation is requested and the needs_move_to flag is set, a move_to is added before the drawing operation.
* path: Do not access flags directlyAndrea Canciani2010-10-291-7/+19
| | | | | | | Use inline accessors to hide the flags in the code. This ensures that flags that need additional computations (example: is_rectilinear for the fill case) are always used correctly.
* path: Exponentially grow buffer based on populated points and ops.Chris Wilson2010-06-111-1/+2
| | | | | | | | Instead of simply doubling the buffer size every time we overflow a point or an op, enlarge the buffer to fit twice the number of used points and ops. We expect paths to be fairly consistent in the mix of operations, and this allows the buffer size to tune itself to actual usage and reduce wastage.
* 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
* path: Compute coarse bounds upon construction.Chris Wilson2010-01-221-1/+3
| | | | | | Frequently we only need the coarse path bounds, so avoid walking over the list of points once more as we can cheaply track the extents during construction.
* [path] Standalone header-compilationChris Wilson2009-09-011-2/+2
| | | | Hmm, TRUE/FALSE apparently weren't defined before use. Odd.
* [fallback] Include implicit closes in the check for rectilinear pathsChris Wilson2009-08-291-0/+14
| | | | | | | | Fixes test/implicit-close By forgetting the implicit-close when checking for rectilinear paths, we tried to feed the triangle (and other diagclose) into the specialised rectilinear tesselators which completely mishandled that final edge.
* [path] Fix iter to handle circular list of buffersChris Wilson2009-07-291-0/+1
| | | | | When switching the path over to use the circularly linked list, 73f801, I missed updating the path iterator.
* Remove clip handling from generic surface layer.Chris Wilson2009-07-231-8/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ▏
* [path] Use cairo_list_t instead of open-coding its ownChris Wilson2009-07-051-6/+8
| | | | | | | Use the cairo_list_t and its style of iterators to improve the readability of the cairo_path_buf_t management. Note the complications that arise from the embedding of the initial buf -- however the macros do help make the unusual manipulations more identifiable.
* [path] Add path watch debuggingChris Wilson2009-07-051-0/+9
| | | | Simple debug macro to print the path to stderr during construction.
* [path] Evaluate is_box && is_region during constructionChris Wilson2009-07-051-0/+8
| | | | | | | Whilst constructing the path, if the operations continue to be axis-aligned lines, allow the is_box and is_region flags to persist. These are set to false as soon as a curve-to is added, a diagonal or in the case of is_region a non-integer point.
* [fill] Allow rectangles to be implicitly closed.Chris Wilson2008-11-291-2/+2
| | | | Also scan for appendages of simple rectangles.
* [path] Carefully check for no more points.Chris Wilson2008-11-291-5/+5
| | | | | As the empty path points to an embedded buf, we cannot rely on the buf pointer being NULL to mark end-of-path.
* [fill] Emit rectangles for GdkRegionChris Wilson2008-11-251-0/+17
| | | | Scan the path for a series of consistently wound rectangles.
* Add CairoScript backend.Chris Wilson2008-11-131-0/+11
| | | | | | | | | | A new meta-surface backend for serialising drawing operations to a CairoScript file. The principal use (as currently envisaged) is to provide a round-trip testing mechanism for CairoScript - i.e. we can generate script files for every test in the suite and check that we can replay them with perfect fidelity. (Obviously this does not provide complete coverage of CairoScript's syntax, but should give reasonable coverage over the operators.)
* Revamp the build system.Behdad Esfahbod2008-09-021-0/+2
| | | | | | | | | | | | | | | | | Quick summary of changes: - Move list of cairo source files out of src/Makefile.am and into src/Sources.mk, - Generate files src/Config.mk and src/Config.mk.win32 that choose the right set of source files and headers based on configured backends and features. This drastically simplifies building using other build systems. The src/Makefile.win32 file needs to be updated to reflect these changes. - Add README files to various directories, - Add toplevel HACKING file.
* [doc] Make sure all function names in docs are followed by ()Behdad Esfahbod2008-01-281-1/+1
|
* [cairo-path-fixed] Exponentially enlarge cairo_path_buf_t.Chris Wilson2007-11-051-7/+13
| | | | | | 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.
* [cairo-path-fixed] Remove leftover typedef keywordBehdad Esfahbod2007-08-301-1/+1
| | | | Oops!
* [cairo-path-fixed] typedef char cairo_path_fixed_op_tBehdad Esfahbod2007-08-301-2/+3
| | | | | So it consumes one byte only, instead of the previous enum with the __attribute__((packed)) that didn't do anything on non-gcc systems.
* Remove include of cairoint.h from *-private.h header files.Carl Worth2007-08-231-2/+0
| | | | | | | | | | | | These were recently added, (as part of sparse integration?), but they break boilerplate which reaches into at least cairo-types-private.h and cairo-scaled-font-private.h. But boilerplate cannot see cairoint.h or else it gets the internal sybol renaming, (with the INT_ prefix), and then all the test suite tests refuse to link. If this change reverts some recently-added functionality, (or cleanliness), then we'll just need to find some other way to add that back again without the breakage.
* [Makefile.am] Add target sparse to run sparse static source code analyzerBehdad Esfahbod2007-08-221-0/+2
| | | | There are still some bits not quite working.
* [cairo-path-fixed] Fine-tune size of bufferBehdad Esfahbod2007-03-131-4/+6
| | | | such that cairo_path_fixed_t fits in 512 bytes.
* [cairo-path-fixed] Merge op and arg bufsBehdad Esfahbod2007-03-131-14/+8
| | | | | | | | 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).
* [cairo-path-fixed] Avoid malloc for small pathsBehdad Esfahbod2007-03-131-2/+2
| | | | | | | | | | | | | | | | | 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.
* Add optimization for rectilinear strokeCarl Worth2006-12-221-1/+2
| | | | | | | | | | | | | | | | | | 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.
* Reimplement path.has_current point as a 1-bit bitfieldCarl Worth2006-12-221-1/+1
|
* Clean up names of cairo_path internals.Carl Worth2005-03-231-7/+7
|
* Rename cairo_path_real_t to cairo_path_fixed_t and fix all _cairo_path ↵Carl Worth2005-03-231-1/+1
| | | | | | functions to be named as _cairo_path_fixed functions. Track name change of cairo_path_real_t and _cairo_path_fixed functions.
* Begin the process of breaking up cairoint.h, moving structure definitions of ↵Carl Worth2005-03-231-0/+74
cairo_t, cairo_gstate_t, and cairo_path_real_t into their own header files. Track changes to header files, reaching into the new private headers where necessary.