[cairo-commit] 5 commits - boilerplate/cairo-boilerplate-ps.c src/cairo-analysis-surface.c src/cairo-gstate.c src/cairoint.h src/cairo-paginated-surface.c src/cairo-pdf-surface.c src/cairo-recording-surface.c src/cairo-recording-surface-private.h src/cairo-surface-backend-private.h src/cairo-surface.c src/cairo-surface-wrapper.c src/cairo-surface-wrapper-private.h test/pdf-tagged-text.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Jul 18 09:33:07 UTC 2021


 boilerplate/cairo-boilerplate-ps.c    |    3 -
 src/cairo-analysis-surface.c          |   14 ----
 src/cairo-gstate.c                    |   43 --------------
 src/cairo-paginated-surface.c         |   12 ----
 src/cairo-pdf-surface.c               |    7 --
 src/cairo-recording-surface-private.h |    4 -
 src/cairo-recording-surface.c         |  100 +++++-----------------------------
 src/cairo-surface-backend-private.h   |    7 --
 src/cairo-surface-wrapper-private.h   |    7 --
 src/cairo-surface-wrapper.c           |   38 ------------
 src/cairo-surface.c                   |   17 -----
 src/cairoint.h                        |    7 --
 test/pdf-tagged-text.c                |   27 ++++++++-
 13 files changed, 57 insertions(+), 229 deletions(-)

New commits:
commit 2ffc209485218a9eac6eb20d4351d0fa5df29c48
Merge: ff2a95d6e e73b4c799
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sun Jul 18 09:33:05 2021 +0000

    Merge branch 'dont-drop-tags' into 'master'
    
    Remove all gstate from _cairo_surface_tag
    
    See merge request cairo/cairo!196

commit e73b4c799e7bda112a5c9ee386b7e03cf0c0d21c
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Jul 16 13:06:02 2021 +0930

    Fix PS test crash
    
    When the tests run ghostscipt on ps2 files it crashes with:
    
      Error: /undefined in .setlanguagelevel
      Operand stack:
         2
      Execution stack:
         %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
      Dictionary stack:
         --dict:732/1123(ro)(G)--   --dict:0/20(G)--   --dict:75/200(L)--
      Current allocation mode is local
      GPL Ghostscript 9.53.3: Unrecoverable error, exit code 1
    
    The problem is the "-c 2 .setlanguagelevel -f" on the gs command line
    to set ghostscript to language level 2. I'm not sure why this no longer works.
    
    .setlanguagelevel is not mentioned any where in the gs custom operators listed in
    https://www.ghostscript.com/doc/current/Language.htm
    
    I assume this operator was meant for ghostscript internal use and
    is no longer exposed in recent versions. Remove it from the test.

diff --git a/boilerplate/cairo-boilerplate-ps.c b/boilerplate/cairo-boilerplate-ps.c
index 2c4c94f0e..73546046e 100644
--- a/boilerplate/cairo-boilerplate-ps.c
+++ b/boilerplate/cairo-boilerplate-ps.c
@@ -226,9 +226,8 @@ _cairo_boilerplate_ps_surface_write_to_png (cairo_surface_t *surface,
     char    command[4096];
     int exitstatus;
 
-    sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -sOutputFile=%s %s %s",
+    sprintf (command, "gs -q -r72 -g%dx%d -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pngalpha -sOutputFile=%s %s",
 	     ptc->width, ptc->height, filename,
-	     ptc->level == CAIRO_PS_LEVEL_2 ? "-c 2 .setlanguagelevel -f" : "",
 	     ptc->filename);
     exitstatus = system (command);
 #if _XOPEN_SOURCE && HAVE_SIGNAL_H
commit 26043a2db122dc149818ab2b1a7cacf33790b36c
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Sat Jul 17 05:45:49 2021 +0930

    Fix crash

diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index 8bb5d1769..a20e72d60 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -1095,15 +1095,12 @@ _cairo_recording_surface_tag (void			 *abstract_surface,
     cairo_status_t status;
     cairo_recording_surface_t *surface = abstract_surface;
     cairo_command_tag_t *command;
-    cairo_composite_rectangles_t composite;
 
     TRACE ((stderr, "%s: surface=%d\n", __FUNCTION__, surface->base.unique_id));
 
-
     command = calloc (1, sizeof (cairo_command_tag_t));
     if (unlikely (command == NULL)) {
-	status = _cairo_error (CAIRO_STATUS_NO_MEMORY);
-	goto CLEANUP_COMPOSITE;
+	return _cairo_error (CAIRO_STATUS_NO_MEMORY);
     }
 
     status = _command_init (surface,
@@ -1134,7 +1131,6 @@ _cairo_recording_surface_tag (void			 *abstract_surface,
 
     _cairo_recording_surface_destroy_bbtree (surface);
 
-    _cairo_composite_rectangles_fini (&composite);
     return CAIRO_STATUS_SUCCESS;
 
   CLEANUP_STRINGS:
@@ -1143,8 +1139,6 @@ _cairo_recording_surface_tag (void			 *abstract_surface,
   CLEANUP_COMMAND:
     _cairo_clip_destroy (command->header.clip);
     free (command);
-  CLEANUP_COMPOSITE:
-    _cairo_composite_rectangles_fini (&composite);
     return status;
 }
 
commit 81d7b2e3a487bdaad4d8400890098cb75f4d845b
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Jul 16 09:50:35 2021 +0930

    test: add URL and "rect" attribute to pdf-tagged-text

diff --git a/test/pdf-tagged-text.c b/test/pdf-tagged-text.c
index 8ee48c4d7..f2640704f 100644
--- a/test/pdf-tagged-text.c
+++ b/test/pdf-tagged-text.c
@@ -191,6 +191,7 @@ draw_page_num (cairo_surface_t *surface, cairo_t *cr, const char *prefix, int nu
     cairo_save (cr);
     cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
     cairo_set_font_size(cr, 12);
+    cairo_set_source_rgb (cr, 0, 0, 0);
     cairo_move_to (cr, PAGE_WIDTH/2, PAGE_HEIGHT - MARGIN);
     cairo_show_text (cr, buf);
     cairo_restore (cr);
@@ -311,13 +312,37 @@ draw_section (cairo_surface_t *surface, cairo_t *cr, const struct section *secti
 static void
 draw_cover (cairo_surface_t *surface, cairo_t *cr)
 {
+    cairo_text_extents_t text_extents;
+    char buf[200];
+    cairo_rectangle_t url_box;
+    const char *cairo_url = "https://www.cairographics.org/";
+    const double url_box_margin = 20.0;
+
     cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
     cairo_set_font_size(cr, 16);
-    cairo_move_to (cr, PAGE_WIDTH/3, PAGE_HEIGHT/2);
+    cairo_move_to (cr, PAGE_WIDTH/3, PAGE_HEIGHT/3);
     cairo_tag_begin (cr, "Span", NULL);
     cairo_show_text (cr, "PDF Features Test");
     cairo_tag_end (cr, "Span");
 
+    /* Test URL link using "rect" attribute. The entire rectangle surrounding the URL should be a clickable link.  */
+    cairo_move_to (cr, PAGE_WIDTH/3, 2*PAGE_HEIGHT/3);
+    cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL);
+    cairo_set_font_size(cr, TEXT_SIZE);
+    cairo_set_source_rgb (cr, 0, 0, 1);
+    cairo_show_text (cr, cairo_url);
+    cairo_text_extents (cr, cairo_url, &text_extents);
+    url_box.x = PAGE_WIDTH/3 - url_box_margin;
+    url_box.y = 2*PAGE_HEIGHT/3 - url_box_margin;
+    url_box.width = text_extents.width + 2*url_box_margin;
+    url_box.height = -text_extents.height + 2*url_box_margin;
+    cairo_rectangle(cr, url_box.x, url_box.y, url_box.width, url_box.height);
+    cairo_stroke(cr);
+    snprintf(buf, sizeof(buf), "rect=[%f %f %f %f] uri=\'%s\'",
+             url_box.x, url_box.y, url_box.width, url_box.height, cairo_url);
+    cairo_tag_begin (cr, CAIRO_TAG_LINK, buf);
+    cairo_tag_end (cr, CAIRO_TAG_LINK);
+
     draw_page_num (surface, cr, "cover", 0);
 }
 
commit 1c64d2635bf61be01815148d3879428b90105abd
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Fri Jul 16 09:42:56 2021 +0930

    Remove all gstate from _cairo_surface_tag
    
    The gstate is not required and was causing some tag operations to be
    ignored.

diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index 3a6fd0598..a118e338c 100644
--- a/src/cairo-analysis-surface.c
+++ b/src/cairo-analysis-surface.c
@@ -755,12 +755,7 @@ static cairo_int_status_t
 _cairo_analysis_surface_tag (void	                *abstract_surface,
 			     cairo_bool_t                begin,
 			     const char                 *tag_name,
-			     const char                 *attributes,
-			     const cairo_pattern_t	*source,
-			     const cairo_stroke_style_t	*stroke_style,
-			     const cairo_matrix_t	*ctm,
-			     const cairo_matrix_t	*ctm_inverse,
-			     const cairo_clip_t	        *clip)
+			     const char                 *attributes)
 {
     cairo_analysis_surface_t *surface = abstract_surface;
     cairo_int_status_t	     backend_status;
@@ -771,12 +766,7 @@ _cairo_analysis_surface_tag (void	                *abstract_surface,
 	    surface->target->backend->tag (surface->target,
 					   begin,
 					   tag_name,
-					   attributes,
-					   source,
-					   stroke_style,
-					   ctm,
-					   ctm_inverse,
-					   clip);
+					   attributes);
         if (backend_status == CAIRO_INT_STATUS_SUCCESS)
             surface->has_supported = TRUE;
     }
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c
index a5f6fc72f..64060c4fc 100644
--- a/src/cairo-gstate.c
+++ b/src/cairo-gstate.c
@@ -1657,44 +1657,10 @@ cairo_status_t
 _cairo_gstate_tag_begin (cairo_gstate_t *gstate,
 			 const char *tag_name, const char *attributes)
 {
-    cairo_pattern_union_t source_pattern;
-    cairo_stroke_style_t style;
-    double dash[2];
-    cairo_status_t status;
-    cairo_matrix_t aggregate_transform;
-    cairo_matrix_t aggregate_transform_inverse;
-
-    status = _cairo_gstate_get_pattern_status (gstate->source);
-    if (unlikely (status))
-	return status;
-
-    cairo_matrix_multiply (&aggregate_transform,
-                           &gstate->ctm,
-                           &gstate->target->device_transform);
-    cairo_matrix_multiply (&aggregate_transform_inverse,
-                           &gstate->target->device_transform_inverse,
-                           &gstate->ctm_inverse);
-
-    memcpy (&style, &gstate->stroke_style, sizeof (gstate->stroke_style));
-    if (_cairo_stroke_style_dash_can_approximate (&gstate->stroke_style, &aggregate_transform, gstate->tolerance)) {
-        style.dash = dash;
-        _cairo_stroke_style_dash_approximate (&gstate->stroke_style, &gstate->ctm, gstate->tolerance,
-					      &style.dash_offset,
-					      style.dash,
-					      &style.num_dashes);
-    }
-
-    _cairo_gstate_copy_transformed_source (gstate, &source_pattern.base);
-
     return _cairo_surface_tag (gstate->target,
 			       TRUE, /* begin */
 			       tag_name,
-			       attributes ? attributes : "",
-			       &source_pattern.base,
-			       &style,
-			       &aggregate_transform,
-			       &aggregate_transform_inverse,
-			       gstate->clip);
+			       attributes ? attributes : "");
 }
 
 cairo_status_t
@@ -1704,12 +1670,7 @@ _cairo_gstate_tag_end (cairo_gstate_t *gstate,
     return _cairo_surface_tag (gstate->target,
 			       FALSE, /* begin */
 			       tag_name,
-			       NULL, /* attributes */
-			       NULL, /* source */
-			       NULL, /* stroke_style */
-			       NULL, /* ctm */
-			       NULL, /* ctm_inverse*/
-			       NULL); /* clip */
+			       NULL); /* attributes */
 }
 
 static void
diff --git a/src/cairo-paginated-surface.c b/src/cairo-paginated-surface.c
index 6b35c1f92..a3f7cd9b2 100644
--- a/src/cairo-paginated-surface.c
+++ b/src/cairo-paginated-surface.c
@@ -737,20 +737,12 @@ static cairo_int_status_t
 _cairo_paginated_surface_tag (void			 *abstract_surface,
 			      cairo_bool_t                begin,
 			      const char                 *tag_name,
-			      const char                 *attributes,
-			      const cairo_pattern_t	 *source,
-			      const cairo_stroke_style_t *style,
-			      const cairo_matrix_t	 *ctm,
-			      const cairo_matrix_t	 *ctm_inverse,
-			      const cairo_clip_t	 *clip)
+			      const char                 *attributes)
 {
     cairo_paginated_surface_t *surface = abstract_surface;
 
     return _cairo_surface_tag (surface->recording_surface,
-			       begin, tag_name, attributes,
-			       source, style,
-			       ctm, ctm_inverse,
-			       clip);
+			       begin, tag_name, attributes);
 }
 
 static cairo_surface_t *
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 52c49b6d2..b033fdf07 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -8440,12 +8440,7 @@ static cairo_int_status_t
 _cairo_pdf_surface_tag (void			   *abstract_surface,
 			cairo_bool_t                begin,
 			const char                 *tag_name,
-			const char                 *attributes,
-			const cairo_pattern_t	   *source,
-			const cairo_stroke_style_t *style,
-			const cairo_matrix_t	   *ctm,
-			const cairo_matrix_t	   *ctm_inverse,
-			const cairo_clip_t	   *clip)
+			const char                 *attributes)
 {
     cairo_pdf_surface_t *surface = abstract_surface;
     cairo_int_status_t status = 0;
diff --git a/src/cairo-recording-surface-private.h b/src/cairo-recording-surface-private.h
index c1827f5b3..e8d98e8fa 100644
--- a/src/cairo-recording-surface-private.h
+++ b/src/cairo-recording-surface-private.h
@@ -120,10 +120,6 @@ typedef struct _cairo_command_tag {
     cairo_bool_t                 begin;
     char                        *tag_name;
     char                        *attributes;
-    cairo_pattern_union_t	 source;
-    cairo_stroke_style_t	 style;
-    cairo_matrix_t		 ctm;
-    cairo_matrix_t		 ctm_inverse;
 } cairo_command_tag_t;
 
 typedef union _cairo_command {
diff --git a/src/cairo-recording-surface.c b/src/cairo-recording-surface.c
index 8d0e5376a..8bb5d1769 100644
--- a/src/cairo-recording-surface.c
+++ b/src/cairo-recording-surface.c
@@ -487,8 +487,6 @@ _cairo_recording_surface_finish (void *abstract_surface)
 	    free (command->tag.tag_name);
 	    if (command->tag.begin) {
 		free (command->tag.attributes);
-		_cairo_pattern_fini (&command->tag.source.base);
-		_cairo_stroke_style_fini (&command->tag.style);
 	    }
 	    break;
 
@@ -651,14 +649,14 @@ _command_init (cairo_recording_surface_t *surface,
     command->op = op;
     command->region = CAIRO_RECORDING_REGION_ALL;
 
-    command->extents = composite->unbounded;
+    command->extents = composite ? composite->unbounded : _cairo_empty_rectangle;
     command->chain = NULL;
     command->index = surface->commands.num_elements;
 
     /* steal the clip */
     command->clip = NULL;
-    if (! _cairo_composite_rectangles_can_reduce_clip (composite,
-						       composite->clip))
+    if (composite && ! _cairo_composite_rectangles_can_reduce_clip (composite,
+								    composite->clip))
     {
 	command->clip = composite->clip;
 	composite->clip = NULL;
@@ -1092,12 +1090,7 @@ static cairo_int_status_t
 _cairo_recording_surface_tag (void			 *abstract_surface,
 			      cairo_bool_t                begin,
 			      const char                 *tag_name,
-			      const char                 *attributes,
-			      const cairo_pattern_t	 *source,
-			      const cairo_stroke_style_t *style,
-			      const cairo_matrix_t	 *ctm,
-			      const cairo_matrix_t	 *ctm_inverse,
-			      const cairo_clip_t	 *clip)
+			      const char                 *attributes)
 {
     cairo_status_t status;
     cairo_recording_surface_t *surface = abstract_surface;
@@ -1106,13 +1099,6 @@ _cairo_recording_surface_tag (void			 *abstract_surface,
 
     TRACE ((stderr, "%s: surface=%d\n", __FUNCTION__, surface->base.unique_id));
 
-    status = _cairo_composite_rectangles_init_for_paint (&composite,
-							 &surface->base,
-							 CAIRO_OPERATOR_SOURCE,
-							 source ? source : &_cairo_pattern_black.base,
-							 clip);
-    if (unlikely (status))
-	return status;
 
     command = calloc (1, sizeof (cairo_command_tag_t));
     if (unlikely (command == NULL)) {
@@ -1122,7 +1108,7 @@ _cairo_recording_surface_tag (void			 *abstract_surface,
 
     status = _command_init (surface,
 			    &command->header, CAIRO_COMMAND_TAG, CAIRO_OPERATOR_SOURCE,
-			    &composite);
+			    NULL);
     if (unlikely (status))
 	goto CLEANUP_COMMAND;
 
@@ -1140,36 +1126,17 @@ _cairo_recording_surface_tag (void			 *abstract_surface,
 		goto CLEANUP_STRINGS;
 	    }
 	}
-
-	status = _cairo_pattern_init_snapshot (&command->source.base, source);
-	if (unlikely (status))
-	    goto CLEANUP_STRINGS;
-
-	status = _cairo_stroke_style_init_copy (&command->style, style);
-	if (unlikely (status))
-	    goto CLEANUP_SOURCE;
-
-	command->ctm = *ctm;
-	command->ctm_inverse = *ctm_inverse;
     }
 
     status = _cairo_recording_surface_commit (surface, &command->header);
-    if (unlikely (status)) {
-	if (begin)
-	    goto CLEANUP_STYLE;
-	else
-	    goto CLEANUP_STRINGS;
-    }
+    if (unlikely (status))
+	goto CLEANUP_STRINGS;
 
     _cairo_recording_surface_destroy_bbtree (surface);
 
     _cairo_composite_rectangles_fini (&composite);
     return CAIRO_STATUS_SUCCESS;
 
-  CLEANUP_STYLE:
-    _cairo_stroke_style_fini (&command->style);
-  CLEANUP_SOURCE:
-    _cairo_pattern_fini (&command->source.base);
   CLEANUP_STRINGS:
     free (command->tag_name);
     free (command->attributes);
@@ -1475,35 +1442,14 @@ _cairo_recording_surface_copy__tag (cairo_recording_surface_t *surface,
 		goto err_command;
 	    }
 	}
-
-	status = _cairo_pattern_init_copy (&command->source.base,
-					   &src->tag.source.base);
-	if (unlikely (status))
-	    goto err_command;
-
-	status = _cairo_stroke_style_init_copy (&command->style,
-						&src->tag.style);
-	if (unlikely (status))
-	    goto err_source;
-
-	command->ctm = src->tag.ctm;
-	command->ctm_inverse = src->tag.ctm_inverse;
     }
 
     status = _cairo_recording_surface_commit (surface, &command->header);
-    if (unlikely (status)) {
-	if (src->tag.begin)
-	    goto err_style;
-	else
-	    goto err_command;
-    }
+    if (unlikely (status))
+	goto err_command;
 
     return CAIRO_STATUS_SUCCESS;
 
-err_style:
-    _cairo_stroke_style_fini (&command->style);
-err_source:
-    _cairo_pattern_fini (&command->source.base);
 err_command:
     free(command->tag_name);
     free(command->attributes);
@@ -1906,8 +1852,10 @@ _cairo_recording_surface_replay_internal (cairo_recording_surface_t	*surface,
 	if (! replay_all && command->header.region != region)
 	    continue;
 
-	if (! _cairo_rectangle_intersects (&extents, &command->header.extents))
-	    continue;
+	if (! _cairo_rectangle_intersects (&extents, &command->header.extents)) {
+	    if (command->header.type != CAIRO_COMMAND_TAG)
+		continue;
+	}
 
 	switch (command->header.type) {
 	case CAIRO_COMMAND_PAINT:
@@ -2044,12 +1992,7 @@ _cairo_recording_surface_replay_internal (cairo_recording_surface_t	*surface,
 	    status = _cairo_surface_wrapper_tag (&wrapper,
 						 command->tag.begin,
 						 command->tag.tag_name,
-						 command->tag.attributes,
-						 &command->tag.source.base,
-						 &command->tag.style,
-						 &command->tag.ctm,
-						 &command->tag.ctm_inverse,
-						 command->header.clip);
+						 command->tag.attributes);
 	    break;
 
 	default:
@@ -2163,12 +2106,7 @@ _cairo_recording_surface_replay_one (cairo_recording_surface_t	*surface,
 	status = _cairo_surface_wrapper_tag (&wrapper,
 					     command->tag.begin,
 					     command->tag.tag_name,
-					     command->tag.attributes,
-					     &command->tag.source.base,
-					     &command->tag.style,
-					     &command->tag.ctm,
-					     &command->tag.ctm_inverse,
-					     command->header.clip);
+					     command->tag.attributes);
 	break;
 
     default:
diff --git a/src/cairo-surface-backend-private.h b/src/cairo-surface-backend-private.h
index bcda9aed1..d31655be8 100644
--- a/src/cairo-surface-backend-private.h
+++ b/src/cairo-surface-backend-private.h
@@ -205,12 +205,7 @@ struct _cairo_surface_backend {
     (*tag)			(void			*surface,
 				 cairo_bool_t            begin,
 				 const char             *tag_name,
-				 const char             *attributes,
-				 const cairo_pattern_t	*source,
-				 const cairo_stroke_style_t	*style,
-				 const cairo_matrix_t	*ctm,
-				 const cairo_matrix_t	*ctm_inverse,
-				 const cairo_clip_t	*clip);
+				 const char             *attributes);
 
 };
 
diff --git a/src/cairo-surface-wrapper-private.h b/src/cairo-surface-wrapper-private.h
index fd22bd7e6..380ba099d 100644
--- a/src/cairo-surface-wrapper-private.h
+++ b/src/cairo-surface-wrapper-private.h
@@ -163,12 +163,7 @@ cairo_private cairo_status_t
 _cairo_surface_wrapper_tag (cairo_surface_wrapper_t     *wrapper,
 			    cairo_bool_t                 begin,
 			    const char                  *tag_name,
-			    const char                  *attributes,
-			    const cairo_pattern_t	*source,
-			    const cairo_stroke_style_t	*stroke_style,
-			    const cairo_matrix_t	*ctm,
-			    const cairo_matrix_t	*ctm_inverse,
-			    const cairo_clip_t		*clip);
+			    const char                  *attributes);
 
 cairo_private cairo_surface_t *
 _cairo_surface_wrapper_create_similar (cairo_surface_wrapper_t *wrapper,
diff --git a/src/cairo-surface-wrapper.c b/src/cairo-surface-wrapper.c
index 47155c3f7..7fb417a20 100644
--- a/src/cairo-surface-wrapper.c
+++ b/src/cairo-surface-wrapper.c
@@ -505,47 +505,13 @@ cairo_status_t
 _cairo_surface_wrapper_tag (cairo_surface_wrapper_t     *wrapper,
 			    cairo_bool_t                 begin,
 			    const char                  *tag_name,
-			    const char                  *attributes,
-			    const cairo_pattern_t	*source,
-			    const cairo_stroke_style_t	*stroke_style,
-			    const cairo_matrix_t	*ctm,
-			    const cairo_matrix_t	*ctm_inverse,
-			    const cairo_clip_t		*clip)
+			    const char                  *attributes)
 {
-    cairo_status_t status;
-    cairo_clip_t *dev_clip;
-    cairo_matrix_t dev_ctm = *ctm;
-    cairo_matrix_t dev_ctm_inverse = *ctm_inverse;
-    cairo_pattern_union_t source_copy;
-
     if (unlikely (wrapper->target->status))
 	return wrapper->target->status;
 
-    dev_clip = _cairo_surface_wrapper_get_clip (wrapper, clip);
-    if (wrapper->needs_transform) {
-	cairo_matrix_t m;
-
-	_cairo_surface_wrapper_get_transform (wrapper, &m);
-
-	cairo_matrix_multiply (&dev_ctm, &dev_ctm, &m);
 
-	status = cairo_matrix_invert (&m);
-	assert (status == CAIRO_STATUS_SUCCESS);
-
-	cairo_matrix_multiply (&dev_ctm_inverse, &m, &dev_ctm_inverse);
-
-	_copy_transformed_pattern (&source_copy.base, source, &m);
-	source = &source_copy.base;
-    }
-
-    status = _cairo_surface_tag (wrapper->target,
-				 begin, tag_name, attributes,
-				 source, stroke_style,
-				 &dev_ctm, &dev_ctm_inverse,
-				 dev_clip);
-
-    _cairo_clip_destroy (dev_clip);
-    return status;
+    return _cairo_surface_tag (wrapper->target, begin, tag_name, attributes);
 }
 
 cairo_surface_t *
diff --git a/src/cairo-surface.c b/src/cairo-surface.c
index 0a95047f3..45296fccd 100644
--- a/src/cairo-surface.c
+++ b/src/cairo-surface.c
@@ -2937,12 +2937,7 @@ cairo_status_t
 _cairo_surface_tag (cairo_surface_t	        *surface,
 		    cairo_bool_t                 begin,
 		    const char                  *tag_name,
-		    const char                  *attributes,
-		    const cairo_pattern_t	*source,
-		    const cairo_stroke_style_t	*stroke_style,
-		    const cairo_matrix_t	*ctm,
-		    const cairo_matrix_t	*ctm_inverse,
-		    const cairo_clip_t	        *clip)
+		    const char                  *attributes)
 {
     cairo_int_status_t status;
 
@@ -2955,15 +2950,7 @@ _cairo_surface_tag (cairo_surface_t	        *surface,
     if (surface->backend->tag == NULL)
 	return CAIRO_STATUS_SUCCESS;
 
-    if (begin) {
-	status = _pattern_has_error (source);
-	if (unlikely (status))
-	    return status;
-    }
-
-    status = surface->backend->tag (surface, begin, tag_name, attributes,
-				    source, stroke_style,
-				    ctm, ctm_inverse, clip);
+    status = surface->backend->tag (surface, begin, tag_name, attributes);
     surface->is_clear = FALSE;
 
     return _cairo_surface_set_error (surface, status);
diff --git a/src/cairoint.h b/src/cairoint.h
index 832d80f3f..fd6fc9aa4 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -1465,12 +1465,7 @@ cairo_private cairo_status_t
 _cairo_surface_tag (cairo_surface_t	        *surface,
 		    cairo_bool_t                 begin,
 		    const char                  *tag_name,
-		    const char                  *attributes,
-		    const cairo_pattern_t	*source,
-		    const cairo_stroke_style_t	*stroke_style,
-		    const cairo_matrix_t	*ctm,
-		    const cairo_matrix_t	*ctm_inverse,
-		    const cairo_clip_t	        *clip);
+		    const char                  *attributes);
 
 cairo_private cairo_status_t
 _cairo_surface_acquire_source_image (cairo_surface_t         *surface,


More information about the cairo-commit mailing list