Commit graph

11355 commits

Author SHA1 Message Date
darxus@chaosreigns.com
66205ad48e Remove closed poppler bugs from test/README
These bugs have all been closed resolved / fixed for years.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-08-31 18:22:10 -07:00
Olivier Blin
35a1761776 Pull -lz for the script backend
It uses cairo_deflate_stream.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Behdad Esfahbod <behdad.esfahbod@gmail.com>
2016-08-31 14:35:12 -07:00
Hans Petter Jansson
1057487ce8 scaled-font: Fix deadlock when recursing in _cairo_scaled_font_reset_cache()
The destruction of a scaled font could indirectly trigger the destruction
of a second scaled font, causing the global cache to be locked twice in
the same thread.

This is solved by unlinking the font's glyph pages while holding the global
lock, then releasing the lock before destruction takes place.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93891
2016-08-02 14:21:45 -07:00
Uli Schlachter
3f8241f484 cairo-xcb: Remove a wrong optimisation
When doing a "complicated" mask operation, we draw the clip to a surface and use
this as a mask in later operations. The code assumes that this operation draws
to the whole target surface and thus a deferred clear may be skipped.

However, this requires that the extents of the trapezoids that will be drawn and
the extents of the surface are the same. This assumption is wrong, as can be
seen e.g. by the bug report that this commit fixes.

The fix is just not to skip the deferred clear.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=84330
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-21 18:58:58 +02:00
Adrian Johnson
56ad58a807 pdf: fix combined image/smask
a736fd8 introduced a regression
2016-07-19 22:42:53 +09:30
Adrian Johnson
d28b6d9b12 pattern: revert an unintentional change added in 190678f 2016-07-18 18:43:03 +09:30
Adrian Johnson
8a921e6c3e truetype: reverse cmap search should end when 0xffff- 0xffff range reached 2016-07-17 21:33:12 +09:30
Adrian Johnson
16a8c13b6a pdf: Don't fail subsetting if unable to convert utf8 to utf16
If the unicode came from the font, don't fail if utf8_to_utf16 fails.
2016-07-17 21:19:37 +09:30
Adrian Johnson
190678f644 pattern: don't round extents to 0 on vector surfaces
In this bug a Type 3 font contains a dash glyph. The dash glyph
consists of an 82x2 image. The image height, when scaled to user space,
is < 1 resuling in the drawing operation for the image being culled.

https://bugs.freedesktop.org/show_bug.cgi?id=94615
2016-07-16 15:42:23 +09:30
Adrian Johnson
1a380ef5f3 ps/pdf: remove debug and commented out code 2016-07-15 22:03:04 +09:30
Adrian Johnson
0e6f7deac1 ps: flush ASCII85Decode file after use
If the image operator does not read all the ASCII85 data, the PS
interpreter will try to execute the next byte of unread data.

Define our own image operator that calls flushfile (reads until end of
file) on the filter after drawing the image.

https://bugs.freedesktop.org/show_bug.cgi?id=84811
2016-07-15 16:32:53 +09:30
Adrian Johnson
b73c082c7f truetype: Don't write glyph if num_contours == 0
According to the Opentype spec, num_contours in a glyf table entry can
be > 0 (single glyph) or < 0 (composite glyph).  num_contours == 0 is
undefined.

The embedded font in the test case for this bug contained a space
glyph with num_contours == 0. This was failing on some printers.
According to the spec, glyphs with no outlines such as space are
required to have a 0 size entry in the loca table.

https://bugs.freedesktop.org/show_bug.cgi?id=79897
2016-07-09 18:31:55 +09:30
Bryce Harrington
38fdcc30a3 cairo-misc: Whitespace cleanup 2016-07-06 15:46:00 -07:00
Adrian Johnson
deb994488f test: refresh text-rotate ref images 2016-07-05 20:26:47 +09:30
Adrian Johnson
bb4595130b ft: set font size to em size when retrieving unhinted metrics
fixes text-unhinted-metrics test
2016-07-05 20:26:47 +09:30
Adrian Johnson
d92015e4f9 add test text-unhinted-metrics
Based on bug report in https://lists.cairographics.org/archives/cairo/2016-April/027334.html
2016-07-05 20:26:47 +09:30
Adrian Johnson
1ada65c34f pdf: remove unused variable 2016-07-03 10:39:08 +09:30
Adrian Johnson
c2dc5aa684 recording: Remove unused function 2016-07-03 10:38:46 +09:30
Enrico Weigelt, metux IT consult
97d8b2b7de qt: replaced calls to _cairo_clip_init_copy() by _cairo_clip_copy()
_cairo_clip_init_copy() was removed with commit b132fae5e8,
but a few calls were still remaining.

Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-02 13:38:25 +02:00
Enrico Weigelt, metux IT consult
f212db2fcc core: fixed code duplication
We have two places where copying from box set to clip is
implemented in the same way. Just move that to one function.

Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-02 13:35:38 +02:00
Enrico Weigelt, metux IT consult
5bb43c92b3 core: dropped actually unused parameter of _cairo_boxes_to_array()
When parameter force_allocation is false *and* the box set has
exactly one chunk, this chunk is returned directly - w/o copying it.

That mode is never used, and it's highly problematic as it's unclear
whether we have to free the returnd object or it's still owned
by somebody else.

Just dropping the useless parameter / corner case to make the function
simpler and more robust.

Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-02 13:35:38 +02:00
Enrico Weigelt, metux IT consult
b23c2291d8 core: helper inline for rect->box conversion
Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-02 13:35:34 +02:00
Enrico Weigelt, metux IT consult
ae403448af core: fix compiler warnings
The code correct, but the compiler can't check that and thinks
there're uninitialized variables.

Perhaps we could rewrite it in a better way, so the compiler
can do better (even arch specific) optimizations.

Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-07-02 13:27:11 +02:00
Adrian Johnson
1272db90f8 win32: gcc 5.4 build fix 2016-06-21 19:44:48 +09:30
Adrian Johnson
90d50cd923 win32-print: fix unbounded surface assertion
https://lists.cairographics.org/archives/cairo/2016-June/027445.html
2016-06-19 19:52:32 +09:30
Uli Schlachter
d69dd6b341 xlib: Fix double free in _get_image_surface()
If XShmGetImage() fails, the code tries to continue with its normal,
non-shared-memory path. However, the image variable, which was previously set to
NULL, now points to an already-destroyed surface, causing a double-free when the
function cleans up after itself (actually, its an assertion failure because the
reference count of the surface is zero, but technically this is still a double
free).

Fix this by setting image=NULL after destroying the surface that this refers to,
to make sure this surface will not be destroyed again.

While we are here (multiple changes in a single commit are bad...), also fix the
cleanup done in bail. In practice, &image->base should be safe when image==NULL,
because this just adds some offset to the pointer (the offset here is actually
zero, so this doesn't do anything at all). However, the C standard does not
require this to be safe, so let's handle this case specially.

Note that anything that is fixed by this change is still buggy, because the only
reason why XShmGetImage() could fail would be BadDrawable, meaning that the
target we draw to does not exist or was already destroyed. This patch will
likely just cause X11 errors elsewhere and drawing to (possible) invalid
drawables is not supported by cairo anyway. This means that if SHM fails, the
following fallback code has a high chance of failing, too.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91967
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-06-19 11:34:35 +02:00
Adrian Johnson
eb808aa625 image: only cache analyzed transparency/color for snapshot surfaces
https://lists.cairographics.org/archives/cairo/2016-June/027429.html
2016-06-19 14:08:55 +09:30
Adrian Johnson
113ba5f3fa Update ref images
ref images were creating using Debian Jessie 64-bit and latest poppler.
2016-06-05 20:43:36 +09:30
Adrian Johnson
1c5ec6e380 Fix PS record-neg-extents test failure 2016-06-05 20:43:36 +09:30
Adrian Johnson
a14d319e43 ps: change from ps coordinates to cairo coordinates 2016-06-05 20:43:36 +09:30
Adrian Johnson
14fa88fd02 pdf: fix record-replay-extend test failures 2016-06-05 20:43:36 +09:30
Adrian Johnson
e7b1cb0c53 image: fix record-replay-extend test failures 2016-06-05 20:43:36 +09:30
Adrian Johnson
8e4d4de2a3 test: replay record surface with negative extents for each extend mode
image fails for repeat, reflect, and pad.
2016-06-05 20:43:36 +09:30
Adrian Johnson
a736fd8699 Fix PDF record-neg-extents test failure
Modify PDF surface to allow surface extents to have negative x, y.
When emitting recording surfaces, set the surface extents to the
recording extents.
2016-06-05 20:43:36 +09:30
Adrian Johnson
1e07ced66d pdf: change from pdf coordinates to cairo coordinates
When an unbounded recording surface is used multiple times with
different extents for each operation we need the XObject containing
the recording surface to have the same origin for each operation. This
is not possible when the recording surface is converted to PDF
coordinates because each operation has different extents resulting in
a different origin when the Y-axis is flipped (since the flip matrix
depends on the recording surface height which for unbounded surfaces
depends on the extents of the operation that paints the recording
surface).

Switching to cairo coordinates by emitting a Y-axis flip matrix as the
first object of each page allows the recording surface to be emitted
in cairo coordinates. This results in the same origin for all
operations using the recording surface XObject.
2016-06-05 20:43:36 +09:30
Adrian Johnson
d2dc2e90a7 Fix test failures when recording surface extents has negative x,y
Fixes record-neg-bounded-extents (image only) and
recording-ink-extents.
2016-06-05 20:43:36 +09:30
Adrian Johnson
58df191946 Add recording-ink-extents test
bounded_fill fails returning extents origin of (0, 0) instead of (-150, -100)
2016-06-05 20:43:36 +09:30
Adrian Johnson
9fff6f0be3 test: add record-neg-extents
Test case for bug 89232 - painting a recording surface to a
pdf/ps surface omits objects on the recording surface with negative
coordinates even though the pattern matrix has transformed the objects
to within the page extents.

The image surface also fails when the recording surface is bounded.
2016-06-05 20:43:36 +09:30
Adrian Johnson
00a36e4652 svg2png: fix deprecated warning
rsvg_pixbuf_from_file() is deprecated, replaced by
rsvg_handle_new_from_file() + rsvg_handle_render_cairo().
2016-04-16 18:05:41 +09:30
Adrian Johnson
11667ec47c pdf2png: fix deprecated warning 2016-04-16 17:42:56 +09:30
Guillaume Ayoub
d2f1ebf579 Use surface_transform in replay_and_create_regions
The surface_transform was already used surface_replay_with_clip, as the
matrix is obviously needed for the clip. But now, because of the
optimization done in commit 09b42c7, it's also needed by
replay_and_create_regions: get_target_extents clips the target surface
for performance issues, and therefore needs the surface_transform matrix
to get the right clipping surface.

Signed-off-by: Guillaume Ayoub <guillaume.ayoub@kozea.fr>
2016-04-12 06:58:28 +09:30
Adrian Johnson
747cab741c Add CAIRO_STATUS_WIN32_GDI_ERROR for GDI errors 2016-03-26 22:18:05 +10:30
Adrian Johnson
cdd5c92ced Add CAIRO_STATUS_FREETYPE_ERROR for errors returned by libfreetype 2016-03-26 21:45:59 +10:30
Adrian Johnson
8f6790123e Adding missing error status to utils 2016-03-26 19:06:03 +10:30
Adrian Johnson
c5ee3f11b5 Add CAIRO_STATUS_PNG_ERROR for errors returned by libpng 2016-03-26 19:04:44 +10:30
Adrian Johnson
72c9a022ac scaled-font: don't store pointer in hash value 2016-03-10 19:00:48 +10:30
Wan-Teh Chang
3538ac3e68 Fix data race in freed_pool
This adds _cairo_atomic_int_get_relaxed and _cairo_atomic_int_set_relaxed which
are meant to have a behaviour of relaxed read/writes in C11's memory model. This
patch also uses these new function to fix a data race with freed_pool_t's |top|
data member.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90318
Signed-off-by: Wan-Teh Chang <wtc@google.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2016-03-05 14:35:17 +01:00
Enrico Weigelt, metux IT consult
af42fc724e drm: fix importing of libdrm
We need to link against libdrm to use its functions.

Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-01-15 12:29:06 -08:00
Enrico Weigelt, metux IT consult
968f8c70aa core: some in-code documentation
Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
2016-01-13 17:14:51 -08:00
Enrico Weigelt, metux IT consult
047ba66519 core: dropped unnecessary local variable in _cairo_composite_rectangles_intersect()
Signed-off-by: Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-01-13 17:09:28 -08:00