mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 02:58:02 +02:00
PDF: Avoid using patterns when filling a surface with EXTEND_NONE
The fill equivilant of the previous optimization.
This commit is contained in:
parent
6512faeb94
commit
135912721f
1 changed files with 19 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue