Commit graph

11211 commits

Author SHA1 Message Date
江頭幸路
040ae0ce19 Avoid appending an empty slot to an user data array when user_data is NULL.
Otherwise, calling cairo_set_user_data(cr, key, 0, 0) many times
causes a long user data array, almost all of whose slots are empty.
It leads to unnecessarily much memory consumption and long execution time of
cairo_set_user_data(cr, key, 0, 0) and cairo_get_user_data(cr, key) after
it.

This issue probably happens since the commit
http://cgit.freedesktop.org/cairo/commit/?id=9341c254a

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-04-20 17:16:18 -07:00
Andrea Canciani
89942c6af0 test: Correct bug number in clip-complex-bug61592
The filename of the C source file is correct, but the test name (both
as function name and as reference image name) has a typo in it.

Related to https://bugs.freedesktop.org/show_bug.cgi?id=61592
2015-04-16 11:28:50 +02:00
Руслан Ижбулатов
e38e942ac0 win32: Add a win32 boilerplate that uses a real window
This way it uses the codepath for cairo_win32_surface_create_with_format(),
instead of the cairo_win32_surface_create_with_dib().

Without the recording tests (which terminate the testsuite)
the testsuite results for win32 are:

284 Passed, 167 Failed [1 crashed, 9 expected], 23 Skipped
win32 (rgb24): 1 crashed!
win32 (rgb24): 17 error
win32 (rgb24): 155 failed
win32 (argb32): 1 crashed!
win32 (argb32): 17 error
win32 (argb32): 68 failed
win32-window-color (rgb24): 1 crashed!
win32-window-color (rgb24): 17 error
win32-window-color (rgb24): 148 failed
win32-window-coloralpha (argb32): 1 crashed!
win32-window-coloralpha (argb32): 17 error
win32-window-coloralpha (argb32): 66 failed

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-04-13 17:43:35 -07:00
Руслан Ижбулатов
16898ba11b win32: Add cairo API to set up a Win32 surface for an HDC with an alpha channel.
Signed-off-by: Руслан Ижбулатов <lrn1986@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-04-13 17:43:28 -07:00
Andrea Canciani
654b4a8efe test: Fix coverage-intersecting-triangles reference
Commit 4e3ef57bc8 added
coverage-intersecting-triangles with an incorrect reference and
generator. The test checks the rasterization of two overlapping
triangles in the following position:

   .   .
   |\ /|
   | X |
   |/ \|
   .---.

Since the triangles have both vertical and horizontal sides of size
x/WIDTH, the expected coverage is 3/4 (75%) of (x/WIDTH)^2. The
original code, instead, was checking for a coverage of 0.75*x/WIDTH,
as if one of the sides was always 1 unit long.

The image and xlib backends still suffer from some jitter, caused by
the approximation of the actual coverage by means of sampling. For
this reason their references are still considered XFAIL, even though
their result now looks mostly consistent with the expected reference.
2015-04-08 14:32:17 +02:00
Bryce Harrington
2cf2d8e340 Fix spellings descibed, indicies, stange 2015-04-04 15:49:18 -07:00
Bryce Harrington
7139265380 NEWS: Sp. fix 2015-03-18 18:46:35 -07:00
Bryce Harrington
904f1fdc1d surface: Clarify flush documentation 2015-03-18 15:49:41 -07:00
Andrea Canciani
b19b06c463 Harden make-cairo-test-constructors.sh
The make-cairo-test-constructors.sh script executes several commands
without checking their success. This can lead to undetected errors,
like those fixed in 86fad78fcd.

The script now exits with an error status if no file is
input. Moreover, it sets the '-e' flag, so that if a command fails,
the whole script is immediately terminated with an error.

In the Makefile.am, the script result is now checked and the target
file is removed upon error. This ensures that the
'cairo-test-constructors.c' target completes succesfully only if no
error occurred.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-13 13:18:32 -07:00
Bryce Harrington
ec0153940d Start 1.14.3 development 2015-03-13 13:18:32 -07:00
Adrian Johnson
5182d9bc5e doc: add index of new symbols in 1.14 2015-03-11 19:16:38 +10:30
Bryce Harrington
db6668cd0a RELEASING: Update contacts
Add a CC to the cairo@ list itself.

Drop updating of the GNOME dependencies page; this appears to have not
been updated since 2008.
2015-03-10 19:57:19 -07:00
Bryce Harrington
93422b3cb5 version: bump for cairo-1.14.2 release 2015-03-10 18:42:50 -07:00
Bryce Harrington
061d54745a KNOWN_ISSUES: Restore known issues file as a stub
Apparently distcheck requires this file be present.
2015-03-10 16:24:37 -07:00
Bryce Harrington
fb41ed3441 NEWS: Note about the OS X support 2015-03-10 13:08:29 -07:00
Andrea Canciani
845d2420e0 Update README with new minimum MacOSX requirements
Since 70cc8f250b the quartz backend is
using some APIs that are not available on MacOSX 10.4 directly
(i.e. without detecting their availability through dynamic linking).
This means that the quartz backend does not work anymore on MacOSX
10.4 and that the 10.5 SDK (or newer) is needed to build.
2015-03-10 12:42:16 -07:00
Bryce Harrington
86fad78fcd On MacOSX, the sed utility errors out when parsing non-UTF8
files. Because of this, the generated cairo-test-constructor only
contained a few tests and the test suite was thus incomplete.

Original patch by Andrea Canciani <ranma42@gmail.com>
2015-03-10 12:15:40 -07:00
Andrea Canciani
f840733221 Update KNOWN_ISSUES documentation
The bug mentioned in KNOWN_ISSUES was fixed in
2b3d8de11a, but the documentation was
not updated. Moreover, the header of KNOWN_ISSUES was 1.10-specific.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-10 10:56:00 -07:00
Bryce Harrington
c45e323555 NEWS: Finish filling in changes 2015-03-10 10:55:55 -07:00
Bryce Harrington
79dbe1bad8 NEWS: Update for changes through Nov 2014 2015-03-07 00:30:40 -08:00
Bryce Harrington
581f813705 HACKING: Add link to git tutorial and wordsmith a bit 2015-03-06 23:54:49 -08:00
Bryce Harrington
c0458b4560 csi-trace: Add --version and --help args to utility 2015-03-06 23:35:34 -08:00
Bryce Harrington
3a7d411539 Revert "xlib: Remove queued event from _XReadEvents"
This reverts commit e7fc8f405b.
2015-03-06 23:35:34 -08:00
Bryce Harrington
c3605bd3ad git-ignore: Add build's test-driver 2015-03-06 23:29:53 -08:00
Bryce Harrington
246d5c1d47 doc: Drop extraneous para's
These may have been required in the past, but just trip up distcheck
today.  The generated docs still look fine.
2015-03-06 19:19:13 -08:00
Bryce Harrington
e4f6d07efb gitignore: logs, manuals 2015-03-06 18:34:07 -08:00
Henry (Yu) Song
e7fc8f405b xlib: Remove queued event from _XReadEvents
Following patch fixes a memory leak in xlib surface.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-05 17:27:14 -08:00
Michael Haubenwallner
4e680ff4bb headers: fix include order for AIX, bug#89354
also for cairo-xcb-private.h
2015-03-05 17:03:32 -08:00
Michael Haubenwallner
733de40e87 headers: fix include order for AIX, bug#89354 2015-03-05 17:03:28 -08:00
Michael Haubenwallner
94d30d7160 perf: fix include order for AIX, bug#89354 2015-03-05 17:03:18 -08:00
Michael Haubenwallner
15c427bc77 perf/micro: fix include order for AIX, bug#89354 2015-03-05 17:02:23 -08:00
Michael Haubenwallner
0916d580db test: fix include order for AIX, bug#89354 2015-03-05 17:02:14 -08:00
Michael Haubenwallner
e9a615a2f9 define _GETDELIM for getline() on AIX
On AIX 6.1, getdelim() and getline() are not provided by default,
causing a gcc compilation error.  With _GETDELIM defined, AIX's stdio.h
header provides definitions for these routines.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89356
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-05 16:57:09 -08:00
Michael Haubenwallner
f72bd7c757 skip MAP_NORESERVE when unsupported
Fixes a compilation on AIX ('MAP_NORESERVE' undeclared)

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89340
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-03-05 14:48:28 -08:00
Michael Haubenwallner
ac75ab9f30 fix conflicting types for 'sync' on AIX, bug#89338 2015-03-05 12:00:48 -08:00
Andrea Canciani
70cc8f250b quartz: Remove call to obsolete CGFontGetGlyphPath
CGFontGetGlyphPath was not public and is not available anymore on
modern OSX/iOS systems. The same functionality is available through
the CoreText API since OSX 10.5.

Based on a patch by Simon Cozens.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=84324
2015-02-05 15:13:46 +01:00
Massimo Valentini
91f128bf7a win32: Fix crash from win32 surface's image size too small
Beginning in 1.12, a crash can occur when the win32 surface's image size
does not cover the entire surface (e.g. due to clipping regions).

This patch enlarges the fallback surface created of the amount
necessary not to write past the end of the DIB. It assumes that
Clip applied to an HDC are clamped to (0,0,width,height) of the HDC.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53121
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-02-02 16:33:06 -08:00
Emanuele Aina
cca8b1960b cairo-trace: Fix duplicated surface push on similar-image
The current code results in trace lines with the source surface being
pushed on the stack two times instead of one:

s1 s1 //ARGB32 48 48 similar-image % s2

Instead of:

s1 //ARGB32 48 48 similar-image % s2

This greatly confuses later commands when the script was replayed,
causing traces for trivial GTK3 programs to be unplayable, usually
yielding the following error:
"invalid value (typically too big) for the size of the input (surface, pattern, etc.)"

Drop the duplicated entry from the trace line printed by the
cairo_surface_create_similar_image() override.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73580
Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
2015-01-20 18:14:52 +01:00
Uli Schlachter
ebd23accc8 xlib-xcb: Don't be lazy and use the real xcb_screen_t
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-17 20:12:39 +01:00
Uli Schlachter
b47209a03f xcb: Query the display's subpixel order via RENDER
With commit e691d242, the xcb backend started parsing the resources, just like
cairo-xlib does. One behavior from cairo-xlib was missing: If no Xft.rgba
property was specified, cairo-xlib defaults to the screen's subpixel order.
This commit brings that last bit of functionality to cairo-xcb (but currently
disabled due to commit e0c0a673).

This commits adds a new array to cairo_xcb_connection_t that contains the
subpixel order for each screen. There is also a new member in cairo_xcb_screen_t
which contains the subpixel order of that screen and which is initialized from
the array when the screen is constructed. With this in place, the
resource-parsing code can just pick the subpixel order from the screen if
needed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-01-17 20:11:59 +01:00
Andrea Canciani
02e4efc961 font: Actually perform destruction of fonts
Commit 337ab1f8d9 introduced delayed
font destruction to overcome a race, but prevented the correct cleanup
of the font cache.

This caused fonts to stay in the cache and caused a crash in the
api-special-cases (when running the test suite with -f).

Fixes api-special-cases,
https://bugs.freedesktop.org/show_bug.cgi?id=87567
2015-01-03 14:59:51 +01:00
Chris Wilson
028d286e61 xlib: Bump reference count for recording surface replays
The snapshot takes a reference to the target recording surface in order
to enable it for use by multiple treads. In order to balance this, the
other two sources of recording surface must also take a reference and
for us to release that reference after the replay.

Otherwise, we end up with a memory leak:

==1== 1,392 bytes in 3 blocks are definitely lost in loss record 1 of 7
==1==    at 0x4A06BCF: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==1==    by 0x4C7042D: _cairo_recording_surface_snapshot (cairo/src/cairo-recording-surface.c:1427)
==1==    by 0x4C842BE: _cairo_surface_snapshot_copy_on_write (cairo/src/cairo-surface-snapshot.c:189)
==1==    by 0x4C7E7E0: _cairo_surface_detach_snapshot (cairo/src/cairo-surface.c:348)
==1==    by 0x4C7E55B: _cairo_surface_detach_snapshots (cairo/src/cairo-surface.c:333)
==1==    by 0x4C7E55B: _cairo_surface_flush (cairo/src/cairo-surface.c:1545)
==1==    by 0x4C7E6CC: _cairo_surface_finish_snapshots (cairo/src/cairo-surface.c:1017)
==1==    by 0x4C7E6CC: cairo_surface_destroy (cairo/src/cairo-surface.c:961)
==1==    by 0x4C625A7: cairo_pattern_destroy (cairo/src/cairo-pattern.c:1131)
==1==    by 0x4C3FAC6: _cairo_gstate_fini (cairo/src/cairo-gstate.c:225)
==1==    by 0x4C3C68C: _cairo_default_context_fini (cairo/src/cairo-default-context.c:75)
==1==    by 0x4C3C708: _cairo_default_context_destroy (cairo/src/cairo-default-context.c:93)
==1==    by 0x43E576: record_get (cairo/test/record-extend.c:158)
==1==    by 0x43E576: record_replay (cairo/test/record-extend.c:173)
==1==    by 0x40E22D: cairo_test_for_target (cairo/test/cairo-test.c:929)
==1==    by 0x40E22D: _cairo_test_context_run_for_target (cairo/test/cairo-test.c:1532)
==1==    by 0x40B6C0: _cairo_test_runner_draw (cairo/test/cairo-test-runner.c:255)
==1==    by 0x40B6C0: main (cairo/test/cairo-test-runner.c:937)

Reported-by: Massimo Valentini <mvalentini@src.gnome.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87898
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-31 11:01:45 +00:00
Andrea Canciani
4a225fca5f test: Free test list
When running the cairo-test-suite, valgrind reports each of the
registered test as a leak, because they are _list_prepend()'ed, but
the tests list is never _list_free()'d.

Fixes the following valgrind error:

malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
cairo_boilerplate_xmalloc (cairo-boilerplate-system.c:47)
cairo_test_register (cairo-test-runner.c:131)
_cairo_test_runner_register_tests (cairo-test-constructors.c:1112)
main (cairo-test-runner.c:714)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-12-06 17:38:02 -08:00
Andrea Canciani
9806f437b4 test: Release owned pattern
The pattern created by cairo_pattern_create_rgb() is owned by the
caller, hence it needs to be released.

Fixes the following valgrind error:

malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
_cairo_pattern_create_solid (cairo-pattern.c:605)
_cairo_pattern_create_in_error (cairo-pattern.c:628)
cairo_pop_group (cairo.c:552)
test_cairo_push_group (api-special-cases.c:157)
preamble (api-special-cases.c:1766)
main (cairo-test-runner.c:228)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-12-06 17:38:02 -08:00
Uli Schlachter
40201f4b1a tor-scan-converter: Correctly align 64bit types
On 32bit SPARC the scan converter was causing a SIGBUS due to an unaligned
memory access while accessing an int64_t. This memory accessing was to struct
quorem's rem member.

This crash occurred because the tor-scan-converter contains its own
implementation of a memory pool. This implementation only guarantees an
alignment of sizeof(void *), which is less than what a 64 bit type requires on
32bit platforms. This 4 byte alignment is guaranteed, because struct _pool_chunk
(which is the struct that is used for managing free space) contains elements of
that size and so the size of that struct is a multiple of this size as well.

This problem was introduced with commit 03c3d4b7c1.

To fix this problem, this commit introduces a int64_t member to struct
_pool_chunk that marks the beginning of the free data space. Thanks to this, the
compiler ensures proper alignment and sizeof(struct _pool_chunk) becomes a
multiple of 8.

However, previously the end of the struct marked the beginning of the data and
sizeof() was used for correctly calculating offsets to the data section. So,
just adding such a member would work, but would also waste some memory. To avoid
this, this commit also changes the rest of the pool implementation to
accommodate.

Reported-by: Nicolas Setton <setton@adacore.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2014-12-06 10:25:30 +01:00
Bryce Harrington
5c82d91a5e image: Fix crash in _fill_xrgb32_lerp_opaque_spans
If a span length is negative don't go out of bounds processing the fill
data.

Patch thanks to Ilya Sakhnenko <ilia.softway@gmail.com> on mailing list.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2014-12-05 19:16:43 -08:00
Hans Breuer
56da7adc3c win32: Fix compilation of 'cairo-path-stroke-traps.c' with MSVC8
"The issue here is that Visual Studio 2005+ is quite strict on type
conversions (so it wants code to be clear enough on conversions)."

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=84908
2014-11-20 12:26:52 -08:00
Bryce Harrington
2c5af590dd Refactor ARRAY_LENGTH macro definitions in test code 2014-11-20 12:22:06 -08:00
Bryce Harrington
7edc5a8844 test: Use ARRAY_LENGTH macro 2014-11-20 12:22:06 -08:00
Adrian Johnson
ae608035c7 pdf-operators: fix bug with RTL text
bug 86461
2014-11-20 10:16:06 +10:30