Fixes the following compiler warning:
cairo-gl-surface.c:182:5: warning: enumeration value
‘PIXMAN_a8r8g8b8_sRGB’ not handled in switch
Same fix as done for image in 1d0055078.
Chris Wilson <chris@chris-wilson.co.uk>
As of libsvg 2.35 calling g_type_init() is sufficient.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Most likely this is just a theoretical problem since we just checked
feof, but this quells the following warning:
ps-eps.c:216:8: warning: ignoring return value of ‘fgets’, declared with
attribute warn_unused_result [-Wunused-result]
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This quells the following warning:
warning: enumeration value ‘LZO’ not handled in switch [-Wswitch-enum]
The LZO enum value is defined and used elsewhere, even if lzo support
isn't available.
This situation might arise if cairo scripts were generated on one system
with lzo, and then replayed on a system without it. For now simply
error out if this occurs.
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
CSI_STATUS_SUCCESS is defined as equivalent to CAIRO_STATUS_SUCCESS.
We should prefer the former when comparing against csi_status_t
variables, else we'll get a warning:
cairo-script-interpreter.c:637:23: warning: comparison between
‘csi_status_t’ and ‘enum _cairo_status’ [-Wenum-compare]
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This quells the following warning:
perf/micro/hatching.c:39:5: warning: cannot optimize loop, the
loop counter may overflow
Width and height aren't going to be negative so enforce it so that the
compiler can do whatever optimization it wants to do.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This silences a warning due to header file deprecated as of libsrvg
2.36.2. Tested and verified this hackaround on librsvg 2.36.4 and
2.36.1. No need to change version dependencies.
In file included from test/any2ppm.c:73:0:
/usr/include/librsvg-2.0/librsvg/rsvg-cairo.h:27:2: warning:
#warning "Including <librsvg/rsvg-cairo.h> directly is deprecated."
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
The g_type_init() routine was deprecated in glib 2.34. Tested and
verified this conditionalization on glib 2.32 and 2.36. No need to
change version dependencies.
test/any2ppm.c:864:5: warning: ‘g_type_init’ is deprecated
(declared at /usr/include/glib-2.0/gobject/gtype.h:669)
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This quells the following warnings:
src/cairo-xml-surface.c:576:5: warning: passing argument 2 of
‘_cairo_xml_surface_emit_clip_boxes’ discards ‘const’ qualifier from
pointer target type
src/cairo-xml-surface.c:462:1: note: expected ‘struct cairo_clip_t
*’ but argument is of type ‘const struct cairo_clip_t *’
Most of the cairo_xml*emit* routines const their source objects;
these should follow suit.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This quells this warning:
src/cairo-mesh-pattern-rasterizer.c:731:5: warning: cannot
optimize possibly infinite loops
I guess the compiler's complaining because if vsteps were negative or
equal to UINT_MAX the loop could cycle infinitely. Silly compiler.
Fix as suggested by Chris Wilson <chris@chris-wilson.co.uk>
These routines actually do exist in the source code, and have proper
documentation, so I'm not sure why distcheck dislikes them, but it's
happier without these listed.
Signed-off-by: Bryce Harrington <b.harrington@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>
Fix 'unused-result' warning messages by
- replacing cairo_private to cairo_private_no_warn in the
declaration of the cairo private apis '_cairo_surface_unmap_image',
'_cairo_polygon_add_line', '_cairo_polygon_add_external_edge' and
'_cairo_polygon_add_contour'
- removing cairo_warn for 'render_rows' member function pointer in
'struct _cairo_span_renderer'
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Without this, autogen.sh issues warnings like:
/usr/share/automake-1.14/am/ltlibrary.am: warning: 'libcairoboilerplate_cxx.la': linking libtool libraries using a non-POSIX
/usr/share/automake-1.14/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
boilerplate/Makefile.am:18: while processing Libtool library 'libcairoboilerplate_cxx.la'
AM_PROG_AR was introduced in automake 1.11.2. As per the docs for
AM_PROG_AR, it is supposed to be included when the archiver ('ar') is
used, but prior to automake 1.12 the warning was only shown iff
-Wextra-portability was specified. automake 1.12 introduced a change
that includes -Wextra-portability when -Wall is specified.
For further discussion of the issue, see:
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11401http://lists.gnu.org/archive/html/automake/2012-05/msg00014.html
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
When --enable-qt is specified, the build will break due to missing
libstdc++:
CCLD cairo-test-suite
/usr/bin/ld: ../boilerplate/.libs/libcairoboilerplate.a(libcairoboilerplate_cxx_la-cairo-boilerplate-qt.o): undefined reference to symbol '__gxx_personality_v0@@CXXABI_1.3'
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
When using g++ to compile and link code, g++ automatically links
libstdc++. However, in cairo we're using g++ only to compile, so need
to explicitly link against libstdc++ for backends that need iostream,
stl, or other stdc++ features.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=59038
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
_cairo_int128_negate and _cairo_int128_not are #defines of
_cairo_uint128_negate and _cairo_uint128_not respectively. The function
implementations should use the actual function name not the aliases. On
systems without a uint128 type, these could lead to build issues.
Credit for finding this go to Dr. Peter Barnes, LLNL.
Though --enable-pdf=yes by default, when --enable-pdf=no, the cairo build
fails due to unavailability of cairo-pdf.h and related cairo pdf's apis.
The current changes fixes this issue by conditionally checking if PDF
surface is enabled or not.
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
After converting, the number of boxes should only count the number of
non-zero boxes and forget about the zero-sized boxes we skipped over.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The rectangular tesselation routines rely on the presuming that all the
boxes it has to handle are already filtered to remove empty boxes.
<< /width 800 /height 600 >> surface context
0.0848671 0 0 0.0848671 39.907812 5.608896 matrix transform
8 0 m 12.417969 0 16 3.582031 16 8 c 16 12.417969 12.417969 16 8 16 c
3.582031 16 0 12.417969 0 8 c 0 3.582031 3.582031 0 8 0 c h
clip
16 0 m 8 8 l 16 16 l h
clip
0 0 16 16 rectangle
fill
Triggers the error given a traps tesselator like cairo-xlib.
Reported-by: Henrique Lengler <henriqueleng@openmailbox.org>
Analyzed-by: Massimo <sixtysix@inwind.it>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81699
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This just never worked too well and caused too many issues. I don't think anyone
will miss this.
As mentioned in the below bug report, proper LTO support also requires using
special versions of ranlib, nm and ar which support the LTO object files.
Otherwise, calling the normal ranlib on an .a library breaks the list of
exported symbols and thus completely breaks the static library.
This (partly) reverts the following commits:
c3645d97eb configure.ac: Add a --disable-lto configure option
d486ea30f1 configure: Conditionally include -flto
0870c6fb5b gcc-4.5 warnings and optimisation flags.
(The last commit is the one which brought us -flto in the first place even
though it doesn't talk about this. It's also the one which is only reverted
partly.)
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77060
CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Link-Time Optimization seems to be stable enough with gcc 4.8 and 4.9,
but has proven to be an issue in the past for many cairo users (webkit,
efl, ubuntu, opensuse, gentoo, arch...) who carry patches to disable it.
Gentoo's patch[1] adds a --disable-lto option to leave it enabled by
default but give users the ability to work around lto related build
problems (c.f. fdo #77060). Patch appears to have been authored by
Alexandre Rostovtsev[2].
1: sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-libs/cairo/files/cairo-1.12.16-lto-optional.patch
2: https://bugs.gentoo.org/show_bug.cgi?id=509552
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=60852
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Commit 503b6b9e2e added a check_composite method to the mask compositor, but
only added it to one of the existing implementations. This commit fixes that.
In cairo-image-compositor.c, there is already a check_composite method which
just returns success for the traps compositor. This commit makes the mask
compositor use that one.
I don't want to say much about cairo-image-mask-compositor.c except that I
wondered why this file and the file above both define a non-static function
called _cairo_image_mask_compositor_get(). In my opinion, that file should just
be deleted, since it confuses e.g. ctags, but I'll let someone else clean this
up.
Fixes 493 crashes in the test suite for the test-mask target.
Signed-off-by: Uli Schlachter <psychon@znc.in>
Tested-by: Bryce Harrington <b.harrington@samsung.com>
_cairo_clip_intersect_box() wasn't checking if it was called with the special,
read-only all-clipped clip and thus could have ended up writing to read-only
memory.
References: https://bugs.freedesktop.org/show_bug.cgi?id=75819
Signed-off-by: Uli Schlachter <psychon@znc.in>
This fixes crash in pixman_image_composite32().
Originally fixed by Yoshitaro Makise.
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Escape PostScript names of loaded fonts. These can not
contain white spaces and delimiter characters when saving
them to a PostScript file or a PDF file.
Similar to 1f4d05b55c
'Fix calling '_cairo_spline_intersect' for in-bounds checking of splines'
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
The function color_to_pixel() can fail for unsupported pixman image formats, but
fill_reduces_to_source() ignored this possibility.
Fix this by using the return value of color_to_pixel():
Fixes the following compiler warnings:
cairo-image-compositor.c: In function 'fill_boxes':
cairo-image-compositor.c:349:15: warning: 'pixel' may be used uninitialized in this function [-Wmaybe-uninitialized]
cairo-image-compositor.c: In function 'fill_rectangles':
cairo-image-compositor.c:304:18: warning: 'pixel' may be used uninitialized in this function [-Wmaybe-uninitialized]
Signed-off-by: Uli Schlachter <psychon@znc.in>
Instead of expecting awk in /usr/bin, this commit changes the code to call awk
through a shell so that $PATH is searched.
Since this awk script shouldn't really be called manually, this is done by
removing the shebang from the awk script, marking it non-executable and fixing
up the caller.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67674
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
cairo-gobject uses g_once_init_enter() and g_once_init_leave(). These functions
were added in glib 2.14 and thus cairo needs at least this version for its
gobject helper functions.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69239
Signed-off-by: Uli Schlachter <psychon@znc.in>