[cairo-commit] 2 commits - src/cairo-pdf-surface.c src/cairo-ps-surface.c
Adrian Johnson
ajohnson at kemper.freedesktop.org
Sat Jan 5 21:46:00 PST 2008
src/cairo-pdf-surface.c | 24 ++++++++++++++++++++++++
src/cairo-ps-surface.c | 18 ++++++++++++++++++
2 files changed, 42 insertions(+)
New commits:
commit 5b3f6405d8045d73d31d7e2e30db08e81e9e2360
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Jan 6 16:15:32 2008 +1030
PDF: Fix gradient-zero-stops test failure
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 8e3190a..66959b3 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -2364,6 +2364,9 @@ _cairo_pdf_surface_emit_linear_pattern (cairo_pdf_surface_t *surface,
double first_stop, last_stop;
int repeat_begin = 0, repeat_end = 1;
+ if (pattern->base.n_stops == 0)
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
+
extend = cairo_pattern_get_extend (&pattern->base.base);
_cairo_pdf_surface_pause_content_stream (surface);
@@ -2568,6 +2571,9 @@ _cairo_pdf_surface_emit_radial_pattern (cairo_pdf_surface_t *surface,
cairo_extend_t extend;
cairo_status_t status;
+ if (pattern->base.n_stops == 0)
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
+
extend = cairo_pattern_get_extend (&pattern->base.base);
_cairo_pdf_surface_pause_content_stream (surface);
@@ -4354,6 +4360,9 @@ _cairo_pdf_surface_paint (void *abstract_surface,
assert (_cairo_pdf_surface_operation_supported (surface, op, source));
status = _cairo_pdf_surface_emit_pattern (surface, source);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status)
return status;
@@ -4441,6 +4450,9 @@ _cairo_pdf_surface_mask (void *abstract_surface,
/* Create mask group */
status = _cairo_pdf_surface_emit_pattern (surface, mask);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status)
return status;
@@ -4485,6 +4497,9 @@ _cairo_pdf_surface_mask (void *abstract_surface,
/* Create source group */
status = _cairo_pdf_surface_emit_pattern (surface, source);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status)
return status;
@@ -4664,6 +4679,9 @@ _cairo_pdf_surface_stroke (void *abstract_surface,
assert (_cairo_pdf_surface_operation_supported (surface, op, source));
status = _cairo_pdf_surface_emit_pattern (surface, source);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status)
return status;
@@ -4759,6 +4777,9 @@ _cairo_pdf_surface_fill (void *abstract_surface,
return status;
status = _cairo_pdf_surface_emit_pattern (surface, source);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status)
return status;
@@ -4856,6 +4877,9 @@ _cairo_pdf_surface_show_glyphs (void *abstract_surface,
assert (_cairo_pdf_surface_operation_supported (surface, op, source));
status = _cairo_pdf_surface_emit_pattern (surface, source);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status)
return status;
commit fb7407c9c4548fc033164790759c4e480b9d8fa0
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Jan 6 15:58:46 2008 +1030
PS: Fix gradient-zero-stops test failure
diff --git a/src/cairo-ps-surface.c b/src/cairo-ps-surface.c
index b6c6c9b..0210002 100644
--- a/src/cairo-ps-surface.c
+++ b/src/cairo-ps-surface.c
@@ -2621,6 +2621,9 @@ _cairo_ps_surface_emit_linear_pattern (cairo_ps_surface_t *surface,
cairo_status_t status;
cairo_matrix_t inverse = pattern->base.base.matrix;
+ if (pattern->base.n_stops == 0)
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
+
extend = cairo_pattern_get_extend (&pattern->base.base);
status = cairo_matrix_invert (&inverse);
@@ -2676,6 +2679,9 @@ _cairo_ps_surface_emit_radial_pattern (cairo_ps_surface_t *surface,
cairo_status_t status;
cairo_matrix_t inverse = pattern->base.base.matrix;
+ if (pattern->base.n_stops == 0)
+ return CAIRO_INT_STATUS_NOTHING_TO_DO;
+
extend = cairo_pattern_get_extend (&pattern->base.base);
status = cairo_matrix_invert (&inverse);
@@ -2873,6 +2879,9 @@ _cairo_ps_surface_paint (void *abstract_surface,
_cairo_rectangle_intersect (&extents, &pattern_extents);
status = _cairo_ps_surface_emit_pattern (surface, source, op);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status)
return status;
@@ -3016,6 +3025,9 @@ _cairo_ps_surface_stroke (void *abstract_surface,
}
status = _cairo_ps_surface_emit_pattern (surface, source, op);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status) {
if (dash != style->dash)
free (dash);
@@ -3096,6 +3108,9 @@ _cairo_ps_surface_fill (void *abstract_surface,
#endif
status = _cairo_ps_surface_emit_pattern (surface, source, op);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status)
return status;
@@ -3165,6 +3180,9 @@ _cairo_ps_surface_show_glyphs (void *abstract_surface,
num_glyphs_unsigned = num_glyphs;
status = _cairo_ps_surface_emit_pattern (surface, source, op);
+ if (status == CAIRO_INT_STATUS_NOTHING_TO_DO)
+ return CAIRO_STATUS_SUCCESS;
+
if (status)
return status;
More information about the cairo-commit
mailing list