summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2009-08-30 23:58:53 +0930
committerAdrian Johnson <ajohnson@redneon.com>2009-08-31 23:11:05 +0930
commit135912721f5791ad8eac773fd042c751122c8760 (patch)
tree148c9e76bc59f9d03a96e2040b3dc3b93a0aee59
parent6512faeb9487dcc2d577b5fb3628cf7f13a25c0a (diff)
PDF: Avoid using patterns when filling a surface with EXTEND_NONE
The fill equivilant of the previous optimization.
-rw-r--r--src/cairo-pdf-surface.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c
index 0ada8c02..8a6a83f3 100644
--- a/src/cairo-pdf-surface.c
+++ b/src/cairo-pdf-surface.c
@@ -5617,6 +5617,25 @@ _cairo_pdf_surface_fill (void *abstract_surface,
if (unlikely (status))
return status;
+ if (source->type == CAIRO_PATTERN_TYPE_SURFACE &&
+ source->extend == CAIRO_EXTEND_NONE) {
+
+ _cairo_output_stream_printf (surface->output, "q\n");
+ status = _cairo_pdf_operators_clip (&surface->pdf_operators,
+ path,
+ fill_rule);
+ if (unlikely (status))
+ return status;
+
+ status = _cairo_pdf_surface_paint_surface_pattern (surface,
+ (cairo_surface_pattern_t *) source);
+ if (unlikely (status))
+ return status;
+
+ _cairo_output_stream_printf (surface->output, "Q\n");
+ return _cairo_output_stream_get_status (surface->output);
+ }
+
pattern_res.id = 0;
gstate_res.id = 0;
status = _cairo_pdf_surface_add_pdf_pattern (surface, source, clip,