version: Post release bump to 1.12.5
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>
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>
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>
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>
type1: buildchar stack fix

http://lists.cairographics.org/archives/cairo/2012-October/023557.html
type1: lenIV support

http://lists.cairographics.org/archives/cairo/2012-October/023557.html
type1-subset: always subset subroutines 0-3 (Flex/hint replacement)

http://lists.cairographics.org/archives/cairo/2012-October/023576.html
type1: convert '.' to locale specific decimal point before using sscanf
remove debug code
cairo-fdr: protect -ldl link with CAIRO_HAS_DL like in cairo-trace.

Signed-off-by: Uli Schlachter <psychon@znc.in>
cairo-sphinx: protect -ldl link with CAIRO_HAS_DL like in cairo-trace.

Signed-off-by: Uli Schlachter <psychon@znc.in>
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
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.
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>
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>
recording: copy reverses its dst and src parameters

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55799
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>
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>
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>