Commit graph

11238 commits

Author SHA1 Message Date
Bryce Harrington
776dd20c84 configure: Fix typo for missing line continuation character
There is an unintentional (benign) missing line continuation "\" in the
definition of MAYBE_WARN in configure.  configure completes and issues a
WARNING:

configure: WARNING: cache variable cairo_cv_warn_maybe contains a
newline

Found and solved by Larry Baker.

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=89750
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-27 00:44:29 -07:00
Bryce Harrington
3129161162 RELEASING: Add requirement to upload ChangeLogs
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=21676
2015-06-27 00:34:05 -07:00
Bryce Harrington
bf4f5f3a90 cairo-script: Return a cairo_status_t error, not FALSE
This typo results in certain paths being incorrectly recorded with
script surfaces.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91054
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-26 16:30:06 -07:00
John Lindgren
bb24f165ff Avoid indiscriminate use of VALGRIND_MAKE_MEM_NOACCESS.
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>
2015-06-26 16:12:33 -07:00
Bryce Harrington
1bcce43629 cairo-recording-surface: Fix loss of alpha when clipping
Commit 8020e0bc introduced a regression due to a typo when copying a
mask for a cairo recording surface.  It should copy the source and mask
members from the command source to the recording surface, but instead it
copies the source twice.

Fix suggested by Massimo.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73038
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=73901
2015-06-25 18:54:23 -07:00
Bryce Harrington
c1c3028a0c cairo-script: Fix sp. "directoriy"
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-25 17:42:27 -07:00
Uli Schlachter
f82ae573fe XCB: Don't attach uploaded surfaces as snapshots
When you draw (part of) a surface to an XCB surface, the XCB backend will safe
the uploaded part as a snapshot to the input surface. This allows to re-use this
picture in case the same surface is later used again as a source.

However, other backends do not do this and this has caused and/or highlighted
numerous bugs. Just skipping the snapshot fixes or hides these bugs.

Papers-over: https://bugs.freedesktop.org/show_bug.cgi?id=67505
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-06-20 10:59:52 +02:00
Alban Browaeys
e7acf4b6dc pattern: allow for a floating one pixel rounded difference.
That is if the difference between the origin and the end is bigger than
.5 round up regardless of the coordinates.

Round the difference of the floats instead of rounding the floats then
diff them.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=84396

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-18 16:07:40 -07:00
Bryce Harrington
b4a922f62d cairo-script: Rename struct member to avoid name collision on AIX
On AIX, the token jmpbuf is a pre-processor macro.
cairo-script-scanner.c includes a private struct with a member named
jmpbuf which gets renamed to __jmpbuf when AIX's sys/context.h has been
included.

While judicious ordering of includes might kludge around this problem
(by causing all references to .jmpbuf to become .__jmpbuf), it's better
to simply select a new name for the struct member that won't suffer the
collision.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=89339

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-18 12:38:59 -07:00
Bryce Harrington
714a77e3f1 cairo-script: Prefer cairo from local tree
Use quoted includes rather than bracketed, to prefer linking to the
in-tree cairo in preference to the system cairo.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-18 12:38:55 -07:00
Bryce Harrington
3ed581149f cairo-script: Cleanup boilerplate header for consistency
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-18 12:38:51 -07:00
Bryce Harrington
d31e2418d6 cairo-script: Add missing copyright and boilerplate
Chris wrote all of the cairo script stuff.  I'm making a guess about the
copyright date.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-18 12:38:47 -07:00
Bryce Harrington
a3b6afabf6 cairo-script: Always include config.h first thing
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-18 12:38:43 -07:00
Fredrik Fornwall
11b6c49c10 Fix cairo_get_locale_decimal_point() on Android 2015-06-05 20:53:11 -07:00
Massimo Valentini
1ed318ce13 polygon-intersection: Delete misleading comments and dead-code
den_det is positive because intersect_lines is called
only after _slope_compare returned > 0 and slope_compare
is returning the sign of den_det

The quadratic-time intersection finder is #if 0-ed out
in src/cairo-bentley-ottman.c, but is unusable even there
since the second commit to that file.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74779
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-04 15:02:01 -07:00
Massimo Valentini
63f59ea896 polygon-intersection: Try not to invoke undefined behaviour
Optimizing compilers aggressively remove code that is executed only
after an undefined behaviour occurred.

Also, the difference of two (non char) pointers hides an integer
division that, because the divisor is known at compile time, is
transformed into a multiplication by a pseudo-reciprocal, and in this
case the difference is not always a multiple of the divisor, resulting
in an invalid comparison predicate.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74779
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-04 15:01:57 -07:00
Massimo Valentini
a3c022bb98 polygon-intersection: Include approximation in intersection points
In Hobby's paper it is proved that INTERSECTION events can be
processed in any order by ignoring intersections between edges
non-adjacent in the active edges list.
But with respect to START/STOP events they must be processed in
order. Because START/STOP events have always exact y, it is
sufficient to know whether an integer y intersection is a
default/excess approximation of the exact to properly sort events.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74779
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-04 15:01:35 -07:00
Massimo Valentini
9f2bbfa41f polygon-intersection: Do not discard intersection exactly at top edge
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74779
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-04 15:00:58 -07:00
Bryce Harrington
b9ada81995 cairo-script: Improve buffer length check
Quells the following warning:

cairo-script-scanner.c: In function ‘_translate_string’:
cairo-script-scanner.c:1623:18: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
      if (buf_len <= 8 + 2*string->len) {
                  ^
2015-06-04 14:24:31 -07:00
Julien Isorce
f032133e6d build: Show all disabled features in cairo-features.h
Even features which are disabled by default should appear in
cairo-features.h.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83359
(Patch approved by Behdad Esfahbod in bug tracker.)

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-06-04 14:12:12 -07:00
Nathan Froyd
5d150ee111 Support new-style __atomic_* primitives
Recent versions of GCC/clang feature a new set of compiler intrinsics
for performing atomic operations, motivated by the operations needed to
support the C++11 memory model.  These intrinsics are more flexible than
the old __sync_* intrinstics and offer efficient support for atomic load
and store operations.

Having the load appear atomic to the compiler is particular important
for tools like ThreadSanitizer so they don't report false positives on
memory operations that we intend to be atomic.

Patch from Nathan Froyd <froydnj@mozilla.com>
2015-06-04 13:25:23 -07:00
Adrian Johnson
d1dda5eeb2 cff: ensure glyph widths are positive when font matrix yy is negative
Bug 90538
2015-05-21 22:40:01 +09:30
Zan Dobersek
f52f0e2feb Manually transpose the matrix in _cairo_gl_shader_bind_matrix()
To maintain compatibility with OpenGL ES 2.0, the matrix in
_cairo_gl_shader_bind_matrix() should be manually transposed,
and GL_FALSE passed as the transpose argument to the
glUniformMatrix3fv() call as it is the only valid value for
that parameter in OpenGL ES 2.0.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: "Henry (Yu) Song" <henry.song@samsung.com>
2015-05-18 15:03:29 -07:00
Bryce Harrington
8b798c320f Fix broken canvas text font size in Inkscape
An earlier fix to bug 84324 added a regression in the font size of
canvas text in Inkscape when compiled with the Quartz backend.

Patch from Andrea Canciani

Fixes:  https://bugs.freedesktop.org/show_bug.cgi?id=84324
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-04-24 18:23:46 -07:00
Behdad Esfahbod
d5ffe67008 Remove debug printf; ouch! 2015-04-23 14:26:14 -07:00
Behdad Esfahbod
853e822c9c Oops, fixup previous commit 2015-04-21 14:31:53 -07:00
Behdad Esfahbod
bb01fd8794 [ft] Return CAIRO_STATUS_FILE_NOT_FOUND if font file can't be opened
A common source of error when people are setting up pango on a new
device is when font files don't have the right permissions and cannot
be opened.  Cairo was returning out-of-memory before, making the
Pango error message useless.

With this change, cairo will return file-not-found, and pango prints
that out.  It's still not ideal; a ENOACCESS equivalent would have
been better.
2015-04-21 14:29:41 -07:00
江頭幸路
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