[cairo-commit] 3 commits - src/cairo-tee-surface.c util/cairo-sphinx

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 3 20:47:18 UTC 2023


 src/cairo-tee-surface.c    |   24 ++++++++++++++----------
 util/cairo-sphinx/sphinx.c |   11 ++++++++---
 2 files changed, 22 insertions(+), 13 deletions(-)

New commits:
commit 338eca43428d1956216362eeb8e1715bac99d876
Merge: 71eb6396c 4b1e07517
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Feb 3 20:47:16 2023 +0000

    Merge branch 'issue-634' into 'master'
    
    tee: Fix cairo wrapper functions
    
    Closes #634
    
    See merge request cairo/cairo!442

commit 4b1e0751716a2a8ff74bb01be8ec3735039fe2e5
Author: Emmanuele Bassi <ebassi at gnome.org>
Date:   Fri Feb 3 15:45:11 2023 +0100

    util: Fix compiler warnings in cairo-sphinx
    
    Though I'm not sure how useful this tool is.

diff --git a/util/cairo-sphinx/sphinx.c b/util/cairo-sphinx/sphinx.c
index 9e248aff1..741e406d6 100644
--- a/util/cairo-sphinx/sphinx.c
+++ b/util/cairo-sphinx/sphinx.c
@@ -559,7 +559,8 @@ compare_images (cairo_surface_t *a,
 		    int channel;
 
 		    for (channel = 0; channel < 4; channel++) {
-			unsigned va, vb, diff;
+			int va, vb;
+                        unsigned diff;
 
 			va = (ua[x] >> (channel*8)) & 0xff;
 			vb = (ub[x] >> (channel*8)) & 0xff;
@@ -588,7 +589,8 @@ compare_images (cairo_surface_t *a,
 		    int channel;
 
 		    for (channel = 0; channel < 3; channel++) {
-			unsigned va, vb, diff;
+			int va, vb;
+                        unsigned diff;
 
 			va = (ua[x] >> (channel*8)) & 0xff;
 			vb = (ub[x] >> (channel*8)) & 0xff;
@@ -614,7 +616,7 @@ compare_images (cairo_surface_t *a,
 		if (aa[x] != bb[x]) {
 		    unsigned diff = abs (aa[x] - bb[x]);
 		    if (diff > 1) {
-			uint8_t va, vb;
+			int8_t va, vb;
 
 			va = get_median_8 (x, y, aa, width, height, stride);
 			vb = get_median_8 (x, y, bb, width, height, stride);
@@ -642,6 +644,9 @@ compare_images (cairo_surface_t *a,
 
     case CAIRO_FORMAT_INVALID:
     case CAIRO_FORMAT_RGB16_565: /* XXX */
+    case CAIRO_FORMAT_RGB30:
+    case CAIRO_FORMAT_RGB96F:
+    case CAIRO_FORMAT_RGBA128F:
 	break;
     }
 
commit 5e42a5277eddafd312a73e355d7775a4401dae4e
Author: Emmanuele Bassi <ebassi at gnome.org>
Date:   Fri Feb 3 15:40:12 2023 +0100

    tee: Fix cairo wrapper functions
    
    Follow-up to !391 to apply the same changes to the (disabled by default)
    tee surface.
    
    Fixes: #634

diff --git a/src/cairo-tee-surface.c b/src/cairo-tee-surface.c
index 7a94c9bca..4994a5a60 100644
--- a/src/cairo-tee-surface.c
+++ b/src/cairo-tee-surface.c
@@ -220,12 +220,12 @@ _cairo_tee_surface_paint (void			*abstract_surface,
     num_slaves = _cairo_array_num_elements (&surface->slaves);
     slaves = _cairo_array_index (&surface->slaves, 0);
     for (n = 0; n < num_slaves; n++) {
-	status = _cairo_surface_wrapper_paint (&slaves[n], op, source, clip);
+	status = _cairo_surface_wrapper_paint (&slaves[n], op, source, 0, clip);
 	if (unlikely (status))
 	    return status;
     }
 
-    return _cairo_surface_wrapper_paint (&surface->master, op, source, clip);
+    return _cairo_surface_wrapper_paint (&surface->master, op, source, 0, clip);
 }
 
 static cairo_int_status_t
@@ -244,13 +244,17 @@ _cairo_tee_surface_mask (void			*abstract_surface,
     slaves = _cairo_array_index (&surface->slaves, 0);
     for (n = 0; n < num_slaves; n++) {
 	status = _cairo_surface_wrapper_mask (&slaves[n],
-					      op, source, mask, clip);
+					      op, source, 0,
+                                              mask, 0,
+                                              clip);
 	if (unlikely (status))
 	    return status;
     }
 
     return _cairo_surface_wrapper_mask (&surface->master,
-					op, source, mask, clip);
+					op, source, 0,
+                                        mask, 0,
+                                        clip);
 }
 
 static cairo_int_status_t
@@ -274,7 +278,7 @@ _cairo_tee_surface_stroke (void				*abstract_surface,
     slaves = _cairo_array_index (&surface->slaves, 0);
     for (n = 0; n < num_slaves; n++) {
 	status = _cairo_surface_wrapper_stroke (&slaves[n],
-						op, source,
+						op, source, 0,
 						path, style,
 						ctm, ctm_inverse,
 						tolerance, antialias,
@@ -284,7 +288,7 @@ _cairo_tee_surface_stroke (void				*abstract_surface,
     }
 
     return _cairo_surface_wrapper_stroke (&surface->master,
-					  op, source,
+					  op, source, 0,
 					  path, style,
 					  ctm, ctm_inverse,
 					  tolerance, antialias,
@@ -310,7 +314,7 @@ _cairo_tee_surface_fill (void				*abstract_surface,
     slaves = _cairo_array_index (&surface->slaves, 0);
     for (n = 0; n < num_slaves; n++) {
 	status = _cairo_surface_wrapper_fill (&slaves[n],
-					      op, source,
+					      op, source, 0,
 					      path, fill_rule,
 					      tolerance, antialias,
 					      clip);
@@ -319,7 +323,7 @@ _cairo_tee_surface_fill (void				*abstract_surface,
     }
 
     return _cairo_surface_wrapper_fill (&surface->master,
-					op, source,
+					op, source, 0,
 					path, fill_rule,
 					tolerance, antialias,
 					clip);
@@ -361,7 +365,7 @@ _cairo_tee_surface_show_text_glyphs (void		    *abstract_surface,
     for (n = 0; n < num_slaves; n++) {
 	memcpy (glyphs_copy, glyphs, sizeof (cairo_glyph_t) * num_glyphs);
 	status = _cairo_surface_wrapper_show_text_glyphs (&slaves[n], op,
-							  source,
+							  source, 0,
 							  utf8, utf8_len,
 							  glyphs_copy, num_glyphs,
 							  clusters, num_clusters,
@@ -374,7 +378,7 @@ _cairo_tee_surface_show_text_glyphs (void		    *abstract_surface,
 
     memcpy (glyphs_copy, glyphs, sizeof (cairo_glyph_t) * num_glyphs);
     status = _cairo_surface_wrapper_show_text_glyphs (&surface->master, op,
-						      source,
+						      source, 0,
 						      utf8, utf8_len,
 						      glyphs_copy, num_glyphs,
 						      clusters, num_clusters,


More information about the cairo-commit mailing list