[cairo-commit] Branch '1.14' - 7 commits - build/aclocal.float.m4 cairo-version.h NEWS src/cairo-debug.c src/cairo-pattern.c src/cairo-scaled-font.c src/cairo-surface-observer.c src/cairo-truetype-subset.c

Bryce Harrington bryce at kemper.freedesktop.org
Thu Dec 8 05:04:16 UTC 2016


 NEWS                         |   43 +++++++++++++++++++++++++++++++++++++++++++
 build/aclocal.float.m4       |    4 ++--
 cairo-version.h              |    2 +-
 src/cairo-debug.c            |    2 +-
 src/cairo-pattern.c          |    2 +-
 src/cairo-scaled-font.c      |   24 ++++++++++++++++++------
 src/cairo-surface-observer.c |    2 --
 src/cairo-truetype-subset.c  |   30 ++++++++++++++++++++++++------
 8 files changed, 90 insertions(+), 19 deletions(-)

New commits:
commit 3c60c57c609942739f898945a2f0c165f30b6ea6
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Wed Dec 7 21:03:27 2016 -0800

    Start 1.14.9 development

diff --git a/cairo-version.h b/cairo-version.h
index 6c0b090..73acc75 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 8
+#define CAIRO_VERSION_MICRO 9
 
 #endif
commit 9b23aa0f9de4b0ccac8640bea43570b13f8f5a0f
Author: Bryce Harrington <bryce at osg.samsung.com>
Date:   Wed Dec 7 17:11:38 2016 -0800

    Release 1.14.8

diff --git a/NEWS b/NEWS
index f752a2d..08889d2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,46 @@
+Release 1.14.8    (2016-12-07  Bryce Harrington <bryce at osg.samsung.com>)
+========================================================================
+Bugfix release rolling up backported fixes for the past year.
+
+For a complete log of changes since 1.14.6, please see:
+
+    http://cairographics.org/releases/ChangeLog.cairo-1.14.8
+
+Features
+--------
+None
+
+API Changes
+-----------
+None
+
+Dependency Changes
+------------------
+None
+
+Performance Optimizations
+-------------------------
+None
+
+Bug Fixes
+---------
+* Fix "invalidfont" error on some printers when printing PDFs with
+  embedded fonts that have glyphs (such as spaces) with
+  num_contours == 0.  (Bug #79897)
+* Fix deadlock when destruction of a scaled font indirectly triggers
+  destruction of a second scaled font, causing the global cache to be
+  locked twice.  (Bug #93891)
+* Fix X errors reported to applications when shmdt() is called before
+  the Attach request is processed, due to missing xcb and xlib calls.
+* Fix random failure in record-paint-alpha-clip-mast test case, caused
+  by an incorrect assumption that a deferred clear can be skipped.
+  (Bug #84330)
+* Fix crash when dealing with an XShmGetImage() failure, caused by a
+  double free in _get_image_surface().  (Bug #91967)
+* Fix build issue when using non-GNU strings utility.  (Bug #88639)
+* Cleanup debugging text sent to stdout instead of log.  (Bug #95227)
+
+
 Release 1.14.6    (2015-12-09  Bryce Harrington <bryce at osg.samsung.com>)
 ========================================================================
 Simple bugfix release to fix one Windows issue.
diff --git a/cairo-version.h b/cairo-version.h
index 23eb640..6c0b090 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 7
+#define CAIRO_VERSION_MICRO 8
 
 #endif
commit 50b1767d754a75fdbbe8dcd5a6ad243f0a1b443c
Author: Bryce Harrington <bryce at bryceharrington.org>
Date:   Mon Oct 10 14:05:32 2016 -0700

    build: Don't rely on non-POSIX 'strings -' behavior
    
    On systems using GNU's strings implementation, 'strings -' causes a scan
    of the whole file, which is equivalent to 'strings -a'.  However, in
    POSIX passing '-' as the first argument to 'strings' is declared
    unspecified, and thus may break the build on systems that use a
    different POSIX strings implementation.
    
    Patch from Jung-uk Kim
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88639
    Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>

diff --git a/build/aclocal.float.m4 b/build/aclocal.float.m4
index 8f85f08..ca14ea3 100644
--- a/build/aclocal.float.m4
+++ b/build/aclocal.float.m4
@@ -31,10 +31,10 @@ int main() { return 0; }
 
 ]])], [
 
-if strings - conftest$ac_exeext | grep noonsees >/dev/null ; then
+if strings -a conftest$ac_exeext | grep noonsees >/dev/null ; then
   ax_cv_c_float_words_bigendian=yes
 fi
-if strings - conftest$ac_exeext | grep seesnoon >/dev/null ; then
+if strings -a 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 6a435729226a66adee381548977efc0f95c3eacb
Author: Ed Schouten <ed at nuxi.nl>
Date:   Sun Sep 4 08:41:27 2016 +0200

    Write debugging information to the debugging file
    
    Some debugging functions wrote to stdout, which is inconsistent with
    the other debugging functions of the same groups.
    
    Instead they should write to the debugging file that they are given as
    input.
    
    Reviewed-by: Andrea Canciani <ranma42 at gmail.com>
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=95227

diff --git a/src/cairo-debug.c b/src/cairo-debug.c
index 33d46aa..e7ffe48 100644
--- a/src/cairo-debug.c
+++ b/src/cairo-debug.c
@@ -262,7 +262,7 @@ _cairo_debug_print_path (FILE *stream, cairo_path_fixed_t *path)
 		 box.p1.x, box.p1.y, box.p2.x, box.p2.y);
     }
 
-    printf ("\n");
+    fprintf (stream, "\n");
 }
 
 void
diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index ac5d7af..f0b8798 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -4614,7 +4614,7 @@ static void
 _cairo_debug_print_raster_source_pattern (FILE *file,
 					  const cairo_raster_source_pattern_t *raster)
 {
-    printf ("  content: %x, size %dx%d\n", raster->content, raster->extents.width, raster->extents.height);
+    fprintf (file, "  content: %x, size %dx%d\n", raster->content, raster->extents.width, raster->extents.height);
 }
 
 static void
commit 3cf64f126b49b46f1c809913d54837c685cd2752
Author: Ed Schouten <ed at nuxi.nl>
Date:   Sun Sep 4 08:34:49 2016 +0200

    Prevent observer surfaces from writing to stdout
    
    Invoking cairo_surface_mark_dirty () on an observer surface would
    cause it to print debugging output to stdout.
    
    Reviewed-by: Andrea Canciani <ranma42 at gmail.com>
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=95227

diff --git a/src/cairo-surface-observer.c b/src/cairo-surface-observer.c
index 52b0136..e6f78e6 100644
--- a/src/cairo-surface-observer.c
+++ b/src/cairo-surface-observer.c
@@ -1218,8 +1218,6 @@ _cairo_surface_observer_mark_dirty (void *abstract_surface,
     cairo_surface_observer_t *surface = abstract_surface;
     cairo_status_t status;
 
-    printf ("mark-dirty (%d, %d) x (%d, %d)\n", x, y, width, height);
-
     status = CAIRO_STATUS_SUCCESS;
     if (surface->target->backend->mark_dirty_rectangle)
 	status = surface->target->backend->mark_dirty_rectangle (surface->target,
commit 4f0abfb8c7cf45c1a6d4e89f5507cad33eaabc08
Author: Hans Petter Jansson <hpj at cl.no>
Date:   Wed Jan 27 12:55:01 2016 -0600

    scaled-font: Fix deadlock when recursing in _cairo_scaled_font_reset_cache()
    
    The destruction of a scaled font could indirectly trigger the destruction
    of a second scaled font, causing the global cache to be locked twice in
    the same thread.
    
    This is solved by unlinking the font's glyph pages while holding the global
    lock, then releasing the lock before destruction takes place.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93891

diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index ac80c97..a22b36e 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -818,23 +818,35 @@ _cairo_scaled_font_thaw_cache (cairo_scaled_font_t *scaled_font)
 void
 _cairo_scaled_font_reset_cache (cairo_scaled_font_t *scaled_font)
 {
+    cairo_scaled_glyph_page_t *page;
+
     CAIRO_MUTEX_LOCK (scaled_font->mutex);
     assert (! scaled_font->cache_frozen);
     assert (! scaled_font->global_cache_frozen);
     CAIRO_MUTEX_LOCK (_cairo_scaled_glyph_page_cache_mutex);
-    while (! cairo_list_is_empty (&scaled_font->glyph_pages)) {
-	cairo_scaled_glyph_page_t *page =
-	    cairo_list_first_entry (&scaled_font->glyph_pages,
-				    cairo_scaled_glyph_page_t,
-				    link);
 
+    cairo_list_foreach_entry (page,
+			      cairo_scaled_glyph_page_t,
+			      &scaled_font->glyph_pages,
+			      link) {
 	cairo_scaled_glyph_page_cache.size -= page->cache_entry.size;
 	_cairo_hash_table_remove (cairo_scaled_glyph_page_cache.hash_table,
 				  (cairo_hash_entry_t *) &page->cache_entry);
+    }
 
+    CAIRO_MUTEX_UNLOCK (_cairo_scaled_glyph_page_cache_mutex);
+
+    /* Destroy scaled_font's pages while holding its lock only, and not the
+     * global page cache lock. The destructor can cause us to recurse and
+     * end up back here for a different scaled_font. */
+
+    while (! cairo_list_is_empty (&scaled_font->glyph_pages)) {
+	page = cairo_list_first_entry (&scaled_font->glyph_pages,
+				       cairo_scaled_glyph_page_t,
+				       link);
 	_cairo_scaled_glyph_page_destroy (scaled_font, page);
     }
-    CAIRO_MUTEX_UNLOCK (_cairo_scaled_glyph_page_cache_mutex);
+
     CAIRO_MUTEX_UNLOCK (scaled_font->mutex);
 }
 
commit 53f3077b06e6f7d75c65950672c25b753aa8a95e
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat Jul 9 18:19:16 2016 +0930

    truetype: Don't write glyph if num_contours == 0
    
    According to the Opentype spec, num_contours in a glyf table entry can
    be > 0 (single glyph) or < 0 (composite glyph).  num_contours == 0 is
    undefined.
    
    The embedded font in the test case for this bug contained a space
    glyph with num_contours == 0. This was failing on some printers.
    According to the spec, glyphs with no outlines such as space are
    required to have a 0 size entry in the loca table.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=79897

diff --git a/src/cairo-truetype-subset.c b/src/cairo-truetype-subset.c
index 645a89a..9137ef3 100644
--- a/src/cairo-truetype-subset.c
+++ b/src/cairo-truetype-subset.c
@@ -653,16 +653,34 @@ cairo_truetype_font_write_glyf_table (cairo_truetype_font_t *font,
 	if (unlikely (status))
 	    goto FAIL;
 
-        if (size != 0) {
-            status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
+	if (size > 1) {
+	    tt_glyph_data_t *glyph_data;
+	    int num_contours;
+
+	    status = font->backend->load_truetype_table (font->scaled_font_subset->scaled_font,
 							 TT_TAG_glyf, begin, buffer, &size);
 	    if (unlikely (status))
 		goto FAIL;
 
-            status = cairo_truetype_font_remap_composite_glyph (font, buffer, size);
-	    if (unlikely (status))
-		goto FAIL;
-        }
+	    glyph_data = (tt_glyph_data_t *) buffer;
+	    num_contours = (int16_t)be16_to_cpu (glyph_data->num_contours);
+	    if (num_contours < 0) {
+		status = cairo_truetype_font_remap_composite_glyph (font, buffer, size);
+		if (unlikely (status))
+		    goto FAIL;
+	    } else if (num_contours == 0) {
+		/* num_contours == 0 is undefined in the Opentype
+		 * spec. There are some embedded fonts that have a
+		 * space glyph with num_contours = 0 that fails on
+		 * some printers. The spec requires glyphs without
+		 * contours to have a 0 size glyph entry in the loca
+		 * table.
+		 *
+		 * If num_contours == 0, truncate the glyph to 0 size.
+		 */
+		_cairo_array_truncate (&font->output, _cairo_array_num_elements (&font->output) - size);
+	    }
+	}
     }
 
     status = cairo_truetype_font_align_output (font, &next);


More information about the cairo-commit mailing list