summaryrefslogtreecommitdiff
path: root/src/cairo-recording-surface.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2021-07-16 09:42:56 +0930
committerAdrian Johnson <ajohnson@redneon.com>2021-07-18 18:13:10 +0930
commit1c64d2635bf61be01815148d3879428b90105abd (patch)
tree2fb8857de19fdcac4cfc82de4b88103385f2f10d /src/cairo-recording-surface.c
parentff2a95d6e5e12c5930d451401024f8521446c997 (diff)
downloadcairo-1c64d2635bf61be01815148d3879428b90105abd.tar.gz
Remove all gstate from _cairo_surface_tag
The gstate is not required and was causing some tag operations to be ignored.
Diffstat (limited to 'src/cairo-recording-surface.c')
-rw-r--r--src/cairo-recording-surface.c92
1 files changed, 15 insertions, 77 deletions
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: