Commit graph

11067 commits

Author SHA1 Message Date
Ravi Nanjundappa
7d44f8d47e 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-08-14 12:00:08 -07:00
Uli Schlachter
c7ff9bb32e 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-01 13:11:31 -07:00
Chris Wilson
27c9923e98 xlib: Undo debug hack to force fallbacks
Remove the debug hack from

commit f337342c88
Author: Bill Spitzak <spitzak@gmail.com>
Date:   Fri Jul 18 18:46:26 2014 -0700

    V6 image: Use convolution filters for sample reconstruction when downscaling

as it forces the fallback image surface for xlib causing severe
performance degradation.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82002
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Bill Spitzak <spitzak@gmail.com>
Cc: Bryce Harrington <b.harrington@samsung.com>
2014-08-01 11:30:42 +01:00
Bill Spitzak
f337342c88 V6 image: Use convolution filters for sample reconstruction when downscaling
This version removes testing code and has some changes to match my current
pixman version. My proposed pixman patch (not finished yet) will produce
exactly the same results as this cairo patch.

This code contains an all-new filter generator to replace the one that is
in pixman. Results in 222 pass/298 failed image tests, which is much better
than the previous versions of this patch.

Filter generator (which should probably be in pixman):

- Single filter, no "reconstruction" and "sample" filter
- Filters for derivative < 1 work
- Fixed IMPULSE and BOX
- Added TENT, CATMULL_ROM, NOTCH. Remove LANZCOS2.
- Renamed CUBIC to MITCHELL

Cairo's filter settings:

- CAIRO_FILTER_GOOD: uses BOX filter for scales less than .75 in either
  direction. Uses PIXMAN_FILTER_GOOD (ie BILINEAR) otherwise.

- CAIRO_FILTER_BEST: uses CATMULL filter always. Upscaling more than 2x will
  produce anti-aliased square pixels, similar to OS/X.

- CAIRO_FILTER_GAUSSIAN: this obsolete value is used to test other filters.
  The program must declare and poke the filter into the static varialbe
  ikernel. This should be removed for production code.

NYI: This version uses the fallback for xlib always. The xlib and xcb backends
must be rewritten to use the fallback version if filtering is needed. Or the
filtering code must be moved to XRender.
2014-07-25 12:16:53 -07:00
Bryce Harrington
e71b917bbf xlib: Fix mispelling in a comment 2014-07-24 18:41:37 -07:00
Bryce Harrington
82b4781f18 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-07-24 18:41:37 -07:00
Behdad Esfahbod
9e6ceb23b4 More binary mode for Windows
Based on:
https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-cairo/0012-more-binary-mode.mingw.patch
2014-07-23 12:12:04 -04:00
Behdad Esfahbod
23dce494d1 Binary mode in any2ppm
From:
https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-cairo/0010-binary-mode-in-any2ppm.mingw.patch
2014-07-23 12:09:45 -04:00
Behdad Esfahbod
f4dbba26d4 [cairo-trace] Work around fontconfig :charset= parse format change
As dicussed on the mailing list.
2014-07-14 15:55:12 -04:00
Bryce Harrington
2a37cbbabc 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-07-11 18:34:43 -07:00
Bryce Harrington
c3645d97eb 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-07-11 18:34:43 -07:00
Bryce Harrington
0f46fc8dc1 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-07-11 18:34:43 -07:00
Behdad Esfahbod
312553af29 [trace] Don't print FC_CHARSET, FC_LANG, and FC_CAPABILITY
There are many more that can go, but these take the most bytes.
FC_CHARSET needs to go specially because I recently changed
its format in fontconfig.  Ouch!
2014-07-11 11:07:25 -04:00
Behdad Esfahbod
4cb220773d chmod a+x cairo-trace 2014-07-11 11:07:25 -04:00
Ravi Nanjundappa
e279709bf3 skia : Add Debug support for skia backend
Enable the DEBUG support for skia backend to provide more
descriptive information on the unexpected operational behaviours.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-07-10 12:08:01 -07:00
Ravi Nanjundappa
8a605472d2 .gitignore: Ignore the generated profile data files from callgrind tool in test/
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-07-09 16:51:22 -07:00
Jeff Muizelaar
30cb23d3b6 clang-cl: Use size of the pointer explicitly
This works around http://llvm.org/PR20216.
2014-07-09 16:35:30 -04:00
Bryce Harrington
28c3b92fb4 .gitignore: Ignore two generated files in build/
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-07-08 17:47:23 -07:00
Ravi Nanjundappa
7bd68b5799 skia: update the source to build with the latest skia
This fixes several build related issues for the skia backend
which is introduced due to skia source up-gradation.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-07-08 11:09:04 -07:00
Ravi Nanjundappa
be62b12211 xcb: make use of _cairo_surface_is_xcb to check for surface type
Introduced a new inline function _cairo_surface_is_xcb() as similar to
_cairo_surface_is_image() and used the same to check for xcb surface
type

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
2014-07-07 03:53:13 -07:00
Jeff Muizelaar
550385fb00 Don't use __FUNCTION__ as a string literal
clang-cl doesn't support this and we don't gain much
from using it.
2014-06-30 14:17:18 -04:00
Ravi Nanjundappa
f574fec8d2 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-06-05 16:12:30 -07:00
Eric Le Bihan
5741a7f2ca test: fix build of any2ppm if fork not available
The test program any2ppm can run as daemon. This feature can be disabled
at compile time, if the required headers are not present. However the
support for fork() is not checked.

This patch fixes this issue.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
2014-06-05 16:09:45 -07:00
Uli Schlachter
3d94269bd4 Revert "image: Use convolution filters for sample reconstruction when downscaling"
This reverts commit fb57ea13e0.

When running cairo-test-suite with the parameter "-a", it also runs each test
with a non-zero device-offset and device-scaling. The above commit influenced
the device-scaling results badly. E.g. some test results ended up with a black
border at the top-most and left-most row that looked like there was an offset of
"0.5" in drawing the image and thus pixels outside of the image were sampled.

This can be seen by the influence that this revert has on the results from
running CAIRO_TEST_TARGET=image ./cairo-test-suite -a:

Before: 31 Passed, 489 Failed [1 crashed, 8 expected], 31 Skipped
After: 225 Passed, 295 Failed [1 crashed, 8 expected], 31 Skipped

Most of the failures that disappeared are from the device-scaling tests.

With such disastrous results on the test suite, this cannot really be usable for
real-world applications.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-06-05 13:16:24 -07:00
jimmyfrasche
2d89cbb30e Add more info to cairo_surface_set_mime_data docs.
Explains how to use cairo_surface_set_mime_data so that the image always
gets used even if the MIME data cannot be.

Signed-off-by: jimmyfrasche <soapboxcicero@gmail.com>
2014-06-05 13:14:11 -07:00
Ravi Nanjundappa
ead5c7909f vg: Use EGL_NONE and GLX_NONE in place of None
Use EGL_NONE in EGL section and GLX_NONE in GLX section
instead of None in cairo-boilerplate-vg.c

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55805
2014-05-19 17:37:38 -07:00
Ravi Nanjundappa
d1453c512c test : Maintain consistency in the usage of xcalloc
xcalloc is a wrapper for calloc. If it can't allocate memory then it
terminates the program. The current changes replace the usages of calloc
by xcalloc in tests.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
2014-05-16 11:56:27 -07:00
Ravi Nanjundappa
69e10bc8b5 glx: Use GLX_NONE in place of None
Use "GLX_NONE" in rgb and rgba attributes instead of
"None" in cairo-boilerplate-glx.c

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-05-16 11:54:43 -07:00
Sylvestre Ledru
247cfaaa25 Fix some memory leaks found by scan-build, the LLVM/Clang static analyzer
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-05-16 11:11:34 -07:00
Sylvestre Ledru
5e7b724dd3 Remove some potential double free
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-05-16 11:11:30 -07:00
jimmyfrasche
85b05e84ac Pattern document clarification
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>
2014-05-12 10:19:33 -07:00
Ravi Nanjundappa
55608e4fd6 boilerplate: Maintain consistency in the usage of switch cases
Some of the switch cases used in boilerplate are not consistent
across other source files in the same module. This patch fixes the
consistency issues of switch case usage in the boilerplate module.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-05-06 10:22:43 -07:00
Bryce Harrington
18b3cce2f5 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-05-06 10:18:19 -07:00
Sylvestre Ledru
da9ef97372 Remove some useless declarations found by scan-build, the LLVM/clang static analyzer
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-05-06 10:14:53 -07:00
Ravi Nanjundappa
52b137bc3e test and util: maintain consistency in the usage of ARRAY_LENGTH macro
ARRAY_LENGTH macro is used in perf's cairo-perf.h, src's cairoint.h,
test's cairo-test.h and in some internal header files of util's
directory.So to maintain consistency ARRAY_SIZE is replaced with
ARRAY_LENGTH macro.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-04-30 13:01:35 -07:00
Ravi Nanjundappa
0e0004a971 perf: Refactor some macros to cairo-perf.h
This commit covers one of the left out modifications from
"commit cd11a4ff0421fd293279b202be800550890574bb" by Bryce.
It removes the duplicate macro definition in cairo-perf-diff-files.c
which by default includes the cairo-perf.h having MAX macro defnition.

Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
2014-04-22 09:51:45 -07:00
Bryce Harrington
2d95f803b1 NEWS: Add bug links and reword feature and bug descriptions 2014-04-18 12:33:45 -07:00
Bryce Harrington
cd11a4ff04 perf: Refactor some common macros to cairo-perf.h
These macros are standard in src's cairoint.h and test's cairo-test.h
internal header files, so for consistency do the same thing with perf's
cairo-perf.h.

Reviewed-by: Uli Schlachter <psychon@znc.in>
2014-04-18 10:09:10 -07:00
Uli Schlachter
3e22a8580a pthread-same-source: Refresh reference images
These reference images are generated by the new GENERATE_REFERENCE mode that the
previous commit introduced.

I have no idea what the "base" images. From my reading of the code in
boilerplate/, these images will be used by the test-XXX targets. However, these
seem to generate the same result than e.g. the image backend. Thus, I deleted
these files.

There is still pthread-same-source.quartz.xfail.png. This file was created in
commit b6e16b8d and touched in commit 5a1e590b1. No idea if this is still valid
and since I don't have a Mac, I won't touch it.

The test is still broken on the following backends (out of the backends I have
compiled in). This mostly seems to be differences in image scaling, but I
couldn't figure out an easy way to tell the test suite that the new results are
correct.

test-paginated, ps2, ps3, xcb, xcb-window, xcb-window&, xcb-fallback, xlib,
xlib-window, xlib-fallback, recording

Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-04-17 11:32:56 +02:00
Uli Schlachter
ddd344fb0f pthread-same-source: Add ref image generation
When the new GENERATE_REFERENCE symbol is defined to 1, no threads are involved
at all. In this case, all operations are done sequentially by the main thread.

Thus, in this mode no thread issues can occur and the result must be usable as
reference images.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
2014-04-17 11:32:49 +02:00
Bryce W. Harrington
457597e2dc NEWS: Summarize recent changes
This updates NEWS with items shown by `git log --stat 1.12.8..`
Hopefully I haven't misrepresented any of the work done.  For sake of
brevity where there were several changes in one area, I've given a
single general entry to summarize those changes.  The division between
features and bug fixes is quite rough.
2014-04-16 17:27:50 -07:00
Uli Schlachter
bb17403622 mesh-rasterize: Fix number of iterations
Commit 44a09f462c fixed a compiler warning, but changed the result of this code.
This is because the old 'for' loop did one more iteration than the new 'while'
loop. Fix this by incrementing the loop counter once before the loop.

Fixes: mesh-pattern mesh-pattern-accuracy mesh-pattern-conical
mesh-pattern-control-points mesh-pattern-fold mesh-pattern-overlap
mesh-pattern-transformed record-mesh

Signed-off-by: Uli Schlachter <psychon@znc.in>
Tested-by: Bryce Harrington <b.harrington@samsung.com>
2014-03-21 14:10:19 +01:00
Uli Schlachter
372c8c314a 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-03-21 14:09:37 +01:00
Uli Schlachter
bc05dbccd7 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-03-13 17:12:43 -07:00
Bryce Harrington
0c18991053 skia: Add section definitions and code docs for skia backend
This fixes several distcheck errors regarding missing code docs.

The skia backend was added in commit d7faec02, which was included in the
1.10 release.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-03-13 17:12:37 -07:00
Bryce Harrington
0eb686d545 Document that libglib2.0-doc is needed to avoid some xref warnings
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-03-13 15:13:52 -07:00
Bryce Harrington
8d0abb4a94 surface: Make parameter naming consistent between header and impl
This fixes this set of distcheck errors generating docs:

  src/cairo-surface.c:1668: warning: Parameter described in source code
  comment block but does not exist. FUNCTION:
  cairo_surface_set_device_scale Parameter: sx.

  src/cairo-surface.c:1668: warning: Parameter described in source code
  comment block but does not exist. FUNCTION:
  cairo_surface_set_device_scale Parameter: sy.

  src/cairo-surface.c:1668: warning: Parameter description for
  cairo_surface_set_device_scale::x_scale is missing in source code
  comment block.

  src/cairo-surface.c:1668: warning: Parameter description for
  cairo_surface_set_device_scale::y_scale is missing in source code
  comment block.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-03-13 15:13:34 -07:00
Bryce Harrington
4450af4f03 Mark recently added _cairo_output_stream_print_matrix private symbol
This fixes a distcheck error about a local PLT entry.

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-03-13 15:13:04 -07:00
Bryce Harrington
ae954ae3ea 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-03-13 15:12:58 -07:00
Bryce Harrington
f4a1a75078 doc: Add missing sections and symbols for public docs
This adds a number of items to the documentation for which code docs
exist, and also adds sections for cairo-skia and cairo-surface-observer.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48784

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
2014-03-13 15:12:50 -07:00