mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 04:58:04 +02:00
[cairo-pattern] Fall back on cairo_surface_create_similar in _cairo_pattern_acquire_surface_for_surface
This was needed for SVG backend because it does not implement clone_similar. However, I'm worried about possible infinite recursion here. Not sure what to do.
This commit is contained in:
parent
5562050bcf
commit
7cbfb9556d
1 changed files with 18 additions and 0 deletions
|
|
@ -1414,6 +1414,24 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t *pattern,
|
|||
|
||||
status = _cairo_surface_clone_similar (dst, pattern->surface,
|
||||
x, y, width, height, out);
|
||||
|
||||
if (status == CAIRO_INT_STATUS_UNSUPPORTED) {
|
||||
|
||||
cairo_t *cr;
|
||||
|
||||
*out = cairo_surface_create_similar (dst, dst->content,
|
||||
width, height);
|
||||
if (!*out)
|
||||
return CAIRO_STATUS_NO_MEMORY;
|
||||
|
||||
cr = cairo_create (*out);
|
||||
|
||||
cairo_set_source_surface (cr, pattern->surface, -x, -y);
|
||||
cairo_paint (cr);
|
||||
|
||||
status = cairo_status (cr);
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue