summaryrefslogtreecommitdiff
path: root/src/cairo-pattern.c
Commit message (Collapse)AuthorAgeFilesLines
* doc: Fix the gtk-doc syntax of internal symbolsKhaled Hosny2023-02-021-1/+2
| | | | To stop gtk-doc from listing them as undocumented.
* Rename is_userfont_foreground to is_foreground_markerAdrian Johnson2023-01-271-7/+7
| | | | as it is used by FT as well as user fonts.
* Foreground color fixes for ft, svg, colrv1Adrian Johnson2023-01-271-0/+8
|
* Fix shared use of recording surface with paginated targetsAdrian Johnson2023-01-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is _cairo_recording_surface_replay_and_create_regions() stores the cairo_recording_region_type_t in the same structure as the recording commands. This does not work well when the recording surface is used as source by multiple surfaces Fix this by moving the cairo_recording_region_type_t into a separate struct cairo_recording_regions_array_t. This struct is stored in a list that allows multiple create regions results to be store in the surface. The new function _cairo_recording_surface_region_array_attach() is used to create a new cairo_recording_regions_array_t, attach it to the recording surface and return a unique region id. The _cairo_recording_surface_replay_and_create_regions() and _cairo_recording_surface_replay_region() functions use this region id to identify the cairo_recording_regions_array_t. To handle nested recording surfaces, when replaying a recording, the region id is passed to the target as an extra parameter in the surface pattern. The wrapper surface makes a temporary copy of the pattern to ensure the snapshot pattern in the recording surface is not modified. cairo_recording_regions_array_t has a reference count so the target can hold on to the cairo_recording_regions_array_t after the paginated surface has called _cairo_recording_surface_region_array_remove().
* Integrate COLR v1 renderer with cairo-ft-font.cAdrian Johnson2023-01-081-1/+3
|
* Add some missing slim_hidden entriesAdrian Johnson2022-12-281-0/+5
|
* Document whether colors are premultipliedMatthias Clasen2022-12-241-0/+8
| | | | | | For the various APIs that take or return RGBA colors, make it explicit that they are unpremultiplied.
* Allow user fonts to use the foreground colorAdrian Johnson2021-09-181-0/+6
|
* Use uintptr_t for all casts between pointer and integerAdrian Johnson2021-07-251-16/+16
| | | | | | | | | | | | 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
* Misc. typosluz.paz2019-01-311-4/+4
| | | | | | | Found via `codespell -i 3 -w -I ../cairo-word-whitelist.txt -L tim,ned,uint` Follow up of 12cb59be7da Reviewed-by: Bryce Harrington <bryce@bryceharrington.org>
* Drop skia backendBryce Harrington2018-10-171-1/+1
| | | | | Commit 38806bc3 already disabled the backend from use, now drop the code.
* Use _cairo_malloc instead of mallocAdrian Johnson2018-05-071-12/+12
| | | | | | | | | | _cairo_malloc(0) always returns NULL, but has not been used consistently. This patch replaces many calls to malloc() with _cairo_malloc(). Fixes: fdo# 101547 CVE: CVE-2017-9814 Heap buffer overflow at cairo-truetype-subset.c:1299 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* pdf: set ca/CA instead of using an smask when the mask has constant alphaAdrian Johnson2017-10-241-0/+53
|
* pattern: Fix incorrect grammar in cairo_pattern_get_type.Bryce Harrington2016-10-101-2/+2
| | | | | | | "This function returns the type a pattern." is obviously missing 'of', but this can be stated more succinctly with active voice. Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
* Fix grammar in cairo_*_reference() function documentation.Bryce Harrington2016-10-101-2/+2
| | | | | | | "can be get" is incorrect grammar; "can be gotten" would be better, but active voice is best. Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
* Write debugging information to the debugging fileEd Schouten2016-09-041-1/+1
| | | | | | | | | | | | Some debugging functions wrote to stdout, which is inconsistent with the other debugging functions of the same groups. Instead they should write to the debugging file that they are given as input. Reviewed-by: Andrea Canciani <ranma42@gmail.com> Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=95227
* pattern: revert an unintentional change added in 190678fAdrian Johnson2016-07-181-1/+1
|
* pattern: don't round extents to 0 on vector surfacesAdrian Johnson2016-07-161-3/+11
| | | | | | | | In this bug a Type 3 font contains a dash glyph. The dash glyph consists of an 82x2 image. The image height, when scaled to user space, is < 1 resuling in the drawing operation for the image being culled. https://bugs.freedesktop.org/show_bug.cgi?id=94615
* image: fix record-replay-extend test failuresAdrian Johnson2016-06-051-0/+2
|
* Fix PDF record-neg-extents test failureAdrian Johnson2016-06-051-1/+30
| | | | | | Modify PDF surface to allow surface extents to have negative x, y. When emitting recording surfaces, set the surface extents to the recording extents.
* Revert "pattern: allow for a floating one pixel rounded difference."Bryce Harrington2015-07-171-5/+5
| | | | | | | While this fixed a real bug, in testing this patch was found to fail a number of tests and thus needs further work. This reverts commit e7acf4b6dc6666c2a2c54fb08e9ad6f01a1d415f.
* Avoid indiscriminate use of VALGRIND_MAKE_MEM_NOACCESS.John Lindgren2015-06-261-5/+5
| | | | | | | | | 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>
* pattern: allow for a floating one pixel rounded difference.Alban Browaeys2015-06-181-5/+5
| | | | | | | | | | | | That is if the difference between the origin and the end is bigger than .5 round up regardless of the coordinates. Round the difference of the floats instead of rounding the floats then diff them. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=84396 Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* Fix one more warning from check-doc-syntax.shRavi Nanjundappa2014-11-121-2/+2
| | | | | | | | | | $ ./check-doc-syntax.sh Checking documentation for incorrect syntax ./cairo-pattern.c (3342): ERROR: Will invalid doc id (should be 'cairo_...:') The proposed changes fixes the warning about the documentation style used in cairo. Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
* Fix warnings from check-doc-syntax.shRavi Nanjundappa2014-10-281-2/+2
| | | | | | | | | | | | $ ./check-doc-syntax.sh Checking documentation for incorrect syntax ./cairo-pattern.c (3346): ERROR: Will bad line: ' */' ./cairo-pattern.c (3346): ERROR: Will documentation comment not closed with **/ ./cairo-pattern.c (3422): ERROR: _cairo_pattern_sampled_area invalid doc id (should be 'cairo_...:') The warnings are about the documentation style used in cairo Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
* pattern: Restore dropped inclusion of cairoint.h1.14.0Bryce Harrington2014-10-131-0/+2
| | | | | Fixes failure in make release-check due by check-preprocessor-syntax.sh due to requirement that cairoint.h be the first include for source files.
* image: Corrected extents calculationsBill Spitzak2014-10-101-107/+168
| | | | | | | | | | | | New implementations of _cairo_pattern_sampled_area and _cairo_pattern_get_extents which produce a more accurate bounding box. These do not depend on side-effects of analyze_filter, can handle different horizontal and vertical scales, filters wider than 1 for down-scaling, and compute a somewhat tighter bounding box in most cases. I removed the pad output of _cairo_pattern_analyze_filter as it is unused. Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* image: Move filter decision to _cairo_pattern_analyze_filterBill Spitzak2014-10-101-1/+35
| | | | | | | | The analysis to deterimine if the GOOD filter can be replaced with the BILINEAR filter is moved to this function so it can be used by backends other than the image backend. Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* Fix _cairo_mesh_pattern_equal() when cairo_mesh_patch_t structs are differentMaks Naumov2014-08-281-1/+1
| | | | | Signed-off-by: Maks Naumov <maksqwe1@ukr.net> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* V5: Use NEAREST filter when possibleBill Spitzak2014-08-141-1/+1
| | | | | | | | | | | | | | (changed to use determinant funciton and remove debug printf) Modifies _cairo_matrix_has_unity_scale to return true for 90 degree rotations by allowing error caused by inaccuracy in trig functions. This fails after 14 additions of M_PI_2 to itself as a float argument to cairo_rotate, but the failure is in the detection of the integer translate, not in the trig components. I believe this is due to the matrix inversion, which may need similar rounding. Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
* Pattern document clarificationjimmyfrasche2014-05-121-8/+9
| | | | | | | | | Replaces documentation of the form "range 0 to 1 less than the number" with "ranges from 0 to n-1 where n is the number", which is idiomatic mathematical writing and less ambiguous. Signed-off-by: jimmyfrasche <soapboxcicero@gmail.com> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* gstate: Handle device scale on surface as sourceAlexander Larsson2013-09-051-0/+10
| | | | | | | | | | | | | | | | | | When creating a transformed pattern we must apply the device transform *before* the transform set on the pattern itself, otherwise e.g. its translation will not be affected by the device scale. We also fix up the device_transform related handling in _cairo_default_context_pop_group(). With a device scale we can no longer just use the device_transform_inverse to unset the device offset for the extents, so we make that a simple translate instead. We also remove some weird code that tries to handle the device transform but seems unnecessary (maybe a workaround for applying the device transform in the wrong order?). With that code removed things work fine, but with it things get translated wrongly when there is a scale.
* snapshot: Perform the cow under a mutexChris Wilson2012-04-271-3/+1
| | | | | | | | | | | | In order to prevent a race between concurrent destroy and use in another thread, we need to acquire a reference to the snapshot->target under a mutex. Whilst we hold that reference, it prevents the internal destroy mechanism from freeing the memory we are using (if we have a pointer to the original surface) and the client drops their final reference. Oh boy, talk about opening a can of worms... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Split cairo-list 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-recording-surface-private into struct+inlinesChris Wilson2012-04-191-2/+2
| | | | | References: https://bugs.freedesktop.org/show_bug.cgi?id=48577 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* fix _cairo_pattern_get_ink_extents to work with snapshot recording surfacesAdrian Johnson2012-04-061-0/+4
| | | | It had caused pdf bbox sizes to regress to page size bboxes.
* doc: Add "since" tag to documentationAndrea Canciani2012-03-291-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following Python script was used to compute "Since: 1.X" tags, based on the first version where a symbol became officially supported. This script requires a concatenation of the the cairo public headers for the officially supported beckends to be available as "../../includes/1.X.0.h". from sys import argv import re syms = {} def stripcomments(text): def replacer(match): s = match.group(0) if s.startswith('/'): return "" else: return s pattern = re.compile( r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', re.DOTALL | re.MULTILINE ) return re.sub(pattern, replacer, text) for minor in range(12,-2,-2): version = "1.%d" % minor names = re.split('([A-Za-z0-9_]+)', stripcomments(open("../../includes/%s.0.h" % version).read())) for s in names: syms[s] = version for filename in argv[1:]: is_public = False lines = open(filename, "r").read().split("\n") newlines = [] for i in range(len(lines)): if lines[i] == "/**": last_sym = lines[i+1][2:].strip().replace(":", "") is_public = last_sym.lower().startswith("cairo") elif is_public and lines[i] == " **/": if last_sym in syms: v = syms[last_sym] if re.search("Since", newlines[-1]): newlines = newlines[:-1] if newlines[-1].strip() != "*": newlines.append(" *") newlines.append(" * Since: %s" % v) else: print "%s (%d): Cannot determine the version in which '%s' was introduced" % (filename, i, last_sym) newlines.append(lines[i]) out = open(filename, "w") out.write("\n".join(newlines)) out.close()
* doc: Make doc ids more consistent my always putting ':' after themAndrea Canciani2012-03-291-18/+18
| | | | | This makes the documentations comments more consistent and fixes many reports of 'invalid doc id'.
* doc: Make documentation comments symmetricAndrea Canciani2012-03-291-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: preserve whitespace by using docbook screen tagNis Martensen2012-03-101-2/+2
| | | | | | | | | | Using the programlisting tag is not appropriate everywhere. Use the screen tag where the formatting shall be preserved and the text is no code listing. Also add whitespace to prevent gtk-doc from inserting paragraph breaks. Signed-off-by: Uli Schlachter <psychon@znc.in>
* doc: typoNis Martensen2012-03-101-1/+1
| | | | Signed-off-by: Uli Schlachter <psychon@znc.in>
* doc: fix typoNis Martensen2012-02-141-1/+1
| | | | | | | | The pattern creation function call in the example code has one _mesh too much. This hopefully fixes the mesh mismatch mess :) Signed-off-by: Nis Martensen <nis.martensen@web.de> Signed-off-by: Uli Schlachter <psychon@znc.in>
* doc: Fix pattern name mismatchNis Martensen2012-02-121-5/+5
| | | | | | | In the example code, the mesh pattern variable was named "mesh" and "pattern". Just use "pattern". Signed-off-by: Andrea Canciani <ranma42@gmail.com>
* rectangle: Implement _cairo_rectangle_contains_rectangle()Andrea Canciani2012-01-151-20/+6
| | | | And reuse it.
* pattern: Infinite color-only sources are always opaqueAndrea Canciani2012-01-151-5/+5
| | | | | No matter what the sampling extents are, infinite color-only sources are opaque.
* doc: Drop the gtk-doc markup from _cairo_radial_pattern_focus_is_insideChris Wilson2011-12-021-3/+3
| | | | | | Stop confusing gtk-doc with this private function. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Convert cairo_mime_surface_t to cairo_raster_source_pattern_tChris Wilson2011-11-251-9/+121
| | | | | | | | | | As discussed, overloading the cairo_surface_t semantics to include sources (i.e. read-only surfaces) was duplicating the definition of cairo_pattern_t. So rather than introduce a new surface type with pattern semantics, start along the thorny road of extensible pattern types. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
* Introduce a new compositor architectureChris Wilson2011-09-121-942/+195
| | | | | | | | | | | | | | | | | | 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/+44
| | | | | | | | | | | 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.
* image: move surface definition to new header for subclassingChris Wilson2011-08-131-0/+1
| | | | Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>