Commit graph

10961 commits

Author SHA1 Message Date
Bryce Harrington
4fb5205d2e gl: Handle PIXMAN_a8r8g8b8_sRGB format in switch
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
7d57e76c9f test: Replace deprecated rsvg_init() in any2ppm test
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
ecc6f1918b test: Handle error in fgets call in ps-eps test
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
95daa8847c cairo-script: Error if asked to decompress with missing compression lib
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
eed0c9f65a cairo-script: Compare status with CSI enums
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
a0132059e6 perf: Guarantee path width is non-negative
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
01aaacd870 test: Quell warning for inclusion of old rsvg header files
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
72f5d6c51a test: Quell warning for deprecated g_type_init()
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
e06e806d76 xml: constify source objects for emit routines
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
f29b81db88 mesh: Avoid theoretical infinite loops
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
34009765e0 doc: Drop a couple quartz routines which distcheck claims don't exist
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>
2014-11-06 17:12:56 -08:00
Uli Schlachter
82f0e66099 Fix warnings from check-doc-syntax.sh
$ ./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>
2014-11-06 17:12:56 -08:00
Ravi Nanjundappa
798adbaac8 src : Fix warn_unused_result warnings from gcc
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>
2014-11-06 17:12:56 -08:00
Bryce Harrington
c459716316 configure.ac: Quell warnings about AM_PROG_AR when using automake 1.12
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=11401
  http://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>
2014-11-06 17:12:55 -08:00
Bryce Harrington
4efcd33eb5 configure.ac: Fix broken build for Qt backend
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>
2014-11-06 17:12:55 -08:00
Bryce Harrington
42be3f754c cairo-wideint: Fix typo in two cairo_uint128 functions
_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.
2014-11-06 17:12:55 -08:00
Ravi Nanjundappa
c61b3e0838 test : build fix when --enable-pdf=no
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>
2014-11-06 17:12:55 -08:00
Bryce Harrington
8fd32bf158 README: Update required dependencies 2014-11-06 17:12:50 -08:00
Adrian Johnson
9e83625356 type1-subset: don't rename glyphs used by seac operator
Bug 70364
2014-09-25 19:14:33 +09:30
Adrian Johnson
0bb3d86645 win32 printing: fix image scale when GDI scale is not identity 2014-09-14 22:11:04 +09:30
Rodrigo Rivas Costa
5243541f82 win32 print: fix cache_frozen assertions
Bug 81709
2014-09-14 22:10:47 +09:30
Chris Wilson
4b65497231 traps,xcb: Set the box count after filtering
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>
2014-08-27 11:07:15 +02:00
Chris Wilson
3bb80aa2c3 traps,xcb: Prefilter zero-area boxes when converting traps
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>
2014-08-27 11:07:10 +02:00
Uli Schlachter
826cda5974 xcb: Correctly check for image surface for inplace upload
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82987
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-08-27 11:07:02 +02:00
Uli Schlachter
213b3b9b8b Remove LTO support
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>
2014-08-27 11:04:00 +02:00
Bryce Harrington
ee69e744ee configure.ac: Add a --disable-lto configure option
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>
2014-08-27 11:03:39 +02:00
Sylvestre Ledru
3434b79281 Remove some potential double free
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-08-27 11:01:59 +02:00
Bryce Harrington
2be98be04e Fix segfault in firefox when scrolling on certain pages
Bug discovered by thorsten <fly_a320@gmx.de>

Patch from Chris Wilson <chris@chris-wilson.co.uk>
2014-08-27 11:01:20 +02:00
Uli Schlachter
5b083237f5 mask compositor: Set a check_composite method
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>
2014-08-27 11:00:42 +02:00
Uli Schlachter
17e14b62e0 clip: Fix handling of special all-clipped cairo_clip_t
_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>
2014-08-27 10:59:28 +02:00
Chris Wilson
087b92f32b clip: Do not modify the special all-clipped cairo_clip_t
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75819
2014-08-27 10:59:17 +02:00
Koji Egashira
518c9e4992 image: Add NULL checks for return value of _pixman_image_for_color()
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>
2014-08-27 10:58:49 +02:00
Bryce Harrington
91d245b204 image: Fix bad HTML generation in code docs for cairo-format-stride-for-width
Patch from Simon Kågedal Reimer

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63257
2014-08-27 10:58:27 +02:00
Adrian Johnson
920247086c type1: strip space from end of font name 2014-08-27 10:56:54 +02:00
Adrian Johnson
15045aebeb ps: add font DSC comments 2014-08-27 10:56:44 +02:00
Adrian Johnson
f5f09c9350 ps: cairo_set_page_size does not need to be in eps output 2014-08-27 10:56:31 +02:00
Adrian Johnson
be03857b51 ps: use setpagedevice to set page size
https://bugs.freedesktop.org/show_bug.cgi?id=73452
2014-08-27 10:56:17 +02:00
Marek Kasik
0f94381322 font: Generate PDFs with correct font names
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.
2014-08-27 10:56:06 +02:00
Adrian Johnson
990d384d9e ps: fix imagemask with pattern source failure on some printers
When /PaintProc is invoked the pattern dict is pushed onto the stack.
Ensure this dict is removed.

https://bugs.freedesktop.org/show_bug.cgi?id=69485
2014-08-27 10:55:55 +02:00
Adrian Johnson
892e564317 ps: remove duplicate /Interpolate from image dictionary
http://lists.freedesktop.org/archives/poppler/2014-January/010748.html
2014-08-27 10:55:43 +02:00
Adrian Johnson
51c2f018d7 pdf: fix rectangle stroke with non rectilinear pen 2014-08-27 10:55:30 +02:00
egag
caf1b826da Fixes stroke-clipped, i.c. of a dashed stroke
Similar to 1f4d05b55c
 'Fix calling '_cairo_spline_intersect' for in-bounds checking of splines'

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-08-27 10:54:45 +02:00
Uli Schlachter
c553424a1d fill_reduces_to_source(): Handle failure of color_to_pixel()
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>
2014-08-27 10:53:03 +02:00
Uli Schlachter
549129e306 check-doc-syntax: Don't hardcode path to awk
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>
2014-08-27 10:52:07 +02:00
Uli Schlachter
384878373d cairo-gobject: Require at least glib 2.14
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>
2014-08-27 10:51:19 +02:00
Adrian Johnson
6369470f30 ps: fix embedding of mime data 2014-08-27 10:51:04 +02:00
Adrian Johnson
35e0a26851 pdf: fix embedding of mime data that has been broken since 0a10982f
For some reason the mime-data test is not detecting this failure.
2014-08-27 10:50:51 +02:00
Adrian Johnson
3b3202dc00 svg: Don't embed CMYK Jpeg images
None of the SVG viewers I tried (rsvg, firefox, inkscape) support CMYK
Jpeg images.

Bug 68965
2014-08-27 10:49:32 +02:00
Chris Wilson
59e2a93b3c Post-release version bump 2013-08-26 18:46:19 +01:00
Chris Wilson
8e11a42e3e 1.12.16 release 2013-08-26 17:56:27 +01:00