summaryrefslogtreecommitdiff
path: root/src/cairo-region.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-01pdf: structured text and hyperlink supportAdrian Johnson1-0/+1
2016-03-26Add CAIRO_STATUS_WIN32_GDI_ERROR for GDI errorsAdrian Johnson1-0/+1
2016-03-26Add CAIRO_STATUS_FREETYPE_ERROR for errors returned by libfreetypeAdrian Johnson1-0/+1
2016-03-26Add CAIRO_STATUS_PNG_ERROR for errors returned by libpngAdrian Johnson1-0/+1
2015-06-26Avoid indiscriminate use of VALGRIND_MAKE_MEM_NOACCESS.John Lindgren1-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>
2014-03-13Fix warnings from check-doc-syntax.shUli Schlachter1-12/+0
$ ./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>
2013-09-15pdf: support JBIG2 mime dataAdrian Johnson1-0/+1
JBIG2 images may have shared global data that is stored in a separate stream in PDF. The CAIRO_MIME_TYPE_JBIG2 mime type is for the JBIG2 data for each image. All images that use global data must also set CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID to a unique identifier. One of the images must also set CAIRO_MIME_TYPE_JBIG2_GLOBAL to the global data. The global data will be shared by all JBIG2 images with the same CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID.
2012-03-29doc: Add since documentation for enumeration valuesAndrea Canciani1-4/+4
2012-03-29doc: Add "since" tag to documentationAndrea Canciani1-0/+2
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()
2012-03-29doc: Make documentation comments symmetricAndrea Canciani1-2/+2
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.
2012-03-10doc: fix a few typos found by codespellNis Martensen1-1/+1
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-15Add preliminary damage trackingChris Wilson1-0/+32
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>
2011-07-23region: Directly handle single rectangle creation in create_rectangles()Chris Wilson1-2/+11
In order to avoid the copy and transformation of the single rectangle, we can simply pass it to pixman and create the region from it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-07-09Handle CAIRO_STATUS_DEVICE_FINISHED in switchesUli Schlachter1-0/+1
Fixes all warnings that looked like this: warning: enumeration value 'CAIRO_STATUS_DEVICE_FINISHED' not handled in switch Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-18region: Don't be nice to people setting internal error codeBenjamin Otte1-3/+3
Just DIE DIE DIE in the _cairo_status_set_status() assertion.
2011-01-01mesh: Add mesh pattern type and enum valuesAdrian Johnson1-0/+1
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.
2010-07-09doc: Add missing region documentationBenjamin Otte1-0/+25
2010-07-08doc: Fix some consistency issues that confuse gtk-docBenjamin Otte1-3/+13
2010-07-06region: Add cairo_region_xor() and cairo_region_xor_rectangle()Benjamin Otte1-0/+80
gdk_region_xor() was a quite often used function in GDK and now that GDKe uses cairo regions, it seems like a worthwhile addition to Cairo.
2010-06-07region: clarify docs of cairo_region_equal()Benjamin Otte1-4/+5
2010-05-10region: _cairo_region_create_in_error()Chris Wilson1-8/+55
Avoid leaks when reporting memfault associated with constructing regions.
2010-04-27Update FSF addressAndrea Canciani1-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
2010-04-26region: Cast to remove const to suppress compiler warnings.Chris Wilson1-2/+2
airo-region.c: In function ‘cairo_region_intersect’: cairo-region.c:503: warning: passing argument 3 of ‘pixman_region32_intersect’ discards qualifiers from pointer target type /usr/local/include/pixman-1/pixman.h:518: note: expected ‘struct pixman_region32_t *’ but argument is of type ‘const struct pixman_region32_t *’ cairo-region.c: In function ‘cairo_region_union’: cairo-region.c:566: warning: passing argument 3 of ‘pixman_region32_union’ discards qualifiers from pointer target type /usr/local/include/pixman-1/pixman.h:521: note: expected ‘struct pixman_region32_t *’ but argument is of type ‘const struct pixman_region32_t *’
2010-04-07region: Make the 2nd argument to intersect and union constBenjamin Otte1-2/+2
2010-01-22Move _cairo_error() to a standalone headerChris Wilson1-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.
2009-08-29[clip] Apply surface offset when combining with clip maskChris Wilson1-2/+6
In order to correctly combine the clip mask with the compositing mask the clip path must be offset so that it is relative to the destination surface.
2009-08-29[traps] Compute extents on demand.Chris Wilson1-29/+18
2009-07-23Remove clip handling from generic surface layer.Chris Wilson1-41/+129
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 ▏
2009-06-15[region] Add PLT entry for cairo_region_create_rectangles()Chris Wilson1-2/+3
2009-06-15Reinstate cairo_region_create_rectangles()Søren Sandmann Pedersen1-0/+44
cairo_region_union_rectangle() is linear in the number of rectangles in the region. There is no way to make it significantly faster without losing the ability to return errors synchronously, so a cairo_region_create_rectangles() is needed to avoid a large performance regression.
2009-06-04valgrindify init/fini routinesChris Wilson1-0/+5
Annotate object init/fini routines to detect use-after-free for on-stack/embedded objects.
2009-04-16[xlib] Allocate bounded region on stack.Chris Wilson1-0/+23
Eliminate the extremely short-lived and oft unnecessary heap allocation of the region by first checking to see whether the clip exceeds the surface bounds and only then intersect the clip with a local stack-allocated region.
2009-04-01[region] pixman_region32_contains_point() does not allow NULL for boxSøren Sandmann Pedersen1-1/+3
2009-03-31[region] Change name of cairo_region_empty() to cairo_region_is_empty()Søren Sandmann Pedersen1-3/+3
2009-03-30[region] Use const cairo_rectangle_int_t consistently.Chris Wilson1-2/+2
Add the const declaration to a couple of functions.
2009-03-30[region] Use _cairo_status_is_errorChris Wilson1-1/+1
Replace the open-coded version with the more readable macro.
2009-03-30[region] Add leading underscore to private _cairo_region_set_error()Chris Wilson1-12/+12
Differentiate the private _cairo_region_set_error() function by using a leading underscore.
2009-03-30[region] Add slim_hidden_def.Chris Wilson1-111/+133
Fixes for check-plt.sh (and a few adjacent whitespace).
2009-03-28[region] Add documentation for all the new region methods.Søren Sandmann Pedersen1-31/+229
2009-03-28[region] Fix status propagation for regionsSøren Sandmann Pedersen1-14/+52
When an operation fails, store the status code in the destination region rather than leaving it unchanged.
2009-03-28[region] Add cairo_region_intersect_rectangle() and _subtract_rectangle()Søren Sandmann1-1/+44
Intersecting with and subtracting rectangles is quite common, and we already have cairo_union_rectangle().
2009-03-28[region] Expand rect to rectangle in a couple of namesSøren Sandmann Pedersen1-13/+3
Specifically, cairo_region_union_rect -> cairo_region_union_rectangle cairo_region_create_rect -> cairo_region_create_rectangle Also delete cairo_region_clear() which is not that useful.
2009-03-28[region] Delete cairo_region_create_rectangles()Søren Sandmann Pedersen1-44/+0
It was only used in _cairo_traps_extract_region() which could be simplified significantly by calling cairo_region_union_rect() repeatedly instead.
2009-03-28[region] Move region function prototypes to cairo.h along with helper types.Søren Sandmann1-3/+3
Move struct _cairo_region to cairoint.h and delete cairo-region-private.h. Delete cairo_private from the function definitions that had it.
2009-03-28[region] Remove underscores from _cairo_region_*Søren Sandmann1-31/+30
2009-03-28[region] Add _cairo_region_contains_point()Søren Sandmann1-2/+13
2009-03-28[region] Add _cairo_region_unionSøren Sandmann Pedersen1-0/+16
2009-03-28[region] Add a cairo_region_overlap_t typeSøren Sandmann Pedersen1-9/+24
2009-03-28[region] Consistently use rectangles in the API of regionsSøren Sandmann Pedersen1-14/+14
Usually, rectangles are more useful than boxes, so regions should only expose rectangles in their public API. Specifically, _cairo_region_num_boxes becomes _cairo_region_num_rectangles _cairo_region_get_box becomes _cairo_region_get_rectangle Remove the cairo_box_int_t type
2009-03-28[region] Change sense of _cairo_region_not_empty() to _cairo_region_empty()Søren Sandmann1-3/+3
Having "not" in the name causes double negatives.