summaryrefslogtreecommitdiff
path: root/src/cairo-types-private.h
Commit message (Collapse)AuthorAgeFilesLines
* Make cairo_tag_begin/end work correctly in groupsAdrian Johnson2023-04-181-0/+11
| | | | Fixes #508
* Add a custom palette to font optionsMatthias Clasen2023-01-201-0/+7
| | | | | | | Add a way to define a custom color palette as part of cairo_font_options_t. To use the custom palette when rendering color fonts, set the palette index to CAIRO_COLOR_PALETTE_CUSTOM.
* Add color mode optionAdrian Johnson2022-06-261-0/+1
|
* Add color palette optionAdrian Johnson2022-06-171-0/+1
|
* Fix font count in Inkscape's win32 pdf exportNathan Lee2022-03-091-2/+2
| | | | | Fix win32 hash comparison, where unsigned long is shorter than uintptr_t. Follow-up to 9fbf42754899898934bc8bf4f8eeacba37656fdc.
* [quartz] Snapshot CGBitmapContext-mapped surfaces to cache CGImages.John Ralls2022-02-241-1/+2
| | | | | | | | Motivation: Avoid need to recreate CGImages for unchanged surfaces, an expensive operation, while ensuring that the CGImages are properly freed and new ones created when the surface does change. Thanks to Uli Schlacter for suggestion and coding guidance.
* Added hairline support to cairoRick Yorgason2021-08-151-0/+2
|
* 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
* Add font variations to font optionsMatthias Clasen2017-12-191-0/+1
| | | | | | Add a font option for OpenType font variations, specified as a string in a format similar to the proposed css font-variation-settings property.
* Fix warnings from check-doc-syntax.shUli Schlachter2014-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | $ ./check-doc-syntax.sh Checking documentation for incorrect syntax ./cairo-types-private.h (148): WARNING: cairo_hash_entry_t: missing 'Since' field (is it a private type?) ./cairo-types-private.h (161): WARNING: cairo_hash_entry_t: not found ./cairo-types-private.h (175): WARNING: cairo_lcd_filter_t: missing 'Since' field (is it a private type?) ./cairo-cache-private.h (85): WARNING: cairo_cache_entry_t: missing 'Since' field (is it a private type?) ./cairo-region.c (857): WARNING: cairo_region_overlap_t: not found ./cairo-raster-source-pattern.c (62): WARNING: SECTION:cairo-raster-source 'Since' field in non-public element The warnings about missing 'Since' fields are fixed by changing the documentation comment so that the script can see that these are private types. The documentation for cairo_region_overlap_t gets moved to cairo.h, just like e.g. the documentation for cairo_status_t. The 'Since' field from the SECTION:cairo-raster-source is removed, because this kind of field is needed on the individual functions and structs, not on the section. Thanks to Bryce Harrington for bringing this up! Signed-off-by: Uli Schlachter <psychon@znc.in> Tested-by: Bryce Harrington <b.harrington@samsung.com>
* doc: Make documentation comments symmetricAndrea Canciani2012-03-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation comments should always start with "/**" and end with "**/". This is not required by gtk-doc, but it makes the documentations formatting more consistent and simplifies the checking of documentation comments. The following Python script tries to enforce this. from sys import argv from sre import search for filename in argv[1:]: in_doc = False lines = open(filename, "r").read().split("\n") for i in range(len(lines)): ls = lines[i].strip() if ls == "/**": in_doc = True elif in_doc and ls == "*/": lines[i] = " **/" if ls.endswith("*/"): in_doc = False out = open(filename, "w") out.write("\n".join(lines)) out.close() This fixes most 'documentation comment not closed with **/' warnings by check-doc-syntax.awk.
* doc: fix a few typos found by codespellNis Martensen2012-03-101-1/+1
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* Add preliminary damage trackingChris Wilson2012-02-151-0/+1
| | | | | | | | This is initially based around the requirements for handling internal fallbacks to the image compositor and reducing the number of pixels required to be transferred. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Introduce a new compositor architectureChris Wilson2011-09-121-21/+13
| | | | | | | | | | | | | | | | | | 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. :)
* pdf: use ink extents for smask bboxAdrian Johnson2011-09-051-0/+5
| | | | | | | | | | | There are some inkscape bugs reporting very slow rendering of inkscape generated PDFs (inkscape uses cairo for PDF output). These bugs are caused by cairo specifying a page sized bounding box in XObjects and Patterns. PDF renderers usually use the BBox as the image size when compositing. As PDFs generated from SVG tends to use a lot of XObjects and Patterns this can lead to very long rendering times. These three patches tighten up all the BBoxes in PDF output.
* stroke: Convert the outlines into contour and then into a polygonChris Wilson2011-08-151-1/+5
| | | | | | | | | | | | 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>
* Introduce cairo_surface_observer_t for performance analysisChris Wilson2011-08-141-0/+6
| | | | | | | | | | | | | | Another logging passthrough surface that records the style of operations performed trying to categorise what is slow/fast/important. In combination with perf/cairo-analyse-trace it is very useful for understanding what a trace does. The next steps for this tool would be to identify the slow operations that the trace does. Baby steps. This should be generally useful in similar situations outside of perf/ and should be extensible to become an online performance probe. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* skia: Update to use cairo_backend_t interfaceChris Wilson2011-08-131-6/+5
| | | | | | | | | | | | | Still hopelessly broken. Requires compiling cairo to use static linking and then still requires manual linkage to workaround libtool. Lots of functionality is still absent - we need to either find analogues to some Cairo operations or implement fallbacks - but it is sufficient to investigate how Skia functions in direct comparison with Cairo for tessellation/rasterisation. Caveat emptor. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* pdf: check if images are grayscale or monochrome and encode as suchAdrian Johnson2011-08-021-0/+8
| | | | | | Printing PDFs with large monochrome or grayscale images would result in the images being blown up to 24-bit color images. Some printers are very slow to print huge color images.
* Fix make checkAndrea Canciani2011-07-311-0/+1
| | | | | This fixes multiple failures when checking if headers can be used standalone.
* clip: Rudimentary support for clip-polygon extractionChris Wilson2011-07-191-10/+1
| | | | | | | 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>
* pattern: Add observer hooksChris Wilson2011-07-151-114/+0
| | | | | | | | | In order for custom context to automatically track when a pattern is modify after being set on the context (and before it is used in an operator), we need for there to be a callback when the pattern is modified. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Implement cairo_backend_tChris Wilson2011-07-151-1/+13
| | | | | | | | | | Allow a backend to completely reimplement the Cairo API as it wants. The goal is to pass operations to the native backends such as Quartz, Direct2D, Qt, Skia, OpenVG with no overhead. And to permit complete logging contexts, and whatever else the imagination holds. Perhaps to experiment with double-paths? Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* pattern: Use double precision for gradient extreme objectsAndrea Canciani2011-01-021-6/+4
| | | | | | | | | Using double precision for gradient extreme objects ensures that they are preserved as specified when constructing the gradient pattern. Fixes huge-linear, huge-radial. Fixes part of https://bugs.freedesktop.org/show_bug.cgi?id=32215
* mesh: Add mesh pattern type and enum valuesAdrian Johnson2011-01-011-0/+46
| | | | | | | | Add the mesh pattern type and an error status to be used to report an incorrect construction of the pattern. Update the backends to make them ready to handle the new pattern type, even if it cannot be created yet.
* pattern: Add a function to interpolate gradient objects.Andrea Canciani2010-12-131-0/+5
| | | | | | | | This will be a common function used by the quartz, ps, and pdf backends when rewriting EXTEND_REFLECT/REPEAT gradients in terms of EXTEND_PAD gradients. Reviewed-by: M Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
* fill: Simplify path to polygon conversionAndrea Canciani2010-12-101-7/+0
| | | | | | | | | | | | Using _cairo_path_fixed_interpret_flat() greatly simplifies the path to polygon conversion (because it already converts curve_to's to line_to's). This commit also removes the optimization which merges two consecutive lines if they have the same slope, because it's unlikely (since it should already happen during path construction), it doesn't provide better performance (at least not measurable with the currently available cairo-traces) and bloats the code.
* array: Remove snapshot supportAndrea Canciani2010-11-241-3/+1
| | | | | | | | Array snapshots are not used anymore and just bloat the implementation of cairo_array_t. In particular, double indirection was needed to implement array snapshots, as explained in c78685399307431903613733ddc936a104376943.
* font options: Add private round_glpyh_positions fieldUli Schlachter2010-10-211-0/+7
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* subsurface: Make CAIRO_SURFACE_TYPE_SUBSURFACE publicBenjamin Otte2010-08-261-2/+1
|
* Convert mime data length to use unsigned longChris Wilson2010-07-101-1/+1
| | | | | | | What we want to use is size_t, but we don't want the implied POSIX dependency. However, POSIX does say that size_t is an unsigned integer that is no longer than a long, so it would appear safe to use an unsigned long as a replacement. Safer at least than unsigned int.
* doc: Move tmpl/ docs to inline docsBenjamin Otte2010-07-081-0/+8
| | | | | | I did this manually so I could review the docs at the same time. If anyone finds typos or other mistakes I did, please complain to me (or better: fix them).
* ft,fc,xlib: LCD filtering patch.Nicolaus L Helper2010-06-171-0/+25
| | | | | | | | | | | | | | | | | This adds internal API to retrieve the LCD filtering parameters from fontconfig, or as set on the Screen, and feed them to FreeType when rendering the glyph. References: Bug 10301 - LCD filtering patch https://bugs.freedesktop.org/show_bug.cgi?id=10301 Tested-by: Brandon Wright <bearoso@gmail.com> Forward-ported-by: Robert Hooker <sarvatt@gmail.cm> ickle: The API is clearly not ready for public consumption, the enum are poorly named, however this stands by itself as enabling system wide properties.
* gstate: Update cached matrix state after device transform changes on the targetChris Wilson2010-06-111-0/+6
| | | | | | | | | | | | Commit 8d67186cb291cb877e52b987e2ac18c2a1175a57 caches whether the device transform is identity on context creation. However, the api is quite lax and allows the user to modify the device transform *after* he has started to use the surface in a context, as apparently WebKit does. Since this is not the only instance where we may need to invalidate caches if the user modifies state, introduce a simple mechanism for hooking into notifications of property changes. Fixes test/clip-device-offset.
* pattern: remove content field from solid patternsAndrea Canciani2010-06-101-1/+0
| | | | | The content field in solid patterns had ill-defined semantic (or no semantic at all), thus it can be removed.
* Make cairo_color_stop_t a unique type.Chris Wilson2010-05-131-1/+16
| | | | | | | | | Hopefully reduce the occurrence of the confusion between the premultiplied shorts in cairo_color_t and the non-premultiplied shorts in cairo_color_stop_t. The existence of the two separate types is debatable and open for review.
* 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
* scaled-font: Optimize cairo_scaled_font_lookup()Chris Wilson2010-03-301-0/+1
| | | | | | | | By tracking which fields of information are already available on the scaled_glyph we can more efficiently determine if we already have the requested fields. This reduces from about 6 conditionals to one, and reduces the function overhead by ~20% -- which has a measurable improvement on glyph benchmarks.
* types: Move cairo_scaled_glyph_t to cairo-types-private.hChris Wilson2010-01-221-0/+25
| | | | Another step in bringing some sanity to our headers.
* color: Add enum value for the largest stock color.Chris Wilson2010-01-221-1/+2
| | | | | Useful if we wish to keep a cache of patterns for the very common stock colors...
* boxes: Efficient storage for an array of cairo_box_t.Chris Wilson2010-01-221-0/+1
| | | | | | | | | Currently we use cairo_traps_t to also pass around arrays of boxes. This is woefully inefficient in terms of storage, but also means that we repeatedly have to verify that the traps are a set of boxes. By explicitly passing around a cairo_boxes_t we avoid the semantic loss. This will be heavily used in pending commits.
* Alter definition of cairo_composite_rectangles_tChris Wilson2010-01-221-23/+1
| | | | | | | This is a more useful definition that is able to individually track the rectangles that compose the composite operation. This will be used by the specialist compositors as a means to perform the common extents determination for an operation.
* Add cairo_device_tChris Wilson2010-01-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The device is a generic method for accessing the underlying interface with the native graphics subsystem, typically the X connection or perhaps the GL context. By exposing a cairo_device_t on a surface and its various methods we enable finer control over interoperability with external interactions of the device by applications. The use case in mind is, for example, a multi-threaded gstreamer which needs to serialise its own direct access to the device along with Cairo's across many threads. Secondly, the cairo_device_t is a unifying API for the mismash of backend specific methods for controlling creation of surfaces with explicit devices and a convenient hook for debugging and introspection. The principal components of the API are the memory management of: cairo_device_reference(), cairo_device_finish() and cairo_device_destroy(); along with a pair of routines for serialising interaction: cairo_device_acquire() and cairo_device_release() and a method to flush any outstanding accesses: cairo_device_flush(). The device for a particular surface may be retrieved using: cairo_surface_get_device(). The device returned is owned by the surface.
* Real zero-copy cow snapshottingChris Wilson2010-01-221-0/+2
| | | | | | | | | | The first iteration of COW snapshotting always made an initial copy when the snapshot was requested (and reused that copy until the surface was modified). However, in a few circumstances we can avoid even that copy so long as the surface is still alive and unmodified between the snapshotting and its use. In order to do so, we need a new proxy surface that can automatically perform the copy if the target should disappear prior to use.
* Add subsurface.Chris Wilson2010-01-221-1/+3
| | | | | | | | A subsurface is a region of another surface that may be used either to restrict the writable area of a context or the readable extents of a source. Whilst writing, access to the exterior of the subsurface is prevented via clipping and when used as a source reads from the exterior of the subsurface are governed via the extend mechanism of the pattern.
* [meta] Rename cairo_meta_surface_t to cairo_recording_surface_t.M Joonas Pihlaja2009-10-221-1/+1
| | | | | | | The new name is more descriptive than the rather opaque meta surface. Discussed with vigour on the mailing list and #cairo: http://lists.cairographics.org/archives/cairo/2009-July/017571.html
* Support component-alpha.Chris Wilson2009-10-211-0/+71
| | | | | | | | | | | | | Within our code base we carried a few hacks to utilize the component alpha capabilities of pixman, whilst not supporting the concept for our own masks. Thus we were setting it upon the pixman_image_t that we passed around through code that was blissfully unaware and indeed the component-alpha property was forgotten (e.g. upgrading glyph masks). The real issue is that without explicit support that a pattern carries subpixel masking information, that information is lost when using that pattern with composite. Again we can look at the example of compositing a sub-pixel glyph mask onto a remote xlib surface for further failure.
* [polygon] Fix discard with non-banded disjoint clip boxesChris Wilson2009-09-031-0/+1
| | | | | | | The early discard checked if the line was below the last clip-box, or if above the first. However, the clip-boxes are only sorted on by the bottom (not the strict XY-banded sort of the regions) and so this was erroneously discarding lines.
* [clip] Use geometric clipping for unaligned clipsChris Wilson2009-08-291-2/+2
| | | | | | For the simple cases where the clip is an unaligned box (or boxes), apply the clip directly to the geometry and avoid having to use an intermediate clip-mask.
* [polygon] Amalgamate collinear edgesChris Wilson2009-08-291-0/+3
| | | | | Combine sequential collinear edges into a single edge, this benefits immensely by feeding fewer edges into either the tessellator or spans.