8 commits - src/cairo.c src/cairo-clip-boxes.c src/cairo-ft-font.c src/cairo-path-stroke.c src/cairo-pdf-interchange.c src/cairo-ps-surface.c test/mime-unique-id.c util/cairo-trace

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 26 22:15:18 UTC 2024


 src/cairo-clip-boxes.c      |    5 ++++-
 src/cairo-ft-font.c         |    4 ++--
 src/cairo-path-stroke.c     |    4 ++++
 src/cairo-pdf-interchange.c |    2 ++
 src/cairo-ps-surface.c      |    4 ++--
 src/cairo.c                 |    4 ++--
 test/mime-unique-id.c       |    9 ++++++---
 util/cairo-trace/trace.c    |    2 +-
 8 files changed, 23 insertions(+), 11 deletions(-)

New commits:
commit 19c15cedbfddd0cd3211eed83ba8a68fa3bed261
Merge: 16dd5cd4c 64301c610
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Jun 26 22:15:15 2024 +0000

    Merge branch 'various-fixes' into 'master'
    
    Various fixes
    
    Closes #851, #850, #849, #848, #847, #846, and #845
    
    See merge request cairo/cairo!570

commit 64301c61058ca1c1b244c8b1f6ca23502386fcbb
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Jun 26 21:00:34 2024 +0930

    doc: Ensure @ in "@cairo:" is escaped when referring the the font family name
    
    Fixes: #851

diff --git a/src/cairo.c b/src/cairo.c
index 00521f264..78c60df5c 100644
--- a/src/cairo.c
+++ b/src/cairo.c
@@ -3013,11 +3013,11 @@ cairo_tag_end (cairo_t *cr, const char *tag_name)
  * "sans-serif", "cursive", "fantasy", "monospace"), are likely to
  * work as expected.
  *
- * If @family starts with the string "@cairo:", or if no native font
+ * If @family starts with the string "\@cairo:", or if no native font
  * backends are compiled in, cairo will use an internal font family.
  * The internal font family recognizes many modifiers in the @family
  * string, most notably, it recognizes the string "monospace".  That is,
- * the family name "@cairo:monospace" will use the monospace version of
+ * the family name "\@cairo:monospace" will use the monospace version of
  * the internal font family.
  *
  * For "real" font selection, see the font-backend-specific
commit c8ce9f1900a4a36434c1d959ed08668746436081
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Jun 26 20:43:32 2024 +0930

    Check return value of _cairo_boxes_copy_to_clip()
    
    Fixes: #850

diff --git a/src/cairo-clip-boxes.c b/src/cairo-clip-boxes.c
index 3ebcd509c..777b7ddc1 100644
--- a/src/cairo-clip-boxes.c
+++ b/src/cairo-clip-boxes.c
@@ -318,7 +318,10 @@ _cairo_clip_intersect_boxes (cairo_clip_t *clip,
 	goto out;
     }
 
-    _cairo_boxes_copy_to_clip (boxes, clip);
+    if (!_cairo_boxes_copy_to_clip (boxes, clip)) {
+	clip = _cairo_clip_set_all_clipped (clip);
+	goto out;
+    }
 
     _cairo_boxes_extents (boxes, &limits);
 
commit 545073d7edb28f6e58dd120b943a37af6253b5c8
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Jun 26 20:39:51 2024 +0930

    Ensure extent_y_scale is initialized
    
    Fixes: #849

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 360f03fda..b5d08ee1b 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -2808,8 +2808,8 @@ _cairo_ft_scaled_glyph_init_record_colr_v1_glyph (cairo_ft_scaled_font_t *scaled
 
     /* Copied from cairo-user-font.c */
     cairo_matrix_t extent_scale;
-    double extent_x_scale;
-    double extent_y_scale;
+    double extent_x_scale = 1.0;
+    double extent_y_scale = 1.0;
     double snap_x_scale;
     double snap_y_scale;
     double fixed_scale, x_scale, y_scale;
commit c235bc4dee40010b85f893044d5ff513d3766803
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Jun 26 20:28:54 2024 +0930

    Fix bug in cairo-trace when writing A8 images
    
    Fixes: #848

diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c
index 1bdb07591..8bdb3f881 100644
--- a/util/cairo-trace/trace.c
+++ b/util/cairo-trace/trace.c
@@ -1742,7 +1742,7 @@ _emit_image (cairo_surface_t *image,
 	break;
     case CAIRO_FORMAT_A8:
 	for (row = height; row--; ) {
-	    _write_data (&stream, rowdata, width);
+	    _write_data (&stream, data, width);
 	    data += stride;
 	}
 	break;
commit fff7b8f392e0b2793f2f96350ebdf00f27850aea
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Jun 26 20:25:56 2024 +0930

    Make Coverity happy
    
    Fixes: #847

diff --git a/src/cairo-pdf-interchange.c b/src/cairo-pdf-interchange.c
index 29d5c5d9c..720ce0d53 100644
--- a/src/cairo-pdf-interchange.c
+++ b/src/cairo-pdf-interchange.c
@@ -1959,6 +1959,8 @@ _cairo_pdf_interchange_tag_end (cairo_pdf_surface_t *surface,
 
     } else if (surface->paginated_mode == CAIRO_PAGINATED_MODE_RENDER) {
 	status = _cairo_tag_stack_pop (&ic->render_tag_stack, name, &elem);
+    } else {
+	ASSERT_NOT_REACHED;
     }
     if (unlikely (status))
 	return status;
commit 2f671582eecf3a3af3f876e1749542b5dd5f301c
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Jun 26 20:21:25 2024 +0930

    Ensure face variables in cairo_stroker_t are initialized
    
    Fixes: #846

diff --git a/src/cairo-path-stroke.c b/src/cairo-path-stroke.c
index 9ebeb6cd3..60f647eb7 100644
--- a/src/cairo-path-stroke.c
+++ b/src/cairo-path-stroke.c
@@ -162,6 +162,10 @@ _cairo_stroker_init (cairo_stroker_t		*stroker,
     stroker->has_first_face = FALSE;
     stroker->has_initial_sub_path = FALSE;
 
+    /* Coverity complains these may be unitialized. */
+    memset (&stroker->current_face, 0, sizeof (cairo_stroke_face_t));
+    memset (&stroker->first_face, 0, sizeof (cairo_stroke_face_t));
+
     _cairo_stroker_dash_init (&stroker->dash, stroke_style);
 
     stroker->add_external_edge = NULL;
commit 6967beb24ec605a4028ed4d0d065eefc5eb70ceb
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Wed Jun 26 20:05:14 2024 +0930

    ps: fix max form size
    
    Fixes: #845

diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index 1d2bba20e..5421c39c9 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -3507,13 +3507,13 @@ _cairo_ps_surface_use_form (cairo_ps_surface_t           *surface,
     if (surface->ps_level == CAIRO_PS_LEVEL_3)
 	max_size = MAX_L3_FORM_DATA;
     else
-	max_size = MAX_L3_FORM_DATA;
+	max_size = MAX_L2_FORM_DATA;
 
     /* Don't add any more Forms if we exceed the form memory limit */
     if (surface->total_form_size + params->approx_size > max_size)
 	return CAIRO_INT_STATUS_UNSUPPORTED;
 
-    surface->total_form_size += params->approx_size > max_size;
+    surface->total_form_size += params->approx_size;
     unique_id = _cairo_malloc (source_key.unique_id_length);
     if (unique_id == NULL)
 	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
diff --git a/test/mime-unique-id.c b/test/mime-unique-id.c
index aab93164d..8d4a16133 100644
--- a/test/mime-unique-id.c
+++ b/test/mime-unique-id.c
@@ -79,10 +79,13 @@
  *
  * If the size check fails, manually check the output and if the
  * surfaces are still embedded only once, update the expected sizes.
+ *
+ * Note: The PS2 output will embed the image more than once due to the
+ * lower MAX_L2_FORM_DATA for PS2 in cairo-ps-surface.c.
  */
-#define PS2_EXPECTED_SIZE 417510
-#define PS3_EXPECTED_SIZE 381554
-#define PDF_EXPECTED_SIZE 162923
+#define PS2_EXPECTED_SIZE 626926
+#define PS3_EXPECTED_SIZE 381555
+#define PDF_EXPECTED_SIZE 162692
 #define SIZE_TOLERANCE      5000
 
 static const char *png_filename = "romedalen.png";


More information about the cairo-commit mailing list