[cairo-commit] Branch '1.14' - 53 commits - boilerplate/cairo-boilerplate.h boilerplate/cairo-boilerplate-pdf.c boilerplate/cairo-boilerplate-private.h build/aclocal.float.m4 build/.gitignore cairo-version.h .gitignore HACKING KNOWN_ISSUES NEWS perf/cairo-perf.h perf/cairo-perf-report.c perf/micro README RELEASING src/cairo-cff-subset.c src/cairo-font-face.c src/cairo-ft-private.h src/cairo-image-compositor.c src/cairo-image-info.c src/cairoint.h src/cairo-pattern.c src/cairo-pdf-operators.c src/cairo-pdf-operators-private.h src/cairo-pdf-surface.c src/cairo-ps-surface.c src/cairo-quartz-font.c src/cairo-surface.c src/cairo-surface-observer.c src/cairo-tor-scan-converter.c src/cairo-type3-glyph-surface.c src/cairo-type3-glyph-surface-private.h src/cairo-version.c src/cairo-xcb-connection.c src/cairo-xcb-private.h src/cairo-xcb-resources.c src/cairo-xcb-screen.c src/cairo-xcb-surface-render.c src/cairo-xlib-private.h src/cairo-xlib-render-compositor.c src/cairo-xlib-source.c src/cairo-xlib- surface-private.h src/cairo-xlib-surface-shm.c src/cairo-xlib-xcb-surface.c src/win32 test/any2ppm.c test/api-special-cases.c test/bug-spline.c test/cairo-test.c test/cairo-test.h test/cairo-test-runner.c test/cairo-test-trace.c test/caps-tails-curve.c test/clip-nesting.c test/clip-operator.c test/close-path.c test/composite-integer-translate-over.c test/composite-integer-translate-over-repeat.c test/composite-integer-translate-source.c test/copy-path.c test/degenerate-dash.c test/degenerate-path.c test/extended-blend.c test/extend-pad-border.c test/extend-pad.c test/extend-pad-similar.c test/extend-reflect.c test/long-dashed-lines.c test/mask.c test/multi-page.c test/operator-clear.c test/operator-source.c test/path-append.c test/pattern-getters.c test/pdf-features.c test/pixman-downscale.c test/pixman-rotate.c test/ps-features.c test/record-extend.c test/record-mesh.c test/reference test/reflected-stroke.c test/select-font-no-show-text.c test/self-copy.c test/source-clip.c test/so urce-clip-scale.c test/surface-pattern.c test/surface-pattern-scale-down.c test/surface-pattern-scale-up.c test/svg-clip.c test/svg-surface.c test/tiger.c test/trap-clip.c test/unbounded-operator.c test/user-font.c test/user-font-mask.c test/user-font-proxy.c test/user-font-rescale.c test/xcb-snapshot-assert.c test/xlib-expose-event.c test/xlib-surface.c util/cairo-script util/cairo-sphinx util/cairo-trace

Bryce Harrington bryce at kemper.freedesktop.org
Wed Jun 24 18:28:51 PDT 2015


 .gitignore                                     |    4 -
 HACKING                                        |   18 ++----
 KNOWN_ISSUES                                   |   13 +---
 NEWS                                           |   75 +++++++++++++++++++++++++
 README                                         |    2 
 RELEASING                                      |    2 
 boilerplate/cairo-boilerplate-pdf.c            |    2 
 boilerplate/cairo-boilerplate-private.h        |    2 
 boilerplate/cairo-boilerplate.h                |    4 +
 build/.gitignore                               |    2 
 build/aclocal.float.m4                         |    4 -
 cairo-version.h                                |    2 
 dev/null                                       |binary
 perf/cairo-perf-report.c                       |    4 +
 perf/cairo-perf.h                              |    4 -
 perf/micro/disjoint.c                          |    2 
 perf/micro/hatching.c                          |    2 
 perf/micro/pattern_create_radial.c             |    2 
 perf/micro/spiral.c                            |    2 
 src/cairo-cff-subset.c                         |   35 ++++++-----
 src/cairo-font-face.c                          |    5 +
 src/cairo-ft-private.h                         |    2 
 src/cairo-image-compositor.c                   |    4 -
 src/cairo-image-info.c                         |   32 ++++------
 src/cairo-pattern.c                            |    4 -
 src/cairo-pdf-operators-private.h              |    4 +
 src/cairo-pdf-operators.c                      |   22 +++++--
 src/cairo-pdf-surface.c                        |   11 ++-
 src/cairo-ps-surface.c                         |    9 ++-
 src/cairo-quartz-font.c                        |   10 +--
 src/cairo-surface-observer.c                   |   12 ++--
 src/cairo-surface.c                            |   28 +++++++++
 src/cairo-tor-scan-converter.c                 |    4 -
 src/cairo-type3-glyph-surface-private.h        |    3 -
 src/cairo-type3-glyph-surface.c                |    6 +-
 src/cairo-version.c                            |   12 ++--
 src/cairo-xcb-connection.c                     |   19 ++++++
 src/cairo-xcb-private.h                        |    8 +-
 src/cairo-xcb-resources.c                      |   33 +----------
 src/cairo-xcb-screen.c                         |   16 +++++
 src/cairo-xcb-surface-render.c                 |    6 ++
 src/cairo-xlib-private.h                       |    2 
 src/cairo-xlib-render-compositor.c             |    6 ++
 src/cairo-xlib-source.c                        |   14 +++-
 src/cairo-xlib-surface-private.h               |    2 
 src/cairo-xlib-surface-shm.c                   |    4 -
 src/cairo-xlib-xcb-surface.c                   |   33 ++++++-----
 src/cairoint.h                                 |   28 +++++++++
 src/win32/cairo-win32-display-surface.c        |    8 +-
 test/any2ppm.c                                 |    2 
 test/api-special-cases.c                       |    4 +
 test/bug-spline.c                              |    3 -
 test/cairo-test-runner.c                       |    1 
 test/cairo-test-trace.c                        |    4 +
 test/cairo-test.c                              |    4 -
 test/cairo-test.h                              |    4 -
 test/caps-tails-curve.c                        |    2 
 test/clip-nesting.c                            |    2 
 test/clip-operator.c                           |    2 
 test/close-path.c                              |    2 
 test/composite-integer-translate-over-repeat.c |    2 
 test/composite-integer-translate-over.c        |    4 -
 test/composite-integer-translate-source.c      |    2 
 test/copy-path.c                               |    2 
 test/degenerate-dash.c                         |    2 
 test/degenerate-path.c                         |    2 
 test/extend-pad-border.c                       |    2 
 test/extend-pad-similar.c                      |    2 
 test/extend-pad.c                              |    2 
 test/extend-reflect.c                          |    2 
 test/extended-blend.c                          |    2 
 test/long-dashed-lines.c                       |    2 
 test/mask.c                                    |    2 
 test/multi-page.c                              |    4 -
 test/operator-clear.c                          |    2 
 test/operator-source.c                         |    2 
 test/path-append.c                             |    2 
 test/pattern-getters.c                         |    2 
 test/pdf-features.c                            |    4 -
 test/pixman-downscale.c                        |    4 -
 test/pixman-rotate.c                           |    4 -
 test/ps-features.c                             |    4 -
 test/record-extend.c                           |    2 
 test/record-mesh.c                             |    2 
 test/reflected-stroke.c                        |    2 
 test/select-font-no-show-text.c                |    2 
 test/self-copy.c                               |    2 
 test/source-clip-scale.c                       |    2 
 test/source-clip.c                             |    2 
 test/surface-pattern-scale-down.c              |    2 
 test/surface-pattern-scale-up.c                |    2 
 test/surface-pattern.c                         |    2 
 test/svg-clip.c                                |    3 -
 test/svg-surface.c                             |    3 -
 test/tiger.c                                   |    2 
 test/trap-clip.c                               |    2 
 test/unbounded-operator.c                      |    2 
 test/user-font-mask.c                          |    4 -
 test/user-font-proxy.c                         |    4 -
 test/user-font-rescale.c                       |    4 -
 test/user-font.c                               |    4 -
 test/xcb-snapshot-assert.c                     |    2 
 test/xlib-expose-event.c                       |    2 
 test/xlib-surface.c                            |    3 -
 util/cairo-script/csi-trace.c                  |   10 +++
 util/cairo-sphinx/sphinx.c                     |    4 +
 util/cairo-trace/trace.c                       |    3 -
 107 files changed, 434 insertions(+), 252 deletions(-)

New commits:
commit 89520c69fd3074e03fe37c58fefbb20d9c7c03fb
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Tue Mar 10 18:42:50 2015 -0700

    version: bump for cairo-1.14.2 release

diff --git a/cairo-version.h b/cairo-version.h
index 197e7b8..516999e 100644
--- a/cairo-version.h
+++ b/cairo-version.h
@@ -3,6 +3,6 @@
 
 #define CAIRO_VERSION_MAJOR 1
 #define CAIRO_VERSION_MINOR 14
-#define CAIRO_VERSION_MICRO 1
+#define CAIRO_VERSION_MICRO 2
 
 #endif
commit fcaef820bd0f6938ae7ba6453f4abeafe3fd2da3
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Tue Mar 10 16:24:37 2015 -0700

    KNOWN_ISSUES:  Restore known issues file as a stub
    
    Apparently distcheck requires this file be present.

diff --git a/KNOWN_ISSUES b/KNOWN_ISSUES
new file mode 100644
index 0000000..c367f91
--- /dev/null
+++ b/KNOWN_ISSUES
@@ -0,0 +1,3 @@
+Known Issues
+------------
+None
commit 747b62d8a3aad131536ef4487bdaae292ac784a6
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Tue Mar 10 13:08:29 2015 -0700

    NEWS: Note about the OS X support

diff --git a/NEWS b/NEWS
index d4f93ef..93b650e 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,11 @@ build and run-time.  Platforms with fixes include Sparc, AIX, Windows
 (mingw), and Windows (MSVC8).  Memory leaks, valgrind issues, and PDF
 issues round out our list.
 
+It's come to light that changes in cairo 1.14 resulted in breakage on
+MacOS X 10.4.  We've not yet determined whether to fix up the support,
+or excise the 10.4-specific code and support only OS X 10.5 or newer.
+Meantime, we'll only advertise cairo as working on OS X 10.5.
+
 Features
 --------
  * Improve xcb's handling of per-screen subpixel ordering.  If no
commit 76393b557b034c1b3f04dfe3eaff21cbe7a43bb0
Author: Andrea Canciani <ranma42 at tartaros.local>
Date:   Tue Mar 10 12:10:35 2015 +0100

    Update README with new minimum MacOSX requirements
    
    Since 70cc8f250b5669e757b4f044571ba0f71e3dea9e 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.

diff --git a/README b/README
index 5926430..0be9947 100644
--- a/README
+++ b/README
@@ -121,7 +121,7 @@ Supported, "platform" surface backends
 
 	quartz backend
 	--------------
-	MacOS X >= 10.4 with Xcode >= 2.4
+	MacOS X >= 10.5 with Xcode >= 3.0
 
 	win32 backend
 	-------------
commit 2f93af57f6527e20d821d5352a71c61fa9ae7834
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Tue Mar 10 12:15:40 2015 -0700

    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 at gmail.com>

diff --git a/test/composite-integer-translate-over.c b/test/composite-integer-translate-over.c
index 4f89fa8..1b82a33 100644
--- a/test/composite-integer-translate-over.c
+++ b/test/composite-integer-translate-over.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2006 Mozilla Corporation
+ * Copyright © 2006 Mozilla Corporation
  *
  * Permission to use, copy, modify, distribute, and sell this software
  * and its documentation for any purpose is hereby granted without
diff --git a/test/degenerate-dash.c b/test/degenerate-dash.c
index 12cd0c7..6e7bf6b 100644
--- a/test/degenerate-dash.c
+++ b/test/degenerate-dash.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2008 Chris Wilson
+ * Copyright © 2008 Chris Wilson
  *
  * Permission to use, copy, modify, distribute, and sell this software
  * and its documentation for any purpose is hereby granted without
diff --git a/test/degenerate-path.c b/test/degenerate-path.c
index db53cbb..aa5f822 100644
--- a/test/degenerate-path.c
+++ b/test/degenerate-path.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2006 Jeff Muizelaar
+ * Copyright © 2006 Jeff Muizelaar
  *
  * Permission to use, copy, modify, distribute, and sell this software
  * and its documentation for any purpose is hereby granted without
diff --git a/test/long-dashed-lines.c b/test/long-dashed-lines.c
index 215bd91..4d6ded9 100644
--- a/test/long-dashed-lines.c
+++ b/test/long-dashed-lines.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2008 Chris Wilson
+ * Copyright © 2008 Chris Wilson
  *
  * Permission to use, copy, modify, distribute, and sell this software
  * and its documentation for any purpose is hereby granted without
diff --git a/test/reflected-stroke.c b/test/reflected-stroke.c
index b11f5a9..895396a 100644
--- a/test/reflected-stroke.c
+++ b/test/reflected-stroke.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2008 Chris Wilson
+ * Copyright © 2008 Chris Wilson
  *
  * Permission to use, copy, modify, distribute, and sell this software
  * and its documentation for any purpose is hereby granted without
diff --git a/test/user-font-rescale.c b/test/user-font-rescale.c
index 3fe70f6..6f03b8e 100644
--- a/test/user-font-rescale.c
+++ b/test/user-font-rescale.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2008 Jeff Muizelaar
+ * Copyright © 2008 Jeff Muizelaar
  *
  * Permission to use, copy, modify, distribute, and sell this software
  * and its documentation for any purpose is hereby granted without
@@ -22,7 +22,7 @@
  *
  * Contributor(s):
  *	Jeff Muizelaar <jeff at infidigm.net>
- *	Kristian Høgsberg <krh at redhat.com>
+ *	Kristian Høgsberg <krh at redhat.com>
  *	Behdad Esfahbod <behdad at behdad.org>
  */
 
commit e7ec9ff90e7b5a08636b74f1a9669dcf773cebc5
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Tue Mar 10 12:10:34 2015 +0100

    Update KNOWN_ISSUES documentation
    
    The bug mentioned in KNOWN_ISSUES was fixed in
    2b3d8de11a536d668084ea6d2bf295da1d1cdc11, but the documentation was
    not updated. Moreover, the header of KNOWN_ISSUES was 1.10-specific.
    
    Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

diff --git a/KNOWN_ISSUES b/KNOWN_ISSUES
deleted file mode 100644
index 5fda683..0000000
--- a/KNOWN_ISSUES
+++ /dev/null
@@ -1,10 +0,0 @@
-There are a few known bugs in 1.10 that have been fixed in master, but
-appear to be non-trivial to backport without fear of causing other
-regressions. The impact of these bugs is considered to be less than of a
-risk than rewriting the code.
-
-Zero Path Extents
------------------
-A closed degenerate path is reported as having extents (0, 0) x (0, 0),
-whereas the expected value is (x, y) x (0, 0). This regression has existed
-since at least 1.2.
commit ccc1eadc655b64bbe748e7c49193305fae6c8f6e
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Tue Mar 10 04:45:18 2015 -0700

    NEWS: Finish filling in changes

diff --git a/NEWS b/NEWS
index 59e195b..d4f93ef 100644
--- a/NEWS
+++ b/NEWS
@@ -1,10 +1,19 @@
 Release 1.14.2 (2014-03-09 Bryce Harrington <bryce at osg.samsung.com>)
 ====================================================================
+This release provides collected bug fixes, along with one feature
+enhancement for the xcb backend, and a small performance improvement for
+fonts.
 
+The running theme of the bug fixes is platform-specific issues, both
+build and run-time.  Platforms with fixes include Sparc, AIX, Windows
+(mingw), and Windows (MSVC8).  Memory leaks, valgrind issues, and PDF
+issues round out our list.
 
 Features
 --------
-None
+ * Improve xcb's handling of per-screen subpixel ordering.  If no
+   Xft.rgba property is specified, default to the screen's subpixel
+   order.
 
 API Changes
 -----------
@@ -42,7 +51,21 @@ Bug Fixes
  * Fix valgrind error by releasing pattern created by
    cairo_pattern_create_rgb().
  * Fix valgrind errors when running cairo-test-suite.
-
+ * Fix memory leak in recording surface replays
+   (fdo bug #87898)
+ * Fix destruction of fonts in api-special-cases test.
+   (fdo bug #87567)
+ * Fix duplicated surface push on similar-image, preventing trivial GTK3
+   program traces from being replayable, with an error message about
+   invalid values for the size of the input.
+   (fdo bug #73580)
+ * Fix crash when win32 surface's image size does not cover the entire
+   surface.
+   (fdo bug #53121)
+ * Fix crash due to obsolete CGFontGetGlyphPath call
+   (fdo bug #84324)
+ * Fix several build issues on AIX
+   (fdo bugs #89338, #89340, #89356, #89354)
  * Fix various documentation warnings and errors
 
 Release 1.14.0 (2014-10-13 Bryce Harrington <bryce at osg.samsung.com>)
commit 452c40d6e802e4f8d27f176fce2c356000863d50
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Sat Mar 7 00:30:40 2015 -0800

    NEWS: Update for changes through Nov 2014

diff --git a/NEWS b/NEWS
index 2370dfd..59e195b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,50 @@
+Release 1.14.2 (2014-03-09 Bryce Harrington <bryce at osg.samsung.com>)
+====================================================================
+
+
+Features
+--------
+None
+
+API Changes
+-----------
+None
+
+Dependency Changes
+------------------
+None
+
+Performance Optimizations
+-------------------------
+ * Improve performance of cpu_to_be32 and be32_to_cpu, making truetype
+   subsetting of large fonts run about 15% faster.
+
+Bug Fixes
+---------
+ * Fix unaligned access on sparc with the compact font format (CFF).
+   Unlike truetype, all data in CFF is not aligned.
+   (Debian bug #712836)
+ * Fix unaligned access on sparc with tor-scan-converter's memory pool.
+ * Fix crash when loading a PDF with a transformed image.
+   (fdo bug #85151)
+ * Fix regression on mingw for bigendian test due to removal of file
+   extension for executables.
+   (fdo bug #85120)
+ * Fix handling of backslash in PDF interpreter
+   (fdo bug #85662)
+ * Fix crash in xlib and xcb renderers when swapping a 0-sized glyph
+ * Fix bug with RTL text in PDF operators
+   (fdo bug #86461)
+ * Fix compilation 'cairo-path-stroke-traps.c' with MSVC8
+   (fdo bug #84908)
+ * Fix crash in _fill_xrgb32_lerp_opaque_spans when a span length is
+   negative.
+ * Fix valgrind error by releasing pattern created by
+   cairo_pattern_create_rgb().
+ * Fix valgrind errors when running cairo-test-suite.
+
+ * Fix various documentation warnings and errors
+
 Release 1.14.0 (2014-10-13 Bryce Harrington <bryce at osg.samsung.com>)
 ====================================================================
 Hard to believe it's been over a year since our last release, but it's
commit fb8eef0fadef25ece95404aeee410f627bd5eead
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Fri Mar 6 23:54:49 2015 -0800

    HACKING: Add link to git tutorial and wordsmith a bit

diff --git a/HACKING b/HACKING
index 752efba..aba2c54 100644
--- a/HACKING
+++ b/HACKING
@@ -73,9 +73,9 @@ We use /git/ for version control.  See:
 
 	http://cairographics.org/download/
 
-TODO:
-Add links to some git tutorials or better, write a few paragraphs
-about how to use git to efficiently hack on cairo.
+For more information on using git, see:
+
+	http://freedesktop.org/wiki/Infrastructure/git/
 
 
 Build System
@@ -103,10 +103,9 @@ No manual ChangeLog writing is necessary.
 Copyrights and Licensing
 ------------------------
 
-The cairo library is dual-licensed under LGPL and MPL.  See file named
-COPYING for details.  The test suites are more liberal.  For example,
-GPL code is allowed in the test suites, though it's always better to
-keep things simple.
+The cairo library is dual-licensed under LGPL and MPL.  See the file
+named COPYING for details.  The test suites are more liberal, and are
+allowed to include GPL code.
 
 When writing new code, update the file headers to add your (or your
 employers) copyright line and contributor line.  If adding new files
@@ -174,9 +173,8 @@ Some of those should gradually be moved to doc/.
 Utilities
 ---------
 
-There are a few useful utilities we have developed that are either
-useful when writing code using cairo, or writing cairo, or useful in
-general.  These tools can be found under the util/ directory.
+We have developed several utilities useful for writing cairo or code
+that uses cairo.  These tools can be found under the util/ directory.
 See util/README for more information.
 
 
commit 1dc88d197f7cd73d67c6b7bcaed08924b276eafa
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Fri Mar 6 23:31:25 2015 -0800

    csi-trace:  Add --version and --help args to utility

diff --git a/util/cairo-script/csi-trace.c b/util/cairo-script/csi-trace.c
index c57a56b..a0466a3 100644
--- a/util/cairo-script/csi-trace.c
+++ b/util/cairo-script/csi-trace.c
@@ -2,6 +2,7 @@
 #include <cairo-script-interpreter.h>
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <libgen.h>
 
@@ -22,11 +23,18 @@ main (int argc, char **argv)
 	.surface_create = _script_surface_create,
     };
     int i;
+    char buf[4096];
 
     csi = cairo_script_interpreter_create ();
 
     for (i = 1; i < argc; i++) {
-	char buf[4096];
+        if (strcmp (argv[i], "--version")) {
+            printf ("%s: version %s\n", argv[0], __DATE__);
+	    exit (0);
+        } else if (strcmp (argv[i], "--help")) {
+	    printf ("usage: %s < in > out\n", argv[0]);
+	    exit (0);
+        }
 
 	snprintf (buf, sizeof (buf), "%s.trace", basename (argv[i]));
 	cairo_device_destroy (hooks.closure);
commit f2aa28e331b621c2502ddea2bfb73188ef6d335a
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Fri Mar 6 22:26:22 2015 -0800

    Revert "xlib: Remove queued event from _XReadEvents"
    
    This reverts commit e7fc8f405beeeb1048f69fe22923170a137b805e.

diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
index 9b4dea5..fb40699 100644
--- a/src/cairo-xlib-surface-shm.c
+++ b/src/cairo-xlib-surface-shm.c
@@ -670,7 +670,6 @@ _cairo_xlib_shm_surface_flush (void *abstract_surface, unsigned flags)
     cairo_xlib_shm_surface_t *shm = abstract_surface;
     cairo_xlib_display_t *display;
     Display *dpy;
-    _XQEvent *qev;
     cairo_status_t status;
 
     if (shm->active == 0)
@@ -695,10 +694,6 @@ _cairo_xlib_shm_surface_flush (void *abstract_surface, unsigned flags)
     while (! seqno_passed (shm->active, LastKnownRequestProcessed (dpy))) {
 	LockDisplay(dpy);
 	_XReadEvents(dpy);
-	while (dpy->head) {
-	    qev = dpy->head;
-	    _XDeq (dpy, NULL, qev);
-	}
 	UnlockDisplay(dpy);
     }
 
commit fb3b415cb3bf0fb242be8e6a53d20460ec684ebc
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Fri Mar 6 23:29:53 2015 -0800

    git-ignore: Add build's test-driver

diff --git a/build/.gitignore b/build/.gitignore
index 551f858..2f01835 100644
--- a/build/.gitignore
+++ b/build/.gitignore
@@ -12,3 +12,5 @@ mkinstalldirs
 libtool.m4
 lt*.m4
 gtk-doc.m4
+test-driver
+
commit 3a1215291bd7e16a6bd40fab7a31075680648014
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Fri Mar 6 19:14:58 2015 -0800

    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.

diff --git a/src/cairo-version.c b/src/cairo-version.c
index e493c81..a94cef6 100644
--- a/src/cairo-version.c
+++ b/src/cairo-version.c
@@ -79,10 +79,10 @@
  * 1.0.1 - Development on a maintenance branch (toward 1.0.2 release)
  * 1.1.1 - Development on head (toward 1.1.2 snapshot and 1.2.0 release)
  * </screen></informalexample>
- * </para>
+ *
  * <refsect2>
  * <title>Compatibility</title>
- * <para>
+ *
  * The API/ABI compatibility guarantees for various versions are as
  * follows. First, let's assume some cairo-using application code that is
  * successfully using the API/ABI "from" one version of cairo. Then let's
@@ -102,11 +102,11 @@
  * with the same in-development version number. This is because these
  * numbers don't correspond to any fixed state of the software, but
  * rather the many states between snapshots and releases.
- * </para>
+ *
  * </refsect2>
  * <refsect2>
  * <title>Examining the version</title>
- * <para>
+ *
  * Cairo provides the ability to examine the version at either
  * compile-time or run-time and in both a human-readable form as well as
  * an encoded form suitable for direct comparison. Cairo also provides the
@@ -135,9 +135,9 @@
  * if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 0, 0))
  *     printf ("Running with suitable cairo version: %s\n", cairo_version_string ());
  * </programlisting></informalexample>
- * </para>
+ *
  * </refsect2>
- * <para>
+ *
  **/
 
 /**
commit 9a4026d31510f641b13eaf29baa9806d1179aa59
Author: Bryce Harrington <b.harrington at samsung.com>
Date:   Fri Mar 6 18:34:07 2015 -0800

    gitignore: logs, manuals

diff --git a/.gitignore b/.gitignore
index 0ca3624..f365d9e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,16 +2,15 @@
 .libs
 .perf
 cairo-*.*.*
+manual-*.*.*
 ChangeLog*
 Makefile
 Makefile.in
 aclocal.m4
 autom4te.cache
-autoscan.log
 config.cache
 config.h
 config.h.in
-config.log
 config.status
 configure
 configure.scan
@@ -27,6 +26,7 @@ stamp-h.in
 .*.sw?
 *.la
 *.lo
+*.log
 *.orig
 *.rej
 *-uninstalled.pc
commit 74d53e5eb027d127580211962e52fd63b16af599
Author: Henry (Yu) Song <henry.song at samsung.com>
Date:   Thu Mar 5 00:20:42 2015 +0000

    xlib: Remove queued event from _XReadEvents
    
    Following patch fixes a memory leak in xlib surface.
    
    Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>

diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
index fb40699..9b4dea5 100644
--- a/src/cairo-xlib-surface-shm.c
+++ b/src/cairo-xlib-surface-shm.c
@@ -670,6 +670,7 @@ _cairo_xlib_shm_surface_flush (void *abstract_surface, unsigned flags)
     cairo_xlib_shm_surface_t *shm = abstract_surface;
     cairo_xlib_display_t *display;
     Display *dpy;
+    _XQEvent *qev;
     cairo_status_t status;
 
     if (shm->active == 0)
@@ -694,6 +695,10 @@ _cairo_xlib_shm_surface_flush (void *abstract_surface, unsigned flags)
     while (! seqno_passed (shm->active, LastKnownRequestProcessed (dpy))) {
 	LockDisplay(dpy);
 	_XReadEvents(dpy);
+	while (dpy->head) {
+	    qev = dpy->head;
+	    _XDeq (dpy, NULL, qev);
+	}
 	UnlockDisplay(dpy);
     }
 
commit a0712362b5dbe6d9f7256a29e0323c5f4cde6429
Author: Michael Haubenwallner <michael.haubenwallner at ssi-schaefer.com>
Date:   Fri Feb 27 14:25:41 2015 +0100

    headers: fix include order for AIX, bug#89354
    
    also for cairo-xcb-private.h

diff --git a/src/cairo-xcb-private.h b/src/cairo-xcb-private.h
index 214fa45..f5d5a4c 100644
--- a/src/cairo-xcb-private.h
+++ b/src/cairo-xcb-private.h
@@ -37,10 +37,10 @@
 #ifndef CAIRO_XCB_PRIVATE_H
 #define CAIRO_XCB_PRIVATE_H
 
-#include "cairo-xcb.h"
-
 #include "cairoint.h"
 
+#include "cairo-xcb.h"
+
 #include "cairo-cache-private.h"
 #include "cairo-compiler-private.h"
 #include "cairo-device-private.h"
commit 51fdf6f0ae62a4426d2b471836d4dfa9839db67d
Author: Michael Haubenwallner <michael.haubenwallner at ssi-schaefer.com>
Date:   Fri Feb 27 11:22:04 2015 +0100

    headers: fix include order for AIX, bug#89354

diff --git a/src/cairo-ft-private.h b/src/cairo-ft-private.h
index 3921518..0dc8114 100644
--- a/src/cairo-ft-private.h
+++ b/src/cairo-ft-private.h
@@ -37,8 +37,8 @@
 #ifndef CAIRO_FT_PRIVATE_H
 #define CAIRO_FT_PRIVATE_H
 
-#include "cairo-ft.h"
 #include "cairoint.h"
+#include "cairo-ft.h"
 
 #if CAIRO_HAS_FT_FONT
 
diff --git a/src/cairo-xlib-private.h b/src/cairo-xlib-private.h
index 6d37896..0f2f2e1 100644
--- a/src/cairo-xlib-private.h
+++ b/src/cairo-xlib-private.h
@@ -37,8 +37,8 @@
 #ifndef CAIRO_XLIB_PRIVATE_H
 #define CAIRO_XLIB_PRIVATE_H
 
-#include "cairo-xlib.h"
 #include "cairo-xlib-xrender-private.h"
+#include "cairo-xlib.h"
 
 #include "cairo-compiler-private.h"
 #include "cairo-device-private.h"
diff --git a/src/cairo-xlib-surface-private.h b/src/cairo-xlib-surface-private.h
index 87db696..83d9b63 100644
--- a/src/cairo-xlib-surface-private.h
+++ b/src/cairo-xlib-surface-private.h
@@ -33,9 +33,9 @@
 #ifndef CAIRO_XLIB_SURFACE_PRIVATE_H
 #define CAIRO_XLIB_SURFACE_PRIVATE_H
 
+#include "cairo-xlib-xrender-private.h"
 #include "cairo-xlib.h"
 #include "cairo-xlib-private.h"
-#include "cairo-xlib-xrender-private.h"
 
 #include "cairo-surface-private.h"
 #include "cairo-surface-backend-private.h"
commit 8e0c4c050e8a080939d968827d4ba7b697c0d4f9
Author: Michael Haubenwallner <michael.haubenwallner at ssi-schaefer.com>
Date:   Thu Feb 26 15:11:05 2015 +0100

    perf: fix include order for AIX, bug#89354

diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c
index 4bdcd46..2325f47 100644
--- a/perf/cairo-perf-report.c
+++ b/perf/cairo-perf-report.c
@@ -27,8 +27,8 @@
 
 #define _GETDELIM 1/* for getline() on AIX */
 
-#include "cairo-missing.h"
 #include "cairo-perf.h"
+#include "cairo-missing.h"
 #include "cairo-stats.h"
 
 /* We use _GNU_SOURCE for getline and strndup if available. */
commit 0e098447938cbdb15fa040ca27aff51678fe81eb
Author: Michael Haubenwallner <michael.haubenwallner at ssi-schaefer.com>
Date:   Thu Feb 26 16:00:01 2015 +0100

    perf/micro: fix include order for AIX, bug#89354

diff --git a/perf/micro/disjoint.c b/perf/micro/disjoint.c
index 623eb6f..847860c 100644
--- a/perf/micro/disjoint.c
+++ b/perf/micro/disjoint.c
@@ -24,8 +24,8 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
-#include <assert.h>
 #include "cairo-perf.h"
+#include <assert.h>
 
 #define STEP	5
 
diff --git a/perf/micro/hatching.c b/perf/micro/hatching.c
index 996bda6..d1d9fb8 100644
--- a/perf/micro/hatching.c
+++ b/perf/micro/hatching.c
@@ -24,8 +24,8 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
-#include <assert.h>
 #include "cairo-perf.h"
+#include <assert.h>
 
 
 #define STEP	5
diff --git a/perf/micro/pattern_create_radial.c b/perf/micro/pattern_create_radial.c
index f236ef5..3915efb 100644
--- a/perf/micro/pattern_create_radial.c
+++ b/perf/micro/pattern_create_radial.c
@@ -28,8 +28,8 @@
  * presents a somewhat realistic use-case (although the RADIALS_COUNT
  * isn't very realistic).
  */
-#include <time.h>
 #include "cairo-perf.h"
+#include <time.h>
 
 #define RADIALS_COUNT (10000)
 
diff --git a/perf/micro/spiral.c b/perf/micro/spiral.c
index 87dbcb5..5db62b0 100644
--- a/perf/micro/spiral.c
+++ b/perf/micro/spiral.c
@@ -24,8 +24,8 @@
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
-#include <assert.h>
 #include "cairo-perf.h"
+#include <assert.h>
 
 #define MAX_SEGMENTS 2560
 
commit e91ebe3dd01acde2914c40724c05d192b14de950
Author: Michael Haubenwallner <michael.haubenwallner at ssi-schaefer.com>
Date:   Thu Feb 26 15:03:43 2015 +0100

    test: fix include order for AIX, bug#89354

diff --git a/test/clip-nesting.c b/test/clip-nesting.c
index ce03b4b..a9227ec 100644
--- a/test/clip-nesting.c
+++ b/test/clip-nesting.c
@@ -23,8 +23,8 @@
  * Author: Owen Taylor <otaylor at redhat.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 100
diff --git a/test/clip-operator.c b/test/clip-operator.c
index aaa3445..ac0a5e9 100644
--- a/test/clip-operator.c
+++ b/test/clip-operator.c
@@ -23,8 +23,8 @@
  * Author: Kristian Høgsberg <krh at redhat.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define WIDTH 16
diff --git a/test/close-path.c b/test/close-path.c
index 41b237e..f1f1230 100644
--- a/test/close-path.c
+++ b/test/close-path.c
@@ -23,8 +23,8 @@
  * Author: Carl D. Worth <cworth at cworth.org>
  */
 
-#include <stdlib.h>
 #include "cairo-test.h"
+#include <stdlib.h>
 
 static cairo_test_draw_function_t draw;
 
diff --git a/test/composite-integer-translate-over-repeat.c b/test/composite-integer-translate-over-repeat.c
index 9a60d9a..d9e0005 100644
--- a/test/composite-integer-translate-over-repeat.c
+++ b/test/composite-integer-translate-over-repeat.c
@@ -24,8 +24,8 @@
  * Author: Vladimir Vukicevic <vladimir at pobox.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 100
diff --git a/test/composite-integer-translate-over.c b/test/composite-integer-translate-over.c
index 8c6b9c2..4f89fa8 100644
--- a/test/composite-integer-translate-over.c
+++ b/test/composite-integer-translate-over.c
@@ -22,8 +22,8 @@
  *
  * Author: Vladimir Vukicevic <vladimir at pobox.com>
  */
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 100
diff --git a/test/composite-integer-translate-source.c b/test/composite-integer-translate-source.c
index a05133c..e6fd933 100644
--- a/test/composite-integer-translate-source.c
+++ b/test/composite-integer-translate-source.c
@@ -24,8 +24,8 @@
  * Author: Vladimir Vukicevic <vladimir at pobox.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 100
diff --git a/test/copy-path.c b/test/copy-path.c
index c5f9398..25823b6 100644
--- a/test/copy-path.c
+++ b/test/copy-path.c
@@ -23,8 +23,8 @@
  * Author: Carl D. Worth <cworth at cworth.org>
  */
 
-#include <stdlib.h>
 #include "cairo-test.h"
+#include <stdlib.h>
 
 static void
 scale_by_two (double *x, double *y)
diff --git a/test/extend-pad-border.c b/test/extend-pad-border.c
index de8105c..c02ec4f 100644
--- a/test/extend-pad-border.c
+++ b/test/extend-pad-border.c
@@ -24,8 +24,8 @@
  * Author: Behdad Esfahbod <behdad at behdad.org>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 90
diff --git a/test/extend-pad-similar.c b/test/extend-pad-similar.c
index 357252a..09a90f4 100644
--- a/test/extend-pad-similar.c
+++ b/test/extend-pad-similar.c
@@ -24,8 +24,8 @@
  * Author: Behdad Esfahbod <behdad at behdad.org>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 90
diff --git a/test/extend-pad.c b/test/extend-pad.c
index 15a2079..f851d44 100644
--- a/test/extend-pad.c
+++ b/test/extend-pad.c
@@ -24,8 +24,8 @@
  * Author: Behdad Esfahbod <behdad at behdad.org>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 90
diff --git a/test/extend-reflect.c b/test/extend-reflect.c
index 16b08c1..173befc 100644
--- a/test/extend-reflect.c
+++ b/test/extend-reflect.c
@@ -1,5 +1,5 @@
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 static const char *png_filename = "romedalen.png";
diff --git a/test/extended-blend.c b/test/extended-blend.c
index a45ddc9..8edd182 100644
--- a/test/extended-blend.c
+++ b/test/extended-blend.c
@@ -27,8 +27,8 @@
  *          Emmanuel Pacaud <emmanuel.pacaud at lapp.in2p3.fr>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define STEPS 16
diff --git a/test/mask.c b/test/mask.c
index cc722d3..89f4c3c 100644
--- a/test/mask.c
+++ b/test/mask.c
@@ -24,8 +24,8 @@
  *          Kristian Høgsberg <krh at redhat.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define WIDTH 16
diff --git a/test/multi-page.c b/test/multi-page.c
index e2c7ddf..a3102db 100644
--- a/test/multi-page.c
+++ b/test/multi-page.c
@@ -23,6 +23,8 @@
  * Author: Carl D. Worth <cworth at cworth.org>
  */
 
+#include "cairo-test.h"
+
 #include <stdio.h>
 
 #include <cairo.h>
@@ -35,8 +37,6 @@
 #include <cairo-pdf.h>
 #endif
 
-#include "cairo-test.h"
-
 /* The PostScript and PDF backends are now integrated into the main
  * test suite, so we are getting good verification of most things
  * there.
diff --git a/test/operator-clear.c b/test/operator-clear.c
index aac39f3..72a32c2 100644
--- a/test/operator-clear.c
+++ b/test/operator-clear.c
@@ -24,8 +24,8 @@
  *          Owen Taylor <otaylor at redhat.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define WIDTH 16
diff --git a/test/operator-source.c b/test/operator-source.c
index 3dee570..9330a65 100644
--- a/test/operator-source.c
+++ b/test/operator-source.c
@@ -25,8 +25,8 @@
  *          Uli Schlachter <psychon at znc.in>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define WIDTH 16
diff --git a/test/path-append.c b/test/path-append.c
index bcd282d..bdcc63a 100644
--- a/test/path-append.c
+++ b/test/path-append.c
@@ -21,8 +21,8 @@
  * OF THIS SOFTWARE.
  */
 
-#include <stdlib.h>
 #include "cairo-test.h"
+#include <stdlib.h>
 
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
diff --git a/test/pattern-getters.c b/test/pattern-getters.c
index 28bc1f9..08508d7 100644
--- a/test/pattern-getters.c
+++ b/test/pattern-getters.c
@@ -24,8 +24,8 @@
  * Author: Vladimir Vukicevic <vladimir at pobox.com>
  */
 
-#include <stdlib.h>
 #include "cairo-test.h"
+#include <stdlib.h>
 
 #define CHECK_SUCCESS do { \
     if (status) { \
diff --git a/test/pdf-features.c b/test/pdf-features.c
index 0cc50ed..b9c2bd0 100644
--- a/test/pdf-features.c
+++ b/test/pdf-features.c
@@ -23,12 +23,12 @@
  * Author: Carl D. Worth <cworth at cworth.org>
  */
 
+#include "cairo-test.h"
+
 #include <stdio.h>
 #include <cairo.h>
 #include <cairo-pdf.h>
 
-#include "cairo-test.h"
-
 /* This test exists to test the various features of cairo-pdf.h.
  *
  * Currently, this test exercises the following function calls:
diff --git a/test/pixman-downscale.c b/test/pixman-downscale.c
index a57db02..6b653d2 100644
--- a/test/pixman-downscale.c
+++ b/test/pixman-downscale.c
@@ -29,13 +29,13 @@
  * Currently, this exercises several of pixman's scaling filters.
  */
 
+#include "cairo-test.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 
 #include <cairo.h>
 
-#include "cairo-test.h"
-
 static const char png_filename[] = "quad-color.png";
 
 /* Draw an image scaled down, with antialiasing disabled */
diff --git a/test/pixman-rotate.c b/test/pixman-rotate.c
index f412ce6..e0d0fc8 100644
--- a/test/pixman-rotate.c
+++ b/test/pixman-rotate.c
@@ -24,6 +24,8 @@
  * Author: Kristian Høgsberg <krh at redhat.com>
  */
 
+#include "cairo-test.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -31,8 +33,6 @@
 
 #include <cairo.h>
 
-#include "cairo-test.h"
-
 #define WIDTH	32
 #define HEIGHT	WIDTH
 
diff --git a/test/ps-features.c b/test/ps-features.c
index fe5de42..d1abf91 100644
--- a/test/ps-features.c
+++ b/test/ps-features.c
@@ -23,12 +23,12 @@
  * Author: Carl D. Worth <cworth at cworth.org>
  */
 
+#include "cairo-test.h"
+
 #include <stdio.h>
 #include <cairo.h>
 #include <cairo-ps.h>
 
-#include "cairo-test.h"
-
 /* This test exists to test the various features of cairo-ps.h.
  *
  * Currently, this test exercises the following function calls:
diff --git a/test/record-extend.c b/test/record-extend.c
index 5ecef44..8e83871 100644
--- a/test/record-extend.c
+++ b/test/record-extend.c
@@ -27,8 +27,8 @@
  *	Chris Wilson <chris at chris-wilson.co.uk>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 90
diff --git a/test/record-mesh.c b/test/record-mesh.c
index 2581ce7..754a1d4 100644
--- a/test/record-mesh.c
+++ b/test/record-mesh.c
@@ -29,8 +29,8 @@
  *	Chris Wilson <chris at chris-wilson.co.uk>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define PAT_WIDTH  170
diff --git a/test/select-font-no-show-text.c b/test/select-font-no-show-text.c
index 0b72415..b2b4796 100644
--- a/test/select-font-no-show-text.c
+++ b/test/select-font-no-show-text.c
@@ -38,8 +38,8 @@
  *  Fixed... just a stray free().
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
diff --git a/test/self-copy.c b/test/self-copy.c
index 32a375a..bef02e9 100644
--- a/test/self-copy.c
+++ b/test/self-copy.c
@@ -23,8 +23,8 @@
  * Author: Owen Taylor <otaylor at redhat.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 40
diff --git a/test/source-clip-scale.c b/test/source-clip-scale.c
index 375f9be..4eca206 100644
--- a/test/source-clip-scale.c
+++ b/test/source-clip-scale.c
@@ -23,8 +23,8 @@
  * Author: Vladimir Vukicevic <vladimir at pobox.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 12
diff --git a/test/source-clip.c b/test/source-clip.c
index cbb2855..0c00070 100644
--- a/test/source-clip.c
+++ b/test/source-clip.c
@@ -23,8 +23,8 @@
  * Author: Owen Taylor <otaylor at redhat.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 12
diff --git a/test/surface-pattern-scale-down.c b/test/surface-pattern-scale-down.c
index 639019c..95782ef 100644
--- a/test/surface-pattern-scale-down.c
+++ b/test/surface-pattern-scale-down.c
@@ -24,8 +24,8 @@
  * Author: Behdad Esfahbod <behdad at behdad.org>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 200
diff --git a/test/surface-pattern-scale-up.c b/test/surface-pattern-scale-up.c
index 26e75c8..0d71ba1 100644
--- a/test/surface-pattern-scale-up.c
+++ b/test/surface-pattern-scale-up.c
@@ -27,8 +27,8 @@
 /* Exhibits nasty behaviour with GS due as their /Interpolate implementation
  * does not function for rotated images. */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 100
diff --git a/test/surface-pattern.c b/test/surface-pattern.c
index ff95475..725f68d 100644
--- a/test/surface-pattern.c
+++ b/test/surface-pattern.c
@@ -24,8 +24,8 @@
  * Author: Behdad Esfahbod <behdad at behdad.org>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define SIZE 140
diff --git a/test/svg-clip.c b/test/svg-clip.c
index b39e29f..dff65f7 100644
--- a/test/svg-clip.c
+++ b/test/svg-clip.c
@@ -23,10 +23,11 @@
  * Author: Kristian Høgsberg <krh at redhat.com>
  */
 
+#include "cairo-test.h"
+
 #include <stdio.h>
 
 #include <cairo-svg.h>
-#include "cairo-test.h"
 
 /* Test SVG clipping */
 
diff --git a/test/svg-surface.c b/test/svg-surface.c
index 8ee3b61..13b006d 100644
--- a/test/svg-surface.c
+++ b/test/svg-surface.c
@@ -23,10 +23,11 @@
  * Author: Carl D. Worth <cworth at cworth.org>
  */
 
+#include "cairo-test.h"
+
 #include <stdio.h>
 
 #include <cairo-svg.h>
-#include "cairo-test.h"
 
 /* Pretty boring test just to make sure things aren't crashing ---
  * no verification that we're getting good results yet.
diff --git a/test/trap-clip.c b/test/trap-clip.c
index acfcafc..f1a24ca 100644
--- a/test/trap-clip.c
+++ b/test/trap-clip.c
@@ -23,8 +23,8 @@
  * Author: Kristian Høgsberg <krh at redhat.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define WIDTH 16
diff --git a/test/unbounded-operator.c b/test/unbounded-operator.c
index 6e132fb..ac1c50d 100644
--- a/test/unbounded-operator.c
+++ b/test/unbounded-operator.c
@@ -24,8 +24,8 @@
  *          Owen Taylor <otaylor at redhat.com>
  */
 
-#include <math.h>
 #include "cairo-test.h"
+#include <math.h>
 #include <stdio.h>
 
 #define WIDTH 16
diff --git a/test/user-font-mask.c b/test/user-font-mask.c
index a6d394e..cf548e6 100644
--- a/test/user-font-mask.c
+++ b/test/user-font-mask.c
@@ -26,11 +26,11 @@
  *	Adrian Johnson <ajohnson at redneon.com>
  */
 
+#include "cairo-test.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "cairo-test.h"
-
 /*#define ROTATED 1*/
 
 #define BORDER 10
diff --git a/test/user-font-proxy.c b/test/user-font-proxy.c
index 41a69e7..6a39d8e 100644
--- a/test/user-font-proxy.c
+++ b/test/user-font-proxy.c
@@ -25,11 +25,11 @@
  *	Behdad Esfahbod <behdad at behdad.org>
  */
 
+#include "cairo-test.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "cairo-test.h"
-
 /*#define ROTATED 1*/
 
 #define BORDER 10
diff --git a/test/user-font.c b/test/user-font.c
index 30bc74e..435d561 100644
--- a/test/user-font.c
+++ b/test/user-font.c
@@ -25,11 +25,11 @@
  *	Behdad Esfahbod <behdad at behdad.org>
  */
 
+#include "cairo-test.h"
+
 #include <stdlib.h>
 #include <stdio.h>
 
-#include "cairo-test.h"
-
 /*#define ROTATED 1*/
 
 #define BORDER 10
diff --git a/test/xcb-snapshot-assert.c b/test/xcb-snapshot-assert.c
index a674476..b578f8c 100644
--- a/test/xcb-snapshot-assert.c
+++ b/test/xcb-snapshot-assert.c
@@ -24,8 +24,8 @@
  * Author: Uli Schlachter <psychon at znc.in>
  */
 
-#include "cairo.h"
 #include "cairo-test.h"
+#include "cairo.h"
 
 static cairo_surface_t *
 create_image (int width, int height)
diff --git a/test/xlib-expose-event.c b/test/xlib-expose-event.c
index 4b1cb46..1de23e0 100644
--- a/test/xlib-expose-event.c
+++ b/test/xlib-expose-event.c
@@ -31,12 +31,12 @@
  * made the same mistake again, it is worth adding a regression test...
  */
 
+#include "cairo-test.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #include "cairo.h"
-#include "cairo-test.h"
 
 #include "buffer-diff.h"
 
diff --git a/test/xlib-surface.c b/test/xlib-surface.c
index 4edc44b..137b282 100644
--- a/test/xlib-surface.c
+++ b/test/xlib-surface.c
@@ -23,12 +23,13 @@
  * Author: Carl D. Worth <cworth at cworth.org>
  */
 
+#include "cairo-test.h"
+
 #include <stdio.h>
 #include <stdlib.h>
 
 #include "cairo.h"
 #include "cairo-xlib.h"
-#include "cairo-test.h"
 
 #include "cairo-boilerplate-xlib.h"
 
commit b0f3465d09869e483179a3bb92a16fe4f0d39e14
Author: Michael Haubenwallner <michael.haubenwallner at ssi-schaefer.com>
Date:   Thu Feb 26 16:24:55 2015 +0100

    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 at osg.samsung.com>

diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c
index b86bc36..4bdcd46 100644
--- a/perf/cairo-perf-report.c
+++ b/perf/cairo-perf-report.c
@@ -25,6 +25,8 @@
  * Authors: Carl Worth <cworth at cworth.org>
  */
 
+#define _GETDELIM 1/* for getline() on AIX */
+
 #include "cairo-missing.h"
 #include "cairo-perf.h"
 #include "cairo-stats.h"
commit 4cb6da119e5cc954161c6c10fc4cc6c3b70a407f
Author: Michael Haubenwallner <michael.haubenwallner at ssi-schaefer.com>
Date:   Thu Feb 26 15:23:01 2015 +0100

    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 at osg.samsung.com>

diff --git a/test/cairo-test-trace.c b/test/cairo-test-trace.c
index 52d9dd9..5badc43 100644
--- a/test/cairo-test-trace.c
+++ b/test/cairo-test-trace.c
@@ -91,6 +91,10 @@
 #include <fontconfig/fontconfig.h>
 #endif
 
+#ifndef MAP_NORESERVE
+#define MAP_NORESERVE 0
+#endif
+
 #define DEBUG 0
 
 #define ignore_image_differences 0 /* XXX make me a cmdline option! */
diff --git a/util/cairo-sphinx/sphinx.c b/util/cairo-sphinx/sphinx.c
index 3a6c04c..238d400 100644
--- a/util/cairo-sphinx/sphinx.c
+++ b/util/cairo-sphinx/sphinx.c
@@ -35,6 +35,10 @@
 # error "cairo-sphinx needs real pthreads"
 #endif
 
+#ifndef MAP_NORESERVE
+#define MAP_NORESERVE 0
+#endif
+
 #define DATA_SIZE (256 << 20)
 #define SHM_PATH_XXX "/shmem-cairo-sphinx"
 
commit 64b71a1fe6724a6ff3b3188808dd3ce82fcea13e
Author: Michael Haubenwallner <michael.haubenwallner at ssi-schaefer.com>
Date:   Thu Feb 26 14:18:30 2015 +0100

    fix conflicting types for 'sync' on AIX, bug#89338

diff --git a/src/cairo-surface-observer.c b/src/cairo-surface-observer.c
index 6721bf5..52b0136 100644
--- a/src/cairo-surface-observer.c
+++ b/src/cairo-surface-observer.c
@@ -653,7 +653,7 @@ add_record (cairo_observation_t *log,
 }
 
 static void
-sync (cairo_surface_t *target, int x, int y)
+_cairo_surface_sync (cairo_surface_t *target, int x, int y)
 {
     cairo_rectangle_int_t extents;
 
@@ -751,7 +751,7 @@ _cairo_surface_observer_paint (void *abstract_surface,
     if (unlikely (status))
 	return status;
 
-    sync (surface->target, x, y);
+    _cairo_surface_sync (surface->target, x, y);
     t = _cairo_time_get_delta (t);
 
     add_record_paint (&surface->log, surface->target, op, source, clip, t);
@@ -837,7 +837,7 @@ _cairo_surface_observer_mask (void *abstract_surface,
     if (unlikely (status))
 	return status;
 
-    sync (surface->target, x, y);
+    _cairo_surface_sync (surface->target, x, y);
     t = _cairo_time_get_delta (t);
 
     add_record_mask (&surface->log,
@@ -944,7 +944,7 @@ _cairo_surface_observer_fill (void			*abstract_surface,
     if (unlikely (status))
 	return status;
 
-    sync (surface->target, x, y);
+    _cairo_surface_sync (surface->target, x, y);
     t = _cairo_time_get_delta (t);
 
     add_record_fill (&surface->log,
@@ -1063,7 +1063,7 @@ _cairo_surface_observer_stroke (void				*abstract_surface,
     if (unlikely (status))
 	return status;
 
-    sync (surface->target, x, y);
+    _cairo_surface_sync (surface->target, x, y);
     t = _cairo_time_get_delta (t);
 
     add_record_stroke (&surface->log,
@@ -1183,7 +1183,7 @@ _cairo_surface_observer_glyphs (void			*abstract_surface,
     if (unlikely (status))
 	return status;
 
-    sync (surface->target, x, y);
+    _cairo_surface_sync (surface->target, x, y);
     t = _cairo_time_get_delta (t);
 
     add_record_glyphs (&surface->log,
diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
index 84b46d8..fb40699 100644
--- a/src/cairo-xlib-surface-shm.c
+++ b/src/cairo-xlib-surface-shm.c
@@ -453,7 +453,7 @@ static void send_event(cairo_xlib_display_t *display,
     display->shm->last_event = ev.serial;
 }
 
-static void sync (cairo_xlib_display_t *display)
+static void _cairo_xlib_display_sync (cairo_xlib_display_t *display)
 {
     cairo_xlib_shm_info_t *info;
     struct pqueue *pq = &display->shm->info;
@@ -949,7 +949,7 @@ _cairo_xlib_surface_update_shm (cairo_xlib_surface_t *surface)
 	XChangeGC (display->display, gc, GCSubwindowMode, &gcv);
     }
 
-    sync (display);
+    _cairo_xlib_display_sync (display);
     shm->active = 0;
     shm->idle--;
 
commit 4e7f1621df76d3cd948632b9409f4d2ffcfae3eb
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Tue Dec 9 16:13:00 2014 +0100

    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

diff --git a/src/cairo-quartz-font.c b/src/cairo-quartz-font.c
index e6a379a..02f3426 100644
--- a/src/cairo-quartz-font.c
+++ b/src/cairo-quartz-font.c
@@ -81,9 +81,6 @@ static void (*CGFontGetGlyphsForUnicharsPtr) (CGFontRef, const UniChar[], const
 static void (*CGContextSetAllowsFontSmoothingPtr) (CGContextRef, bool) = NULL;
 static bool (*CGContextGetAllowsFontSmoothingPtr) (CGContextRef) = NULL;
 
-/* Not public in the least bit */
-static CGPathRef (*CGFontGetGlyphPathPtr) (CGFontRef fontRef, CGAffineTransform *textTransform, int unknown, CGGlyph glyph) = NULL;
-
 /* CGFontGetHMetrics isn't public, but the other functions are public/present in 10.5 */
 typedef struct {
     int ascent;
@@ -127,7 +124,6 @@ quartz_font_ensure_symbols(void)
     /* These have the same name in 10.4 and 10.5 */
     CGFontGetUnitsPerEmPtr = dlsym(RTLD_DEFAULT, "CGFontGetUnitsPerEm");
     CGFontGetGlyphAdvancesPtr = dlsym(RTLD_DEFAULT, "CGFontGetGlyphAdvances");
-    CGFontGetGlyphPathPtr = dlsym(RTLD_DEFAULT, "CGFontGetGlyphPath");
 
     CGFontGetHMetricsPtr = dlsym(RTLD_DEFAULT, "CGFontGetHMetrics");
     CGFontGetAscentPtr = dlsym(RTLD_DEFAULT, "CGFontGetAscent");
@@ -144,7 +140,6 @@ quartz_font_ensure_symbols(void)
 	CGFontGetGlyphsForUnicharsPtr &&
 	CGFontGetUnitsPerEmPtr &&
 	CGFontGetGlyphAdvancesPtr &&
-	CGFontGetGlyphPathPtr &&
 	(CGFontGetHMetricsPtr || (CGFontGetAscentPtr && CGFontGetDescentPtr && CGFontGetLeadingPtr)))
 	_cairo_quartz_font_symbols_present = TRUE;
 
@@ -550,6 +545,7 @@ _cairo_quartz_init_glyph_path (cairo_quartz_scaled_font_t *font,
     CGGlyph glyph = _cairo_quartz_scaled_glyph_index (scaled_glyph);
     CGAffineTransform textMatrix;
     CGPathRef glyphPath;
+    CTFontRef ctFont;
     cairo_path_fixed_t *path;
 
     if (glyph == INVALID_GLYPH) {
@@ -564,7 +560,9 @@ _cairo_quartz_init_glyph_path (cairo_quartz_scaled_font_t *font,
 					-font->base.scale.yy,
 					0, 0);
 
-    glyphPath = CGFontGetGlyphPathPtr (font_face->cgFont, &textMatrix, 0, glyph);
+    ctFont = CTFontCreateWithGraphicsFont (font_face->cgFont, 0.0, NULL, NULL);
+    glyphPath = CTFontCreatePathForGlyph (ctFont, glyph, &textMatrix);
+    CFRelease (ctFont);
     if (!glyphPath)
 	return CAIRO_INT_STATUS_UNSUPPORTED;
 
commit d4a4705898a44cde085629686921bd4440bb3002
Author: Massimo Valentini <mvalentini at src.gnome.org>
Date:   Wed Sep 11 18:10:38 2013 +0200

    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 at osg.samsung.com>

diff --git a/src/win32/cairo-win32-display-surface.c b/src/win32/cairo-win32-display-surface.c
index 5ecdbee..965f2c4 100644
--- a/src/win32/cairo-win32-display-surface.c
+++ b/src/win32/cairo-win32-display-surface.c
@@ -455,17 +455,17 @@ _cairo_win32_display_surface_map_to_image (void                    *abstract_sur
 	surface->fallback =
 	    _cairo_win32_display_surface_create_for_dc (surface->win32.dc,
 							surface->win32.format,
-							surface->win32.extents.width,
-							surface->win32.extents.height);
+							surface->win32.extents.x + surface->win32.extents.width,
+							surface->win32.extents.y + surface->win32.extents.height);
 	if (unlikely (status = surface->fallback->status))
 	    goto err;
 
 	if (!BitBlt (to_win32_surface(surface->fallback)->dc,
-		     0, 0,
+		     surface->win32.extents.x, surface->win32.extents.y,
 		     surface->win32.extents.width,
 		     surface->win32.extents.height,
 		     surface->win32.dc,
-		     0, 0,
+		     surface->win32.extents.x, surface->win32.extents.y,
 		     SRCCOPY)) {
 	    status = _cairo_error (CAIRO_STATUS_DEVICE_ERROR);
 	    goto err;
commit 58897cbe917e44f8802eac751805389958a499df
Author: Emanuele Aina <emanuele.aina at collabora.com>
Date:   Tue Dec 16 14:58:55 2014 +0100

    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 at collabora.com>

diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 4d34826..d5d7668 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -3738,8 +3738,7 @@ cairo_surface_create_similar_image (cairo_surface_t *other,
 	else
 	    _trace_printf ("%d index ",
 			   current_stack_depth - other_obj->operand - 1);
-	_trace_printf ("s%ld //%s %d %d similar-image %% s%ld\n",
-		       _get_surface_id (other),
+	_trace_printf ("//%s %d %d similar-image %% s%ld\n",
 		       _format_to_string (format),
 		       width, height,
 		       new_obj->token);
commit 94adea3455576af81745e470411b39feac6d53f2
Author: Uli Schlachter <psychon at znc.in>
Date:   Sat Dec 6 17:04:07 2014 +0100

    xlib-xcb: Don't be lazy and use the real xcb_screen_t
    
    Signed-off-by: Uli Schlachter <psychon at znc.in>

diff --git a/src/cairo-xlib-xcb-surface.c b/src/cairo-xlib-xcb-surface.c
index 9c0d4b4..af3e155 100644
--- a/src/cairo-xlib-xcb-surface.c
+++ b/src/cairo-xlib-xcb-surface.c
@@ -519,21 +519,6 @@ cairo_xlib_surface_create (Display     *dpy,
 								     width, height));
 }
 
-cairo_surface_t *
-cairo_xlib_surface_create_for_bitmap (Display  *dpy,
-				      Pixmap	bitmap,
-				      Screen   *scr,
-				      int	width,
-				      int	height)
-{
-    return _cairo_xlib_xcb_surface_create (dpy, scr, NULL, NULL,
-					   cairo_xcb_surface_create_for_bitmap (XGetXCBConnection (dpy),
-										(xcb_screen_t *) scr,
-										bitmap,
-										width, height));
-}
-
-#if CAIRO_HAS_XLIB_XRENDER_SURFACE
 static xcb_screen_t *
 _cairo_xcb_screen_from_root (xcb_connection_t *connection,
 			     xcb_window_t id)
@@ -548,6 +533,24 @@ _cairo_xcb_screen_from_root (xcb_connection_t *connection,
 
     return NULL;
 }
+
+cairo_surface_t *
+cairo_xlib_surface_create_for_bitmap (Display  *dpy,
+				      Pixmap	bitmap,
+				      Screen   *scr,
+				      int	width,
+				      int	height)
+{
+    xcb_connection_t *connection = XGetXCBConnection (dpy);
+    xcb_screen_t *screen = _cairo_xcb_screen_from_root (connection, (xcb_window_t) scr->root);
+    return _cairo_xlib_xcb_surface_create (dpy, scr, NULL, NULL,
+					   cairo_xcb_surface_create_for_bitmap (connection,
+										screen,
+										bitmap,
+										width, height));
+}
+
+#if CAIRO_HAS_XLIB_XRENDER_SURFACE
 cairo_surface_t *
 cairo_xlib_surface_create_with_xrender_format (Display		    *dpy,
 					       Drawable		    drawable,
commit fc648fb58f11a692053e95b33c125c1994d33b4f
Author: Uli Schlachter <psychon at znc.in>
Date:   Sat Dec 6 16:04:46 2014 +0100

    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 at znc.in>

diff --git a/src/cairo-xcb-connection.c b/src/cairo-xcb-connection.c
index 2d51e14..67897fa 100644
--- a/src/cairo-xcb-connection.c
+++ b/src/cairo-xcb-connection.c
@@ -79,6 +79,7 @@ typedef struct _cairo_xcb_xid {
 #define XCB_RENDER_HAS_FILTERS(surface)			XCB_RENDER_AT_LEAST((surface), 0, 6)
 #define XCB_RENDER_HAS_FILTER_GOOD(surface) FALSE
 #define XCB_RENDER_HAS_FILTER_BEST(surface) FALSE
+#define XCB_RENDER_HAS_SUBPIXEL_ORDER(surface)		XCB_RENDER_AT_LEAST((surface), 0, 6)
 
 #define XCB_RENDER_HAS_EXTENDED_REPEAT(surface)	XCB_RENDER_AT_LEAST((surface), 0, 10)
 #define XCB_RENDER_HAS_GRADIENTS(surface)	XCB_RENDER_AT_LEAST((surface), 0, 10)
@@ -407,6 +408,15 @@ _cairo_xcb_connection_query_render (cairo_xcb_connection_t *connection)
     if (XCB_RENDER_HAS_GRADIENTS (version))
 	connection->flags |= CAIRO_XCB_RENDER_HAS_GRADIENTS;
 
+    if (XCB_RENDER_HAS_SUBPIXEL_ORDER (version)) {
+	uint32_t screen;
+	uint32_t *subpixel = xcb_render_query_pict_formats_subpixels(formats);
+
+	/* The spec explicitly allows to have too few entries in the reply... */
+	for (screen = 0; screen < formats->num_subpixel && screen < connection->root->roots_len; screen++)
+	    connection->subpixel_orders[screen] = subpixel[screen];
+    }
+
     free (version);
 
     status = _cairo_xcb_connection_parse_xrender_formats (connection, formats);
@@ -581,6 +591,7 @@ _device_destroy (void *device)
     CAIRO_MUTEX_FINI (connection->shm_mutex);
     CAIRO_MUTEX_FINI (connection->screens_mutex);
 
+    free (connection->subpixel_orders);
     free (connection);
 }
 
@@ -684,6 +695,14 @@ _cairo_xcb_connection_get (xcb_connection_t *xcb_connection)
 
     connection->root = xcb_get_setup (xcb_connection);
     connection->render = NULL;
+    connection->subpixel_orders = calloc (connection->root->roots_len, sizeof(*connection->subpixel_orders));
+    if (unlikely (connection->subpixel_orders == NULL)) {
+	CAIRO_MUTEX_UNLOCK (connection->device.mutex);
+	_cairo_xcb_connection_destroy (connection);
+	connection = NULL;
+	goto unlock;
+    }
+
     ext = xcb_get_extension_data (xcb_connection, &xcb_render_id);
     if (ext != NULL && ext->present) {
 	status = _cairo_xcb_connection_query_render (connection);
diff --git a/src/cairo-xcb-private.h b/src/cairo-xcb-private.h
index 1e1d1ee..214fa45 100644
--- a/src/cairo-xcb-private.h
+++ b/src/cairo-xcb-private.h
@@ -181,7 +181,8 @@ struct _cairo_xcb_font {
 struct _cairo_xcb_screen {
     cairo_xcb_connection_t *connection;
 
-    xcb_screen_t	    *xcb_screen;
+    xcb_screen_t	   *xcb_screen;
+    xcb_render_sub_pixel_t  subpixel_order;
 
     xcb_gcontext_t gc[GC_CACHE_SIZE];
     uint8_t gc_depths[GC_CACHE_SIZE];
@@ -223,6 +224,7 @@ struct _cairo_xcb_connection {
     const xcb_setup_t *root;
     const xcb_query_extension_reply_t *render;
     const xcb_query_extension_reply_t *shm;
+    xcb_render_sub_pixel_t *subpixel_orders;
 
     cairo_list_t free_xids;
     cairo_freepool_t xid_pool;
diff --git a/src/cairo-xcb-resources.c b/src/cairo-xcb-resources.c
index 62c27ef..1877758 100644
--- a/src/cairo-xcb-resources.c
+++ b/src/cairo-xcb-resources.c
@@ -251,21 +251,13 @@ get_resources(xcb_connection_t *connection, xcb_screen_t *screen, cairo_xcb_reso
     resource_parser_done (&parser);
 }
 
-#if 0 && XCB_RENDER_MAJOR_VERSION > 99 && XCB_RENDER_MINOR_VERSION > 99
-static void
-get_rgba_from_render (xcb_connection_t *connection, xcb_screen_t *screen, cairo_xcb_resources_t *resources)
+void
+_cairo_xcb_resources_get (cairo_xcb_screen_t *screen, cairo_xcb_resources_t *resources)
 {
-    /* this is a mock-up of what the function might look like,
-       xcb_render_query_sub_pixel is not actually implemented in XCB (yet) */
-
-    xcb_render_query_sub_pixel_order_cookie_t cookie;
-    xcb_render_query_sub_pixel_order_reply_t *reply;
-
-    cookie = xcb_render_query_sub_pixel (connection, screen);
-    reply = xcb_render_query_sub_pixel_reply (connection, cookie, NULL);
+    get_resources (screen->connection->xcb_connection, screen->xcb_screen, resources);
 
-    if (reply) {
-	switch (reply->sub_pixel_order) {
+    if (resources->xft_rgba == FC_RGBA_UNKNOWN) {
+	switch (screen->subpixel_order) {
 	case XCB_RENDER_SUB_PIXEL_UNKNOWN:
 	    resources->xft_rgba = FC_RGBA_UNKNOWN;
 	    break;
@@ -285,20 +277,5 @@ get_rgba_from_render (xcb_connection_t *connection, xcb_screen_t *screen, cairo_
 	    resources->xft_rgba = FC_RGBA_NONE;
 	    break;
 	}
-
-	free(reply);
     }
 }
-#endif
-
-void
-_cairo_xcb_resources_get (cairo_xcb_screen_t *screen, cairo_xcb_resources_t *resources)
-{
-    get_resources (screen->connection->xcb_connection, screen->xcb_screen, resources);
-
-#if 0 && XCB_RENDER_MAJOR_VERSION > 99 && XCB_RENDER_MINOR_VERSION > 99
-    if (resources->xft_rgba == FC_RGBA_UNKNOWN) {
-	get_rgba_from_render (screen->connection->xcb_connection, screen->xcb_screen, resources);
-    }
-#endif
-}
diff --git a/src/cairo-xcb-screen.c b/src/cairo-xcb-screen.c
index 69ea459..d0019f9 100644
--- a/src/cairo-xcb-screen.c
+++ b/src/cairo-xcb-screen.c
@@ -207,6 +207,18 @@ _pattern_cache_entry_destroy (void *closure)
     _cairo_freelist_free (&entry->screen->pattern_cache_entry_freelist, entry);
 }
 
+static int _get_screen_index(cairo_xcb_connection_t *xcb_connection,
+			     xcb_screen_t *xcb_screen)
+{
+    int idx = 0;
+    xcb_screen_iterator_t iter = xcb_setup_roots_iterator(xcb_connection->root);
+    for (; iter.rem; xcb_screen_next(&iter), idx++)
+	if (iter.data->root == xcb_screen->root)
+	    return idx;
+
+    ASSERT_NOT_REACHED;
+}
+
 cairo_xcb_screen_t *
 _cairo_xcb_screen_get (xcb_connection_t *xcb_connection,
 		       xcb_screen_t *xcb_screen)
@@ -214,6 +226,7 @@ _cairo_xcb_screen_get (xcb_connection_t *xcb_connection,
     cairo_xcb_connection_t *connection;
     cairo_xcb_screen_t *screen;
     cairo_status_t status;
+    int screen_idx;
     int i;
 
     connection = _cairo_xcb_connection_get (xcb_connection);
@@ -240,9 +253,12 @@ _cairo_xcb_screen_get (xcb_connection_t *xcb_connection,
     if (unlikely (screen == NULL))
 	goto unlock;
 
+    screen_idx = _get_screen_index(connection, xcb_screen);
+
     screen->connection = connection;
     screen->xcb_screen = xcb_screen;
     screen->has_font_options = FALSE;
+    screen->subpixel_order = connection->subpixel_orders[screen_idx];
 
     _cairo_freelist_init (&screen->pattern_cache_entry_freelist,
 			  sizeof (struct pattern_cache_entry));
commit 226e135714bdb0c556a47cc77b19b550e0d78ff6
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Mon Dec 22 12:49:00 2014 +0100

    font: Actually perform destruction of fonts
    
    Commit 337ab1f8d9e29086bfb4001508b28835b41c6390 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

diff --git a/src/cairo-font-face.c b/src/cairo-font-face.c
index e32a9bb..3bcd2a1 100644
--- a/src/cairo-font-face.c
+++ b/src/cairo-font-face.c
@@ -128,7 +128,8 @@ cairo_font_face_reference (cairo_font_face_t *font_face)
 }
 slim_hidden_def (cairo_font_face_reference);
 
-static inline int __put(cairo_reference_count_t *v)
+static inline cairo_bool_t
+__put(cairo_reference_count_t *v)
 {
     int c, old;
 
@@ -136,7 +137,7 @@ static inline int __put(cairo_reference_count_t *v)
     while (c != 1 && (old = _cairo_atomic_int_cmpxchg_return_old(&v->ref_count, c, c - 1)) != c)
 	c = old;
 
-    return c;
+    return c != 1;
 }
 
 cairo_bool_t
commit aee44760a8b49ea8bc6017a1e7cc192aa9d3fff1
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Dec 31 10:54:43 2014 +0000

    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 at src.gnome.org>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87898
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c
index 81cc028..1591f58 100644
--- a/src/cairo-xlib-source.c
+++ b/src/cairo-xlib-source.c
@@ -869,11 +869,14 @@ recording_pattern_get_surface (const cairo_pattern_t *pattern)
     cairo_surface_t *surface;
 
     surface = ((const cairo_surface_pattern_t *) pattern)->surface;
+
     if (_cairo_surface_is_paginated (surface))
-	surface = _cairo_paginated_surface_get_recording (surface);
+	return cairo_surface_reference (_cairo_paginated_surface_get_recording (surface));
+
     if (_cairo_surface_is_snapshot (surface))
-	surface = _cairo_surface_snapshot_get_target (surface);
-    return surface;
+	return _cairo_surface_snapshot_get_target (surface);
+
+    return cairo_surface_reference (surface);
 }
 
 static cairo_surface_t *
@@ -885,6 +888,7 @@ record_source (cairo_xlib_surface_t *dst,
 	       int *src_x, int *src_y)
 {
     cairo_xlib_surface_t *src;
+    cairo_surface_t *recording;
     cairo_matrix_t matrix, m;
     cairo_status_t status;
     cairo_rectangle_int_t upload, limit;
@@ -911,9 +915,11 @@ record_source (cairo_xlib_surface_t *dst,
     }
 
     cairo_matrix_init_translate (&matrix, upload.x, upload.y);
-    status = _cairo_recording_surface_replay_with_clip (recording_pattern_get_surface (&pattern->base),
+    recording = recording_pattern_get_surface (&pattern->base),
+    status = _cairo_recording_surface_replay_with_clip (recording,
 							&matrix, &src->base,
 							NULL);
+    cairo_surface_destroy (recording);
     if (unlikely (status)) {
 	cairo_surface_destroy (&src->base);
 	return _cairo_surface_create_in_error (status);
commit a8010c41ec98d7887bfddf42b4ce962f808868b0
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Nov 20 17:22:30 2014 +0100

    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 at osg.samsung.com>

diff --git a/test/cairo-test-runner.c b/test/cairo-test-runner.c
index 3fb3ae5..f9e7d47 100644
--- a/test/cairo-test-runner.c
+++ b/test/cairo-test-runner.c
@@ -1096,6 +1096,7 @@ main (int argc, char **argv)
 
     _runner_print_results (&runner);
 
+    _list_free (tests);
     free (target_status);
     return _runner_fini (&runner);
 }
commit 671dc9fc244e5447a04dc60a4d99a5ba5afd71f6
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Nov 20 17:22:31 2014 +0100

    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 at osg.samsung.com>

diff --git a/test/api-special-cases.c b/test/api-special-cases.c
index e861152..c4a754d 100644
--- a/test/api-special-cases.c
+++ b/test/api-special-cases.c
@@ -181,7 +181,9 @@ test_cairo_set_operator (cairo_t *cr)
 static cairo_test_status_t
 test_cairo_set_source (cairo_t *cr)
 {
-    cairo_set_source (cr, cairo_pattern_create_rgb (0, 0, 0));
+    cairo_pattern_t *source = cairo_pattern_create_rgb (0, 0, 0);
+    cairo_set_source (cr, source);
+    cairo_pattern_destroy (source);
 
     return CAIRO_TEST_SUCCESS;
 }
commit 0a4bae2b8c095378cc3521d322d3d4ad36eb8a61
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Wed Dec 3 19:28:15 2014 -0800

    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 at gmail.com> on mailing list.
    
    Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>

diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c
index 6ff0f09..48072f8 100644
--- a/src/cairo-image-compositor.c
+++ b/src/cairo-image-compositor.c
@@ -2242,10 +2242,10 @@ _fill_xrgb32_lerp_opaque_spans (void *abstract_renderer, int y, int h,
 				     spans[0].x, y, len, 1, r->u.fill.pixel);
 		    } else {
 			uint32_t *d = (uint32_t*)(r->u.fill.data + r->u.fill.stride*y + spans[0].x*4);
-			while (len--)
+			while (len-- > 0)
 			    *d++ = r->u.fill.pixel;
 		    }
-		} else while (len--) {
+		} else while (len-- > 0) {
 		    *d = lerp8x4 (r->u.fill.pixel, a, *d);
 		    d++;
 		}
commit 6f42cbd163add33afafbf8838a09c8150e46ae1e
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Thu Nov 20 12:19:47 2014 -0800

    Refactor ARRAY_LENGTH macro definitions in test code

diff --git a/boilerplate/cairo-boilerplate-pdf.c b/boilerplate/cairo-boilerplate-pdf.c
index d76d139..177cdf1 100644
--- a/boilerplate/cairo-boilerplate-pdf.c
+++ b/boilerplate/cairo-boilerplate-pdf.c
@@ -54,8 +54,6 @@ typedef struct _pdf_target_closure
     cairo_surface_t	*target;
 } pdf_target_closure_t;
 
-#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
-
 static cairo_surface_t *
 _cairo_boilerplate_pdf_create_surface (const char		 *name,
 				       cairo_content_t		  content,
diff --git a/boilerplate/cairo-boilerplate-private.h b/boilerplate/cairo-boilerplate-private.h
index a7a2dd0..d16a645 100644
--- a/boilerplate/cairo-boilerplate-private.h
+++ b/boilerplate/cairo-boilerplate-private.h
@@ -41,7 +41,7 @@ _cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets,
 void _register_##name__ (void); \
 void _register_##name__ (void) { \
     _cairo_boilerplate_register_backend (targets__, \
-					 sizeof (targets__) / sizeof (targets__[0])); \
+					 ARRAY_LENGTH(targets__)); \
 }
 
 #define CAIRO_NO_BOILERPLATE(name__) \
diff --git a/boilerplate/cairo-boilerplate.h b/boilerplate/cairo-boilerplate.h
index 4f6b8fd..515bb03 100644
--- a/boilerplate/cairo-boilerplate.h
+++ b/boilerplate/cairo-boilerplate.h
@@ -94,6 +94,10 @@
 #define M_PI 3.14159265358979323846
 #endif
 
+#ifndef ARRAY_LENGTH
+#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
+#endif
+
 CAIRO_BEGIN_DECLS
 
 /* A fake format we use for the flattened ARGB output of the PS and
diff --git a/perf/cairo-perf.h b/perf/cairo-perf.h
index b32b0e0..eb53d13 100644
--- a/perf/cairo-perf.h
+++ b/perf/cairo-perf.h
@@ -203,10 +203,6 @@ test_report_cmp_name (const void *a,
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 #endif
 
-#ifndef ARRAY_LENGTH
-#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
-#endif
-
 CAIRO_PERF_DECL (fill);
 CAIRO_PERF_DECL (paint);
 CAIRO_PERF_DECL (paint_with_alpha);
diff --git a/test/any2ppm.c b/test/any2ppm.c
index 665314f..b60b4d9 100644
--- a/test/any2ppm.c
+++ b/test/any2ppm.c
@@ -100,7 +100,7 @@
 #endif
 #endif
 
-#define ARRAY_LENGTH(A) (sizeof (A) / sizeof (A[0]))
+#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
 
 static int
 _cairo_writen (int fd, char *buf, int len)
diff --git a/test/cairo-test.c b/test/cairo-test.c
index 8dbf4c6..a351b01 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -83,10 +83,6 @@
 #define TRUE !FALSE
 #endif
 
-#ifndef ARRAY_LENGTH
-#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
-#endif
-
 #if ! HAVE_ALARM || ! defined(SIGALRM)
 #define alarm(X);
 #endif
diff --git a/test/cairo-test.h b/test/cairo-test.h
index c753728..7e9605f 100644
--- a/test/cairo-test.h
+++ b/test/cairo-test.h
@@ -107,10 +107,6 @@ cairo_test_NaN (void)
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
 #endif
 
-#ifndef ARRAY_LENGTH
-#define ARRAY_LENGTH(__array) ((int) (sizeof (__array) / sizeof (__array[0])))
-#endif
-
 #define CAIRO_TEST_OUTPUT_DIR "output"
 
 #define CAIRO_TEST_LOG_SUFFIX ".log"
commit 5ac87db3bad5e002df5bd49fc730c85199db5e64
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Fri Nov 14 18:10:16 2014 -0800

    test: Use ARRAY_LENGTH macro

diff --git a/test/bug-spline.c b/test/bug-spline.c
index 00a915c..9a54a7c 100644
--- a/test/bug-spline.c
+++ b/test/bug-spline.c
@@ -56,7 +56,6 @@ static const struct spline {
 	{ 1, 0, 0, 1 },
     }
 };
-#define NUM_SPLINES (sizeof(splines)/sizeof(splines[0]))
 
 static cairo_test_status_t
 draw (cairo_t *cr, int width, int height)
@@ -68,7 +67,7 @@ draw (cairo_t *cr, int width, int height)
 
     cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE);
 
-    for (n = 0; n < NUM_SPLINES; n++) {
+    for (n = 0; n < ARRAY_LENGTH(splines); n++) {
 	cairo_set_line_width (cr, splines[n].line_width);
 	cairo_set_source_rgba (cr,
 			       splines[n].rgba[0],
diff --git a/test/caps-tails-curve.c b/test/caps-tails-curve.c
index 25e5819..fa6aded 100644
--- a/test/caps-tails-curve.c
+++ b/test/caps-tails-curve.c
@@ -100,7 +100,7 @@ draw (cairo_t *cr, int width, int height)
 
     cairo_set_line_width (cr, LINE_WIDTH);
 
-    for (t = 0; t < sizeof(theta)/sizeof (theta[0]); t++) {
+    for (t = 0; t < ARRAY_LENGTH(theta); t++) {
 	cairo_save (cr);
 	cairo_translate (cr, 0, t * (SIZE + PAD) + PAD);
 	draw_caps_joins (cr, theta[t]);
diff --git a/test/tiger.c b/test/tiger.c
index 6f45f1f..059bb84 100644
--- a/test/tiger.c
+++ b/test/tiger.c
@@ -37,7 +37,7 @@ draw (cairo_t *cr, int width, int height)
 	cairo_translate (cr, width/2, height/2);
 	cairo_scale (cr, .85, .85);
 
-	for (i = 0; i < sizeof (tiger_commands)/sizeof(tiger_commands[0]);i++) {
+	for (i = 0; i < ARRAY_LENGTH(tiger_commands); i++) {
 		const struct command *cmd = &tiger_commands[i];
 		switch (cmd->type) {
 		case 'm':
commit 650d044dfdbb5ea5849d65b70f5761b8f47f75d6
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Thu Nov 20 10:16:06 2014 +1030

    pdf-operators: fix bug with RTL text
    
    bug 86461

diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c
index ee41eba..dcee25f 100644
--- a/src/cairo-pdf-operators.c
+++ b/src/cairo-pdf-operators.c
@@ -1415,7 +1415,11 @@ _cairo_pdf_operators_emit_cluster (cairo_pdf_operators_t      *pdf_operators,
 	    return status;
     }
 
-    cur_glyph = glyphs;
+    if (cluster_flags & CAIRO_TEXT_CLUSTER_FLAG_BACKWARD)
+	cur_glyph = glyphs + num_glyphs - 1;
+    else
+	cur_glyph = glyphs;
+
     /* XXX
      * If no glyphs, we should put *something* here for the text to be selectable. */
     for (i = 0; i < num_glyphs; i++) {
commit fe6b1db26c4f9e77b8625f3c2634b69897b7a5dc
Author: Ravi Nanjundappa <nravi.n at samsung.com>
Date:   Tue Nov 11 15:07:57 2014 +0530

    Fix one more warning from check-doc-syntax.sh
    
    $ ./check-doc-syntax.sh
    Checking documentation for incorrect syntax
    ./cairo-pattern.c (3342): ERROR: Will invalid doc id (should be 'cairo_...:')
    
    The proposed changes fixes the warning about the documentation style used in cairo.
    
    Signed-off-by: Ravi Nanjundappa <nravi.n at samsung.com>

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 4e3617a..ac5d7af 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -3338,12 +3338,12 @@ _cairo_pattern_is_clear (const cairo_pattern_t *abstract_pattern)
     return FALSE;
 }
 
-/**
+/*
  * Will given row of back-translation matrix work with bilinear scale?
  * This is true for scales larger than 1. Also it was judged acceptable
  * for scales larger than .75. And if there is integer translation
  * then a scale of exactly .5 works.
- **/
+ */
 static int
 use_bilinear(double x, double y, double t)
 {
commit bd2b4ab43ee1a88ec9e4063a4f4598e12b2742e7
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 31 13:21:15 2014 -0400

    xcb: Don't crash when swapping a 0-sized glyph
    
    malloc(0) needn't return NULL, and on glibc, doesn't.  Then we encounter
    a loop of the form do { ... } while (--c), which doesn't do quite what
    you were hoping for when c is initially 0.
    
    Since there's nothing to swap in this case, just bomb out.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/src/cairo-xcb-surface-render.c b/src/cairo-xcb-surface-render.c
index b35bf4d..044339b 100644
--- a/src/cairo-xcb-surface-render.c
+++ b/src/cairo-xcb-surface-render.c
@@ -4470,6 +4470,9 @@ _cairo_xcb_surface_add_glyph (cairo_xcb_connection_t *connection,
 	    const uint8_t *d;
 	    uint8_t *new, *n;
 
+	    if (c == 0)
+		break;
+
 	    new = malloc (c);
 	    if (unlikely (new == NULL)) {
 		status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
@@ -4498,6 +4501,9 @@ _cairo_xcb_surface_add_glyph (cairo_xcb_connection_t *connection,
 	    const uint32_t *d;
 	    uint32_t *new, *n;
 
+	    if (c == 0)
+		break;
+
 	    new = malloc (4 * c);
 	    if (unlikely (new == NULL)) {
 		status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
commit 40f1da3b4228339f7d5c91ea43d4af1e06a4ae2a
Author: Adam Jackson <ajax at redhat.com>
Date:   Fri Oct 31 13:21:14 2014 -0400

    xlib: Don't crash when swapping a 0-sized glyph
    
    malloc(0) needn't return NULL, and on glibc, doesn't.  Then we encounter
    a loop of the form do { ... } while (--c), which doesn't do quite what
    you were hoping for when c is initially 0.
    
    Since there's nothing to swap in this case, just bomb out.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/src/cairo-xlib-render-compositor.c b/src/cairo-xlib-render-compositor.c
index e90df09..8a1ec7b 100644
--- a/src/cairo-xlib-render-compositor.c
+++ b/src/cairo-xlib-render-compositor.c
@@ -1287,6 +1287,9 @@ _cairo_xlib_surface_add_glyph (cairo_xlib_display_t *display,
 	    unsigned char   *d;
 	    unsigned char   *new, *n;
 
+	    if (c == 0)
+		break;
+
 	    new = malloc (c);
 	    if (!new) {
 		status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
@@ -1312,6 +1315,9 @@ _cairo_xlib_surface_add_glyph (cairo_xlib_display_t *display,
 	    const uint32_t *d;
 	    uint32_t *new, *n;
 
+	    if (c == 0)
+		break;
+
 	    new = malloc (4 * c);
 	    if (unlikely (new == NULL)) {
 		status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
commit ce08735c06515225f4de6cd9cd1d4858c2be034d
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Oct 31 22:43:32 2014 +1030

    Improve performance of cpu_to_be32 and be32_to_cpu
    
    By switching to the more common form, gcc and clang emit a single
    bswap instruction and truetype subsetting of large fonts runs about
    15% faster.

diff --git a/src/cairoint.h b/src/cairoint.h
index 07ced42..5bca003 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -229,7 +229,7 @@ be16_to_cpu(uint16_t v)
 static inline uint32_t cairo_const
 cpu_to_be32(uint32_t v)
 {
-    return (cpu_to_be16 (v) << 16) | cpu_to_be16 (v >> 16);
+    return (v >> 24) | ((v >> 8) & 0xff00) | ((v << 8) & 0xff0000) | (v << 24);
 }
 
 static inline uint32_t cairo_const
commit 956ef874c866faf5725a3d0600395422e58dcf6f
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Oct 31 19:06:42 2014 +1030

    pdf-operators: only wrap text strings for PS output
    
    since the PS Document Structing Conventions impose a 255 character
    line limit. PDF does not require wrapping.
    
    pdf-operators is designed to emit the same output for PS and PDF.
    Unfortunately some PDF interpreters don't like strings split with
    '\\\n' and some PS interpreters don't like strings split with ')('.
    So we are forced to make pdf-operators handling string wrapping
    differently for PDF and PS.
    
    Bug 85662

diff --git a/src/cairo-pdf-operators-private.h b/src/cairo-pdf-operators-private.h
index 5d36879..4314a04 100644
--- a/src/cairo-pdf-operators-private.h
+++ b/src/cairo-pdf-operators-private.h
@@ -70,6 +70,7 @@ typedef struct _cairo_pdf_operators {
     cairo_scaled_font_subsets_t *font_subsets;
     cairo_pdf_operators_use_font_subset_t use_font_subset;
     void *use_font_subset_closure;
+    cairo_bool_t ps_output; /* output is for PostScript */
     cairo_bool_t use_actual_text;
     cairo_bool_t in_text_object; /* inside BT/ET pair */
 
@@ -101,7 +102,8 @@ cairo_private void
 _cairo_pdf_operators_init (cairo_pdf_operators_t       *pdf_operators,
 			   cairo_output_stream_t       *stream,
 			   cairo_matrix_t 	       *cairo_to_pdf,
-			   cairo_scaled_font_subsets_t *font_subsets);
+			   cairo_scaled_font_subsets_t *font_subsets,
+			   cairo_bool_t                 ps);
 
 cairo_private cairo_status_t
 _cairo_pdf_operators_fini (cairo_pdf_operators_t       *pdf_operators);
diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c
index 48ae3a6..ee41eba 100644
--- a/src/cairo-pdf-operators.c
+++ b/src/cairo-pdf-operators.c
@@ -57,11 +57,13 @@ void
 _cairo_pdf_operators_init (cairo_pdf_operators_t	*pdf_operators,
 			   cairo_output_stream_t	*stream,
 			   cairo_matrix_t		*cairo_to_pdf,
-			   cairo_scaled_font_subsets_t  *font_subsets)
+			   cairo_scaled_font_subsets_t  *font_subsets,
+			   cairo_bool_t                  ps)
 {
     pdf_operators->stream = stream;
     pdf_operators->cairo_to_pdf = *cairo_to_pdf;
     pdf_operators->font_subsets = font_subsets;
+    pdf_operators->ps_output = ps;
     pdf_operators->use_font_subset = NULL;
     pdf_operators->use_font_subset_closure = NULL;
     pdf_operators->in_text_object = FALSE;
@@ -176,6 +178,7 @@ typedef struct _word_wrap_stream {
     cairo_output_stream_t base;
     cairo_output_stream_t *output;
     int max_column;
+    cairo_bool_t ps_output;
     int column;
     cairo_word_wrap_state_t state;
     cairo_bool_t in_escape;
@@ -269,7 +272,7 @@ _word_wrap_stream_count_string_up_to (word_wrap_stream_t *stream,
 	    if (*s == '\\') {
 		stream->in_escape = TRUE;
 		stream->escape_digits = 0;
-	    } else if (stream->column > stream->max_column) {
+	    } else if (stream->ps_output && stream->column > stream->max_column) {
 		newline = TRUE;
 		break;
 	    }
@@ -284,7 +287,7 @@ _word_wrap_stream_count_string_up_to (word_wrap_stream_t *stream,
 	_cairo_output_stream_write (stream->output, data, count);
 
     if (newline) {
-	_cairo_output_stream_printf (stream->output, ")\n(");
+	_cairo_output_stream_printf (stream->output, "\\\n");
 	stream->column = 0;
     }
 
@@ -348,7 +351,7 @@ _word_wrap_stream_close (cairo_output_stream_t *base)
 }
 
 static cairo_output_stream_t *
-_word_wrap_stream_create (cairo_output_stream_t *output, int max_column)
+_word_wrap_stream_create (cairo_output_stream_t *output, cairo_bool_t ps, int max_column)
 {
     word_wrap_stream_t *stream;
 
@@ -367,6 +370,7 @@ _word_wrap_stream_create (cairo_output_stream_t *output, int max_column)
 			       _word_wrap_stream_close);
     stream->output = output;
     stream->max_column = max_column;
+    stream->ps_output = ps;
     stream->column = 0;
     stream->state = WRAP_STATE_DELIMITER;
     stream->in_escape = FALSE;
@@ -502,7 +506,7 @@ _cairo_pdf_operators_emit_path (cairo_pdf_operators_t	*pdf_operators,
     pdf_path_info_t info;
     cairo_box_t box;
 
-    word_wrap = _word_wrap_stream_create (pdf_operators->stream, 72);
+    word_wrap = _word_wrap_stream_create (pdf_operators->stream, pdf_operators->ps_output, 72);
     status = _cairo_output_stream_get_status (word_wrap);
     if (unlikely (status))
 	return _cairo_output_stream_destroy (word_wrap);
@@ -1051,7 +1055,7 @@ _cairo_pdf_operators_flush_glyphs (cairo_pdf_operators_t    *pdf_operators)
     if (pdf_operators->num_glyphs == 0)
 	return CAIRO_STATUS_SUCCESS;
 
-    word_wrap_stream = _word_wrap_stream_create (pdf_operators->stream, 72);
+    word_wrap_stream = _word_wrap_stream_create (pdf_operators->stream, pdf_operators->ps_output, 72);
     status = _cairo_output_stream_get_status (word_wrap_stream);
     if (unlikely (status))
 	return _cairo_output_stream_destroy (word_wrap_stream);
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 83ff48d..fd52b0d 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -430,7 +430,8 @@ _cairo_pdf_surface_create_for_stream_internal (cairo_output_stream_t	*output,
     _cairo_pdf_operators_init (&surface->pdf_operators,
 			       surface->output,
 			       &surface->cairo_to_pdf,
-			       surface->font_subsets);
+			       surface->font_subsets,
+			       FALSE);
     _cairo_pdf_operators_set_font_subsets_callback (&surface->pdf_operators,
 						    _cairo_pdf_surface_add_font,
 						    surface);
@@ -5677,7 +5678,8 @@ _cairo_pdf_surface_analyze_user_font_subset (cairo_scaled_font_subset_t *font_su
     type3_surface = _cairo_type3_glyph_surface_create (font_subset->scaled_font,
 						       null_stream,
 						       _cairo_pdf_emit_imagemask,
-						       surface->font_subsets);
+						       surface->font_subsets,
+						       FALSE);
     if (unlikely (type3_surface->status)) {
 	status2 = _cairo_output_stream_destroy (null_stream);
 	return type3_surface->status;
@@ -5738,7 +5740,8 @@ _cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t		*surface,
     type3_surface = _cairo_type3_glyph_surface_create (font_subset->scaled_font,
 						       NULL,
 						       _cairo_pdf_emit_imagemask,
-						       surface->font_subsets);
+						       surface->font_subsets,
+						       FALSE);
     if (unlikely (type3_surface->status)) {
         free (glyphs);
         free (widths);
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 706e305..03eba62 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -628,7 +628,8 @@ _cairo_ps_surface_analyze_user_font_subset (cairo_scaled_font_subset_t *font_sub
     type3_surface = _cairo_type3_glyph_surface_create (font_subset->scaled_font,
 						       NULL,
 						       _cairo_ps_emit_imagemask,
-						       surface->font_subsets);
+						       surface->font_subsets,
+						       TRUE);
 
     for (i = 0; i < font_subset->num_glyphs; i++) {
 	status = _cairo_type3_glyph_surface_analyze_glyph (type3_surface,
@@ -676,7 +677,8 @@ _cairo_ps_surface_emit_type3_font_subset (cairo_ps_surface_t		*surface,
     type3_surface = _cairo_type3_glyph_surface_create (font_subset->scaled_font,
 						       NULL,
 						       _cairo_ps_emit_imagemask,
-						       surface->font_subsets);
+						       surface->font_subsets,
+						       TRUE);
     status = type3_surface->status;
     if (unlikely (status))
 	return status;
@@ -1068,7 +1070,8 @@ _cairo_ps_surface_create_for_stream_internal (cairo_output_stream_t *stream,
     _cairo_pdf_operators_init (&surface->pdf_operators,
 			       surface->stream,
 			       &surface->cairo_to_ps,
-			       surface->font_subsets);
+			       surface->font_subsets,
+			       TRUE);
     surface->num_pages = 0;
 
     cairo_list_init (&surface->document_media);
diff --git a/src/cairo-type3-glyph-surface-private.h b/src/cairo-type3-glyph-surface-private.h
index 6cd37de..6f40f1c 100644
--- a/src/cairo-type3-glyph-surface-private.h
+++ b/src/cairo-type3-glyph-surface-private.h
@@ -65,7 +65,8 @@ cairo_private cairo_surface_t *
 _cairo_type3_glyph_surface_create (cairo_scaled_font_t			 *scaled_font,
 				   cairo_output_stream_t		 *stream,
 				   cairo_type3_glyph_surface_emit_image_t emit_image,
-				   cairo_scaled_font_subsets_t		 *font_subsets);
+				   cairo_scaled_font_subsets_t		 *font_subsets,
+				   cairo_bool_t                           ps_output);
 
 cairo_private void
 _cairo_type3_glyph_surface_set_font_subsets_callback (void				    *abstract_surface,
diff --git a/src/cairo-type3-glyph-surface.c b/src/cairo-type3-glyph-surface.c
index 5bb6bfc..c99d461 100644
--- a/src/cairo-type3-glyph-surface.c
+++ b/src/cairo-type3-glyph-surface.c
@@ -74,7 +74,8 @@ cairo_surface_t *
 _cairo_type3_glyph_surface_create (cairo_scaled_font_t			 *scaled_font,
 				   cairo_output_stream_t		 *stream,
 				   cairo_type3_glyph_surface_emit_image_t emit_image,
-				   cairo_scaled_font_subsets_t		 *font_subsets)
+				   cairo_scaled_font_subsets_t		 *font_subsets,
+				   cairo_bool_t ps)
 {
     cairo_type3_glyph_surface_t *surface;
     cairo_matrix_t invert_y_axis;
@@ -106,7 +107,8 @@ _cairo_type3_glyph_surface_create (cairo_scaled_font_t			 *scaled_font,
     _cairo_pdf_operators_init (&surface->pdf_operators,
 			       surface->stream,
 			       &surface->cairo_to_pdf,
-			       font_subsets);
+			       font_subsets,
+			       ps);
 
     _cairo_surface_clipper_init (&surface->clipper,
 				 _cairo_type3_glyph_surface_clipper_intersect_clip_path);
commit 189a3e7f7c1795d1118a7a219bedfafd5126e8c3
Author: Bryce Harrington <bryce at bryceharrington.org>
Date:   Tue Oct 21 15:26:34 2014 -0700

    Drop the target-specific huge-radial.pdf.*.ref.png images
    
    These two images are mis-rendered (clearly evident from visual
    inspection).  By removing them, the test will fall back to the more
    general format-specific images, huge-radial.argb32.ref.png and
    huge-radial.rgb24.ref.png.
    
    Note that the huge-radial.pdf tests still fail to pass, but the pdiff
    looks more sensible.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66218
    
    Signed-off-by: Bryce Harrington <bryce at bryceharrington.org>

diff --git a/test/reference/huge-radial.pdf.argb32.ref.png b/test/reference/huge-radial.pdf.argb32.ref.png
deleted file mode 100644
index aa710ec..0000000
Binary files a/test/reference/huge-radial.pdf.argb32.ref.png and /dev/null differ
diff --git a/test/reference/huge-radial.pdf.rgb24.ref.png b/test/reference/huge-radial.pdf.rgb24.ref.png
deleted file mode 100644
index 8cebd80..0000000
Binary files a/test/reference/huge-radial.pdf.rgb24.ref.png and /dev/null differ
commit 1a8b720efe4d01c458b7181af5fb9dcd659bbdd2
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Wed Oct 29 15:27:19 2014 -0700

    RELEASING: Be explicit as to which tag is pushed

diff --git a/RELEASING b/RELEASING
index 235a902..f6f5eeb 100644
--- a/RELEASING
+++ b/RELEASING
@@ -113,7 +113,7 @@ Here are the steps to follow to create a new cairo release:
 8) Push the newly created tag out to the central tree with a command
    something like:
 
-	git push --tags
+	git push upstream master X.Y.Z
 
 9) Edit the cairo bugzilla product and add the new version numbers. Note
    that you need to add two versions.  One for the release/snapshot (with
commit 89d6c42a856f9059f69664dd12b6824460fc3ac8
Author: Ravi Nanjundappa <nravi.n at samsung.com>
Date:   Mon Oct 27 10:54:13 2014 +0530

    Fix warnings from check-doc-syntax.sh
    
    $ ./check-doc-syntax.sh
    Checking documentation for incorrect syntax
    ./cairo-pattern.c (3346): ERROR: Will bad line: ' */'
    ./cairo-pattern.c (3346): ERROR: Will documentation comment not closed with **/
    ./cairo-pattern.c (3422): ERROR: _cairo_pattern_sampled_area invalid doc id (should be 'cairo_...:')
    
    The warnings are about the documentation style used in cairo
    
    Signed-off-by: Ravi Nanjundappa <nravi.n at samsung.com>

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 010de5c..4e3617a 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -3343,7 +3343,7 @@ _cairo_pattern_is_clear (const cairo_pattern_t *abstract_pattern)
  * This is true for scales larger than 1. Also it was judged acceptable
  * for scales larger than .75. And if there is integer translation
  * then a scale of exactly .5 works.
- */
+ **/
 static int
 use_bilinear(double x, double y, double t)
 {
@@ -3419,7 +3419,7 @@ _cairo_hypot(double x, double y)
 }
 
 /**
- * _cairo_pattern_sampled_area
+ * _cairo_pattern_sampled_area:
  *
  * Return region of @pattern that will be sampled to fill @extents,
  * based on the transformation and filter.
commit abffca898318cbc1421e896ff504369ff0a35ac6
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Tue Oct 21 22:35:12 2014 +1030

    build: fix regression on mingw
    
    7cfebce1 removed the filename extension for executables.
    
    Patch from http://sourceforge.net/p/inkscape/mailman/message/32939144/
    
    Bug 85120

diff --git a/build/aclocal.float.m4 b/build/aclocal.float.m4
index bc0a91c..8f85f08 100644
--- a/build/aclocal.float.m4
+++ b/build/aclocal.float.m4
@@ -31,10 +31,10 @@ int main() { return 0; }
 
 ]])], [
 
-if strings - conftest | grep noonsees >/dev/null ; then
+if strings - conftest$ac_exeext | grep noonsees >/dev/null ; then
   ax_cv_c_float_words_bigendian=yes
 fi
-if strings - conftest | grep seesnoon >/dev/null ; then
+if strings - conftest$ac_exeext | grep seesnoon >/dev/null ; then
   if test "$ax_cv_c_float_words_bigendian" = unknown; then
     ax_cv_c_float_words_bigendian=no
   else
commit 65e561e45a8723d5965c8ee1022ec6ecbea0be79
Author: Massimo Valentini <mvalentini at src.gnome.org>
Date:   Sun Oct 19 09:19:10 2014 +0200

    tor-scan-converter: can't do_fullrow when intersection in row + 0.5subrow
    
    the active edges list must be left sorted at the next possible use
    and since full_row does not deal with intersections it is not usable
    when there is an intersection in the top half of the next row first
    subrow
    
    Reported-and-tested-by: Matthew Leach
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85151
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-tor-scan-converter.c b/src/cairo-tor-scan-converter.c
index bd90266..b1b5187 100644
--- a/src/cairo-tor-scan-converter.c
+++ b/src/cairo-tor-scan-converter.c
@@ -1175,8 +1175,8 @@ can_do_full_row (struct active_list *active)
 
 	if (e->dy) {
 	    struct quorem x = e->x;
-	    x.quo += e->dxdy_full.quo - e->dxdy.quo/2;
-	    x.rem += e->dxdy_full.rem - e->dxdy.rem/2;
+	    x.quo += e->dxdy_full.quo;
+	    x.rem += e->dxdy_full.rem;
 	    if (x.rem < 0) {
 		x.quo--;
 		x.rem += e->dy;
commit 5957993663abafdd56b4ae978e2d241d7e9f155b
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Sat Oct 18 19:10:32 2014 -0700

    Revert "Add execution bit for make-cairo-test-constructors.sh"
    
    This reverts commit 5c17bf1a33b8e76edeb23121342e0f163fe9d6ad.
    
    Script is sourced in the makefile, no need for +x.

diff --git a/test/make-cairo-test-constructors.sh b/test/make-cairo-test-constructors.sh
old mode 100755
new mode 100644
commit 17272b56b29e26bc662303b2faceedec116950cc
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Oct 19 12:08:55 2014 +1030

    pdf: fix compiler warning

diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 602d519..83ff48d 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -2677,7 +2677,7 @@ _cairo_pdf_surface_emit_jbig2_image (cairo_pdf_surface_t              *surface,
     unsigned long global_id_length;
     const unsigned char *global_data;
     unsigned long global_data_length;
-    cairo_pdf_jbig2_global_t *global_entry;
+    cairo_pdf_jbig2_global_t *global_entry = NULL; /* hide compiler warning */
     char smask_buf[30];
     char decode_parms_buf[100];
 
commit 6559bfe9319d96c12d587f390ec571de6201cf1f
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Oct 19 11:34:34 2014 +1030

    CFF: Fix unaligned access
    
    Debian bug 712836 reported bus errors in cff subsetting when
    running on a sparc. This is because unlike truetype, all data
    in the compact font format is not aligned.
    
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712836

diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index 4660d6e..f15deb5 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -433,7 +433,7 @@ cff_index_read (cairo_array_t *index, unsigned char **ptr, unsigned char *end_pt
     p = *ptr;
     if (p + 2 > end_ptr)
         return CAIRO_INT_STATUS_UNSUPPORTED;
-    count = be16_to_cpu( *((uint16_t *)p) );
+    count = get_unaligned_be16 (p);
     p += 2;
     if (count > 0) {
         offset_size = *p++;
@@ -984,14 +984,14 @@ cairo_cff_font_read_fdselect (cairo_cff_font_t *font, unsigned char *p)
         for (i = 0; i < font->num_glyphs; i++)
             font->fdselect[i] = *p++;
     } else if (type == 3) {
-        num_ranges = be16_to_cpu( *((uint16_t *)p) );
+        num_ranges = get_unaligned_be16 (p);
         p += 2;
         for  (i = 0; i < num_ranges; i++)
         {
-            first = be16_to_cpu( *((uint16_t *)p) );
+            first = get_unaligned_be16 (p);
             p += 2;
             fd = *p++;
-            last = be16_to_cpu( *((uint16_t *)p) );
+            last = get_unaligned_be16 (p);
             for (j = first; j < last; j++)
                 font->fdselect[j] = fd;
         }
@@ -1722,7 +1722,7 @@ cairo_cff_font_get_gid_for_cid (cairo_cff_font_t  *font, unsigned long cid, unsi
 	    p = font->charset + 1;
 	    g = 1;
 	    while (g <= (unsigned)font->num_glyphs && p < font->data_end) {
-		c = be16_to_cpu( *((uint16_t *)p) );
+		c = get_unaligned_be16 (p);
 		if (c == cid) {
 		    *gid = g;
 		    return CAIRO_STATUS_SUCCESS;
@@ -1737,7 +1737,7 @@ cairo_cff_font_get_gid_for_cid (cairo_cff_font_t  *font, unsigned long cid, unsi
 	    first_gid = 1;
 	    p = font->charset + 1;
 	    while (first_gid <= (unsigned)font->num_glyphs && p + 2 < font->data_end) {
-		first_cid = be16_to_cpu( *((uint16_t *)p) );
+		first_cid = get_unaligned_be16 (p);
 		num_left = p[2];
 		if (cid >= first_cid && cid <= first_cid + num_left) {
 		    *gid = first_gid + cid - first_cid;
@@ -1753,8 +1753,8 @@ cairo_cff_font_get_gid_for_cid (cairo_cff_font_t  *font, unsigned long cid, unsi
 	    first_gid = 1;
 	    p = font->charset + 1;
 	    while (first_gid <= (unsigned)font->num_glyphs && p + 3 < font->data_end) {
-		first_cid = be16_to_cpu( *((uint16_t *)p) );
-		num_left = be16_to_cpu( *((uint16_t *)(p+2)) );
+		first_cid = get_unaligned_be16 (p);
+		num_left = get_unaligned_be16 (p+2);
 		if (cid >= first_cid && cid <= first_cid + num_left) {
 		    *gid = first_gid + cid - first_cid;
 		    return CAIRO_STATUS_SUCCESS;
@@ -2328,7 +2328,7 @@ cairo_cff_font_write_cid_fontdict (cairo_cff_font_t *font)
     unsigned int i;
     cairo_int_status_t status;
     unsigned int offset_array;
-    uint32_t *offset_array_ptr;
+    unsigned char *offset_array_ptr;
     int offset_base;
     uint16_t count;
     uint8_t offset_size = 4;
@@ -2349,7 +2349,7 @@ cairo_cff_font_write_cid_fontdict (cairo_cff_font_t *font)
     if (unlikely (status))
         return status;
     offset_base = _cairo_array_num_elements (&font->output) - 1;
-    *offset_array_ptr = cpu_to_be32(1);
+    put_unaligned_be32(1, offset_array_ptr);
     offset_array += sizeof(uint32_t);
     for (i = 0; i < font->num_subset_fontdicts; i++) {
         status = cff_dict_write (font->fd_dict[font->fd_subset_map[i]],
@@ -2357,8 +2357,9 @@ cairo_cff_font_write_cid_fontdict (cairo_cff_font_t *font)
         if (unlikely (status))
             return status;
 
-	offset_array_ptr = (uint32_t *) _cairo_array_index (&font->output, offset_array);
-        *offset_array_ptr = cpu_to_be32(_cairo_array_num_elements (&font->output) - offset_base);
+	offset_array_ptr = _cairo_array_index (&font->output, offset_array);
+	put_unaligned_be32 (_cairo_array_num_elements (&font->output) - offset_base,
+			    offset_array_ptr);
 	offset_array += sizeof(uint32_t);
     }
 
@@ -2609,7 +2610,7 @@ cairo_cff_font_create_set_widths (cairo_cff_font_t *font)
     unsigned int i;
     tt_hhea_t hhea;
     int num_hmetrics;
-    unsigned char buf[10];
+    uint16_t short_entry;
     int glyph_index;
     cairo_int_status_t status;
 
@@ -2629,7 +2630,8 @@ cairo_cff_font_create_set_widths (cairo_cff_font_t *font)
             status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
                                                          TT_TAG_hmtx,
                                                          glyph_index * long_entry_size,
-                                                         buf, &short_entry_size);
+                                                         (unsigned char *) &short_entry,
+							 &short_entry_size);
             if (unlikely (status))
                 return status;
         }
@@ -2638,11 +2640,12 @@ cairo_cff_font_create_set_widths (cairo_cff_font_t *font)
             status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
                                                          TT_TAG_hmtx,
                                                          (num_hmetrics - 1) * long_entry_size,
-                                                         buf, &short_entry_size);
+                                                         (unsigned char *) &short_entry,
+							 &short_entry_size);
             if (unlikely (status))
                 return status;
         }
-        font->widths[i] = be16_to_cpu (*((int16_t*)buf));
+	font->widths[i] = be16_to_cpu (short_entry);
     }
 
     return CAIRO_STATUS_SUCCESS;
diff --git a/src/cairo-image-info.c b/src/cairo-image-info.c
index 64053a2..26e7ae5 100644
--- a/src/cairo-image-info.c
+++ b/src/cairo-image-info.c
@@ -39,12 +39,6 @@
 #include "cairo-error-private.h"
 #include "cairo-image-info-private.h"
 
-static uint32_t
-_get_be32 (const unsigned char *p)
-{
-    return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
-}
-
 /* JPEG (image/jpeg)
  *
  * http://www.w3.org/Graphics/JPEG/itu-t81.pdf
@@ -170,7 +164,7 @@ static const unsigned char _jpx_signature[] = {
 static const unsigned char *
 _jpx_next_box (const unsigned char *p)
 {
-    return p + _get_be32 (p);
+    return p + get_unaligned_be32 (p);
 }
 
 static const unsigned char *
@@ -185,8 +179,8 @@ _jpx_match_box (const unsigned char *p, const unsigned char *end, uint32_t type)
     uint32_t length;
 
     if (p + 8 < end) {
-	length = _get_be32 (p);
-	if (_get_be32 (p + 4) == type &&  p + length < end)
+	length = get_unaligned_be32 (p);
+	if (get_unaligned_be32 (p + 4) == type &&  p + length < end)
 	    return TRUE;
     }
 
@@ -208,8 +202,8 @@ _jpx_find_box (const unsigned char *p, const unsigned char *end, uint32_t type)
 static void
 _jpx_extract_info (const unsigned char *p, cairo_image_info_t *info)
 {
-    info->height = _get_be32 (p);
-    info->width = _get_be32 (p + 4);
+    info->height = get_unaligned_be32 (p);
+    info->width = get_unaligned_be32 (p + 4);
     info->num_components = (p[8] << 8) + p[9];
     info->bits_per_component = p[10];
 }
@@ -281,13 +275,13 @@ _cairo_image_info_get_png_info (cairo_image_info_t     *info,
        return CAIRO_INT_STATUS_UNSUPPORTED;
 
     p += 4;
-    if (_get_be32 (p) != PNG_IHDR)
+    if (get_unaligned_be32 (p) != PNG_IHDR)
        return CAIRO_INT_STATUS_UNSUPPORTED;
 
     p += 4;
-    info->width = _get_be32 (p);
+    info->width = get_unaligned_be32 (p);
     p += 4;
-    info->height = _get_be32 (p);
+    info->height = get_unaligned_be32 (p);
 
     return CAIRO_STATUS_SUCCESS;
 }
@@ -347,14 +341,14 @@ _jbig2_get_next_segment (const unsigned char  *p,
     if (p + 6 >= end)
 	return NULL;
 
-    seg_num = _get_be32 (p);
+    seg_num = get_unaligned_be32 (p);
     *type = p[4] & 0x3f;
     big_page_size = (p[4] & 0x40) != 0;
     p += 5;
 
     num_segs = p[0] >> 5;
     if (num_segs == 7) {
-	num_segs = _get_be32 (p) & 0x1fffffff;
+	num_segs = get_unaligned_be32 (p) & 0x1fffffff;
 	ref_seg_bytes = 4 + ((num_segs + 1)/8);
     } else {
 	ref_seg_bytes = 1;
@@ -373,7 +367,7 @@ _jbig2_get_next_segment (const unsigned char  *p,
     if (p + 4 >= end)
 	return NULL;
 
-    *data_len = _get_be32 (p);
+    *data_len = get_unaligned_be32 (p);
     p += 4;
     *data = p;
 
@@ -397,8 +391,8 @@ _jbig2_get_next_segment (const unsigned char  *p,
 static void
 _jbig2_extract_info (cairo_image_info_t *info, const unsigned char *p)
 {
-    info->width = _get_be32 (p);
-    info->height = _get_be32 (p + 4);
+    info->width = get_unaligned_be32 (p);
+    info->height = get_unaligned_be32 (p + 4);
     info->num_components = 1;
     info->bits_per_component = 1;
 }
diff --git a/src/cairoint.h b/src/cairoint.h
index b4e8ac8..07ced42 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -240,6 +240,32 @@ be32_to_cpu(uint32_t v)
 
 #endif
 
+/* Unaligned big endian access
+ */
+
+static inline uint16_t get_unaligned_be16 (const unsigned char *p)
+{
+    return p[0] << 8 | p[1];
+}
+
+static inline uint32_t get_unaligned_be32 (const unsigned char *p)
+{
+    return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
+}
+
+static inline void put_unaligned_be16 (uint16_t v, unsigned char *p)
+{
+    p[0] = (v >> 8) & 0xff;
+    p[1] = v & 0xff;
+}
+
+static inline void put_unaligned_be32 (uint32_t v, unsigned char *p)
+{
+    p[0] = (v >> 24) & 0xff;
+    p[1] = (v >> 16) & 0xff;
+    p[2] = (v >> 8)  & 0xff;
+    p[3] = v & 0xff;
+}
 
 /* The glibc versions of ispace() and isdigit() are slow in UTF-8 locales.
  */
commit 9d9b6ee7defd6830abe8886bc0fdc06a7c2c6658
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Fri Oct 17 12:04:56 2014 -0700

    Add execution bit for make-cairo-test-constructors.sh
    
    This is referenced in the Makefile but not set as executable

diff --git a/test/make-cairo-test-constructors.sh b/test/make-cairo-test-constructors.sh
old mode 100644
new mode 100755
commit 34dcd3ae9fdd6ee90f04ddcf7ba1fab49e4f3fbb
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Oct 17 22:04:39 2014 +1030

    Update mime type documentation.

diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 00ff52e..89345f5 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -1223,6 +1223,31 @@ _cairo_mime_data_destroy (void *ptr)
 }
 
 /**
+ * CAIRO_MIME_TYPE_JBIG2:
+ *
+ * Joint Bi-level Image Experts Group image coding standard (ISO/IEC 11544).
+ *
+ * Since: 1.14
+ **/
+
+/**
+ * CAIRO_MIME_TYPE_JBIG2_GLOBAL:
+ *
+ * Joint Bi-level Image Experts Group image coding standard (ISO/IEC 11544) global segment.
+ *
+ * Since: 1.14
+ **/
+
+/**
+ * CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID:
+ *
+ * An unique identifier shared by a JBIG2 global segment and all JBIG2 images
+ * that depend on the global segment.
+ *
+ * Since: 1.14
+ **/
+
+/**
  * CAIRO_MIME_TYPE_JP2:
  *
  * The Joint Photographic Experts Group (JPEG) 2000 image coding standard (ISO/IEC 15444-1).
@@ -1257,7 +1282,8 @@ _cairo_mime_data_destroy (void *ptr)
 /**
  * CAIRO_MIME_TYPE_UNIQUE_ID:
  *
- * Unique identifier for a surface (cairo specific MIME type).
+ * Unique identifier for a surface (cairo specific MIME type). All surfaces with
+ * the same unique identifier will only be embedded once.
  *
  * Since: 1.12
  **/
commit 29c30b97b14ac705a2c0acf5b9141301bbb79bba
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Thu Oct 16 11:41:40 2014 -0700

    RELEASING:  Update tags push command
    
    I couldn't get the documented command to do diddly.  Running
    `git push --tags` achieved what I think was intended.

diff --git a/RELEASING b/RELEASING
index 60e3e9e..235a902 100644
--- a/RELEASING
+++ b/RELEASING
@@ -113,7 +113,7 @@ Here are the steps to follow to create a new cairo release:
 8) Push the newly created tag out to the central tree with a command
    something like:
 
-	git push cairo X.Y.Z
+	git push --tags
 
 9) Edit the cairo bugzilla product and add the new version numbers. Note
    that you need to add two versions.  One for the release/snapshot (with
commit e087aca9bf29e8edc69f177c446bfa00910b1746
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Mon Oct 13 19:57:09 2014 -0700

    Start 1.14.1 development

diff --git a/cairo-version.h b/cairo-version.h
index c65a5ff..197e7b8 100644
--- a/cairo-version.h
+++ b/cairo-version.h
@@ -3,6 +3,6 @@
 
 #define CAIRO_VERSION_MAJOR 1
 #define CAIRO_VERSION_MINOR 14
-#define CAIRO_VERSION_MICRO 0
+#define CAIRO_VERSION_MICRO 1
 
 #endif


More information about the cairo-commit mailing list