Commit graph

10662 commits

Author SHA1 Message Date
Adrian Johnson
cf07bd866d type1-subset: remove unused variable 2012-11-03 11:08:01 +10:30
Adrian Johnson
9f537156ad type1-subset: fix memory leak 2012-11-03 11:07:02 +10:30
Chris Wilson
724c6dfa95 xlib/shm: Need IncludeInferiors when creating the source fallback
Reported-by: Benjamin Otte <otte@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 17:01:07 +00:00
Chris Wilson
1f4d05b55c stroke: Fix calling '_cairo_spline_intersect' for in-bounds checking of splines
Fixes stroke-clipped, within reason. There still remains some
antialiasing noise (between rendering the circle piecewise and wholly)
worth investigating - but that is probably an artefact of switching
between analytical rendering modes in the scanline
rasterisation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 14:53:18 +00:00
Chris Wilson
2dd4ff3206 test: Add stroke-clipped
Exercise a bug in the determine of clip-bounds when stroking, as
reported by ed44.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-02 14:48:40 +00:00
Chris Wilson
e9d4570584 pen: Tighten checking for bevel (start==stop) joins
From commit d7f5a1bec4
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Oct 31 09:27:52 2012 +0000

    pen: First check whether the in/out edges lie within the single pen vertex

makes a couple of tests much happier.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 11:42:46 +00:00
Chris Wilson
90860241bb gl: Tune the default VBO size to reduce overhead on embedded devices
Henry Song found that the 256k buffers were disadvantageous on his
embedded hardware. As there is no obvious right value for the default
VBO size, we can tune for the more obvious constraints.

Based on a patch by Henry Song <henry.song@samsung.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 09:47:00 +00:00
Chris Wilson
0c1ff1572f xlib: Fixup standalone header compilation for 'make check'
Missing include of string.h

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:45:37 +00:00
Chris Wilson
b6daf47fa0 spans: Do not assume that we manage to perform the clip geometrically
Even for bounded masks, we may fail to perform the clipping
geometrically for a variety of reasons, the prime one being that the
clip has a mixture of antialias settings. So when compositing the
polygon, we need to check whether a clip path still remains and so
requires a clipmask.

Fixes regression from

commit cd1004ce19
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri May 11 21:20:35 2012 +0100

    traps,spans-compositor: Avoid mistreating unaligned clips as aligned

and

commit 4ea3ace6c8
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri May 11 21:51:44 2012 +0100

    spans: Only fallback for a clipmask if unbounded

Reported-by: Dominik Röttsches <dominik.rottsches@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56574
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:43:26 +00:00
Chris Wilson
5844dead01 util/show-polygon: Show the limited range of each edge
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:37:58 +00:00
Chris Wilson
03adea2f50 stroke: Precompute the line half-width
As we regularly recompute stroke->line_width/2 we may as compute it once
during initialisation.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-11-01 08:37:01 +00:00
Chris Wilson
dbc0d83f2a image: Add a couple of tracepoints for spans fallbacks
References: https://bugs.freedesktop.org/show_bug.cgi?id=56574
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 15:18:21 +00:00
Chris Wilson
9b7ed9b2cd xlib/shm: Fix bogus assertion without shm available
In particular note that _cairo_xlib_surface_put_shm is indeed called and
is expected to be a no-op when shm is not available.

Reported-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 13:15:07 +00:00
Chris Wilson
d7f5a1bec4 pen: First check whether the in/out edges lie within the single pen vertex
In order to prevent underflow when searching for the closing pen vertex,
we first need to be sure that it does not simply lie next to the opening
pen vertex. As a result we were missing many cases that should have been
a bevel (in == out) and generating almost complete round caps instead.

Reported-by: Dominik Röttsches <dominik.rottsches@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56432
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-31 09:27:52 +00:00
Chris Wilson
66625cb46c xlib: Apply the image offsets to the destination rather the source
So that we can specify the entire source surface as the region to copy
and not introduce clipping errors.

Fixes regression from
commit c068691ff5
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Aug 17 21:33:54 2012 +0100

    xlib/shm: Use an impromptu upload ShmSegment

Reported-by: John Lindgren <john.lindgren@aol.com>
Reported-by: Kalev Lember <kalevlember@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56547
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-30 12:40:41 +00:00
Kevin Tardif
65176b7380 type1-subset, cff-subset: Plugged 2 memory leaks
- _cairo_type1_font_subset_fini doesn't free font->cleartext
- _cairo_cff_font_create can exit without freeing font->font_name and/or
  font->data; _cairo_cff_font_load_opentype_cff is called to allocate
  font_name, then _cairo_cff_font_load_cff is called to allocate
  font->data, then _cairo_cff_font_load_cff's return status is checked
  and if it failed, it jumps to fail1. This can cause font_name to leak
  since the fail1 target only frees the font variable. In addition,
  _cairo_cff_font_load_cff can fail -after- allocating data, and then
  data won't be freed either.

Bug 56566
2012-10-30 20:50:00 +10:30
Adrian Johnson
0c800dc3f6 type1-subset: ensure subroutine numnber is an integer 2012-10-30 19:23:30 +10:30
Adrian Johnson
5a6e1d680a type1-subset: restore correct callothersub behavior
that was removed in d57e652f. Without this subsetting of subroutines
won't work for some fonts.
2012-10-28 22:13:31 +10:30
Chris Wilson
0e24586978 xlib/shm: Use shmstr.h instead of shmproto.h if available
Before it was known as shmproto.h, the wire protocol definition was to
be found in shmstr.h, so if we don't have the current version of libXext
try to use the older includes.

Reported-by: Sebastian Haas <sehaas@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-28 10:13:04 +00:00
Chris Wilson
f18199fcfb xlib/shm: Check for XShm headers
Not all version of libXext ship the same set of headers, so play safe
and check during configure that we have the headers we depend upon in
the code.

Reported-by: Sebastian Haas <sehaas@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-28 10:13:04 +00:00
Adrian Johnson
d57e652f08 type1-subset: parse all operators
The PDF at bug 56265 contained a Type 1 font that used the "div"
operator to compute the glyph width. As the "div" operator was
not handled by the charstring parser this resulted in an incorrect
glyph width in the PDF output.

Fix this by upgrading the charstring parsing to handle all Type 1
operators.
2012-10-26 23:00:01 +10:30
Chris Wilson
fdd2082f92 xlib: Check for both X.org and Xorg ServerVendors
Martin Husemann reported that on his NetBSD machine the vendor was being
reported as "The Xorg Foundation", a non-conformist separatist split of
the Peoples' Liberation Army^W^W^W "The X.Org Foundation". Simply check
for both during initialisation.

Reported-by: Martin Husemann <martin@duskware.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-26 11:31:14 +01:00
Chris Wilson
00feb8ce53 xlib/shm: Sanity check that the server handles XSendEvent with ShmCompletion
Uli Schlachter suggested it would be wiser to complement our blacklist
of known broken X/libXext with an explicit roundtrip to check for a
BadValue error return when we try to use XSendEvent.

Suggested-by: Uli Schlachter <psychon@znc.in>
Reported-by: Martin Husemann <martin@duskware.de>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-26 10:59:05 +01:00
Chris Wilson
e43f53bf7f version: Post release bump to 1.12.7 2012-10-22 13:47:11 +01:00
Chris Wilson
fab6958eff 1.12.6 release 2012-10-22 11:07:15 +01:00
Gilles Espinasse
d49b2284b5 configure: fix unrecognized -Wno option
gcc-4.4 and later accept every -Wno option. So we can test for the
option without no in the name to check if the option is supported.

Each time a warning is emitted and without this fix, on gcc-4.4 that will
add this warning:
   cc1: warning: unrecognized command line option "-Wno-unused-but-set-variable"

bugs.freedesktop.org #51633, rediffed after 1.12.4

Of course this assumes that all compilers will behave like gcc, which is
reasonably implicit in the set of warning flags.

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
[ickle: slight modification to test both -W and -Wno variants to ideally
preserve compatability with non-GCC compilers sharing GCC options!]
2012-10-21 17:32:53 +01:00
Gilles Espinasse
b12a94b983 configure: fix PKG_CHECK_MODULES tests displaying no no
Inside PKG_CHECK_MODULES, AC_MSG_RESULT(no) is already displayed, so the
caller should not use another AC_MSG_RESULT(no).

Add a comment that empty ACTION-IF-NOT-FOUND is not allowed for
PKG_CHECK_MODULES, but a simple : is enough.

This is bugs.freedesktop.org #51628, rediffed after 1.12.4

Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2012-10-21 09:36:28 +01:00
Gilles Espinasse
813143c220 ft: Fix compilation on 1.12 without FT_Get_X11_Font_Format
Signed-off-by: Gilles Espinasse <g.esp@free.fr>
2012-10-21 09:34:08 +01:00
Chris Wilson
c565bad890 pen: Relax invisibility criteria from half-tolerance to quarter-tolerance
Inkscape is one user who sets geometric tolerance to 1.25 pixels when
stroking sub-pixel lines. Whilst we wait for inkscape to set sensible
values for their tolerance, we have to allow through the current values
in order to prevent the fine strokes from disappearing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56099
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-19 12:22:58 +01:00
Chris Wilson
5041b462d0 xlib/shm: Sync the XShmAttach before removing the ShmSegment id
Whilst reading through other users of XShm, it became apparent that
IPC_RMID behaves differently across the platforms. Linux allows
processes to attach to an existing ShmSegment id after a IPC_RMID, but
for others the IPC_RMID takes immediate effect. On those platforms
without a "deferred" IPC_RMID, we then need to perform the XShmAttach
synchronously before perfomring the IPC_RMID.

Reported-by: Thomas Klausner <wiz@NetBSD.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-19 12:04:50 +01:00
Uli Schlachter
d5f9c694b9 test: Define optional exception classes
According to musl libc author:

"C99 requires the FE_ macros to be defined if and only if the exception they
correspond to is supported"

So we define these macros to 0 if they are not supported. Support for these FPU
exceptions is not necessary for correct functionality, but makes some tests less
effective.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55771
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-16 17:09:42 +02:00
Chris Wilson
db488a1703 recording: Copy across the is-clear? during snapshotting
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55799
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 17:00:57 +01:00
Henry Song
ed720007ba recording: copy reverses its dst and src parameters
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55799
2012-10-11 16:57:57 +01:00
Chris Wilson
26c8accd41 xlib: Reorder CloseDisplay hooks
As we may utilize X extensions as we shutdown and release resources
during CloseDisplay, we need to run our own callback first. If we run
last, than we reinstantiate the extensions which often have the
unfortunate habit of then persisting with stale data across the next
Display connection, causing invalid requests to be generated and raise
XErrors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 16:56:15 +01:00
Chris Wilson
fbf528f46d compositor: Reduce glyph "overlap" if the inked pixels are opaque
We can ignore the issue of overdraw if when we paint the glyphs, the
result is opaque.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-11 16:56:14 +01:00
Henry Song
66500ef29f gl/traps: ensure RGBA surface before upload image to texture for GLES2
As GLESv2 may only use an RGBA surface as its source for texture
uploads, we therefore need to perform a conversion.
2012-10-11 16:56:13 +01:00
Henry Song
188c34b40d gl: gles2 only supports GL_DEPTH24_STENCIL8_OES
Patch also provided by U. Artie Eoff <ullysses.a.eoff@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50355
2012-10-11 16:56:13 +01:00
Alexis Ballier
f78a926922 cairo-sphinx: protect -ldl link with CAIRO_HAS_DL like in cairo-trace.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-08 22:00:31 +02:00
Alexis Ballier
3d2712d56a cairo-fdr: protect -ldl link with CAIRO_HAS_DL like in cairo-trace.
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-08 21:59:39 +02:00
Adrian Johnson
9ab9916114 remove debug code 2012-10-07 23:54:20 +10:30
Adrian Johnson
9c2a92c708 type1: convert '.' to locale specific decimal point before using sscanf 2012-10-07 23:50:54 +10:30
David Maxwell
0d5f63755e type1-subset: always subset subroutines 0-3 (Flex/hint replacement)
http://lists.cairographics.org/archives/cairo/2012-October/023576.html
2012-10-07 19:26:17 +10:30
David Maxwell
599e78ea2e type1: lenIV support
http://lists.cairographics.org/archives/cairo/2012-October/023557.html
2012-10-07 16:22:28 +10:30
David Maxwell
cffbdf50ce type1: buildchar stack fix
http://lists.cairographics.org/archives/cairo/2012-October/023557.html
2012-10-07 16:22:13 +10:30
Chris Wilson
e29bb5f295 win32: Use the image surface below the fallback when unmapping an HDC
As for a native window, the surface does not have an image delegate
itself but instead installs a fallback surface during map_to_image. So
during unmap_image, we then need to unmap from the fallback surface
instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-06 18:53:41 +01:00
Uli Schlachter
0251f0951d xcb: Clear the result of create_similar_image
The documentation of cairo_surface_create_similar_image() states that the
image's contents are initially all 0. However, the implementation didn't live up
to the documentation.

This was found via the corresponding assert in
cairo_surface_create_similar_image().

There are some cairo-xcb-internal users of this function which cleared the image
right after creating it. Obviously, this isn't needed anymore.

Fixes: Nothing. The existing call in the testsuite to
cairo_surface_create_similar_image() doesn't hit this issue, since it creates a
too small image to hit the SHM-case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-06 15:00:51 +02:00
Chris Wilson
15ef4a3248 xlib/shm: Note the bug is an interaction between libXext and xorg
Søren thought it was bit harsh to lay the blame solely on xorg for it
crashing due to an unexpected input value, and that we should mention
libXext was also partly to blame for incorrectly setting the SEND_EVENT
bit in the ShmCompletionEvent.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-05 19:46:41 +01:00
Chris Wilson
b1532f465e xlib/shm: Avoid using XSendEvent with old versions of Xorg
Søren Sandmann Pedersen pointed out that all versions of Xorg prior to
and including xorg-1.11.0 contained a bug that would cause them to crash
if they ever processed an event sent by XSendEvent. This was fixed in

commit 2d2dce558d24eeea0eb011ec9ebaa6c5c2273c39
Author: Sam Spilsbury <sam.spilsbury@canonical.com>
Date:   Wed Sep 14 09:58:34 2011 +0800

    Remove the SendEvent bit (0x80) before doing range checks on event type.

so make sure we do not use XSendEvent prior to that commit, which
fortuitously is quite easy as we only do so along the ShmPixmap path.

Reported-by: Søren Sandmann Pedersen <ssp@redhat.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-05 19:20:18 +01:00
Chris Wilson
dba46f4eab version: Post release bump to 1.12.5 2012-10-05 17:24:56 +01:00
Chris Wilson
117abd85ac 1.12.4 release 2012-10-05 16:44:00 +01:00