Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
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>
|
|
$ ./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>
|
|
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.
|
|
|
|
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()
|
|
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.
|
|
Signed-off-by: Uli Schlachter <psychon@znc.in>
|
|
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>
|
|
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>
|
|
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>
|
|
Just DIE DIE DIE in the _cairo_status_set_status() assertion.
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
Avoid leaks when reporting memfault associated with constructing
regions.
|
|
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
|
|
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 *’
|
|
|
|
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.
|
|
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.
|
|
|
|
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
▏
|
|
|
|
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.
|
|
Annotate object init/fini routines to detect use-after-free for
on-stack/embedded objects.
|
|
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.
|
|
|
|
|
|
Add the const declaration to a couple of functions.
|
|
Replace the open-coded version with the more readable macro.
|
|
Differentiate the private _cairo_region_set_error() function by using a
leading underscore.
|
|
Fixes for check-plt.sh (and a few adjacent whitespace).
|
|
|
|
When an operation fails, store the status code in the destination
region rather than leaving it unchanged.
|
|
Intersecting with and subtracting rectangles is quite common, and we
already have cairo_union_rectangle().
|
|
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.
|
|
It was only used in _cairo_traps_extract_region() which could be
simplified significantly by calling cairo_region_union_rect()
repeatedly instead.
|
|
Move struct _cairo_region to cairoint.h and delete
cairo-region-private.h. Delete cairo_private from the function
definitions that had it.
|
|
|
|
|
|
|
|
|
|
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
|
|
Having "not" in the name causes double negatives.
|