mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 04:08:13 +02:00
Rename _init_pattern_with_snapshot to _cairo_pattern_init_snapshot
This commit is contained in:
parent
9016504e2a
commit
bdcdc8400e
3 changed files with 40 additions and 32 deletions
|
|
@ -216,32 +216,6 @@ _cairo_meta_surface_release_source_image (void *abstract_surface,
|
|||
cairo_surface_destroy (&image->base);
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
_init_pattern_with_snapshot (cairo_pattern_t *pattern,
|
||||
const cairo_pattern_t *other)
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
||||
status = _cairo_pattern_init_copy (pattern, other);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
cairo_surface_pattern_t *surface_pattern =
|
||||
(cairo_surface_pattern_t *) pattern;
|
||||
cairo_surface_t *surface = surface_pattern->surface;
|
||||
|
||||
surface_pattern->surface = _cairo_surface_snapshot (surface);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
if (surface_pattern->surface->status)
|
||||
return surface_pattern->surface->status;
|
||||
}
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_int_status_t
|
||||
_cairo_meta_surface_paint (void *abstract_surface,
|
||||
cairo_operator_t op,
|
||||
|
|
@ -259,7 +233,7 @@ _cairo_meta_surface_paint (void *abstract_surface,
|
|||
command->header.region = CAIRO_META_REGION_ALL;
|
||||
command->op = op;
|
||||
|
||||
status = _init_pattern_with_snapshot (&command->source.base, source);
|
||||
status = _cairo_pattern_init_snapshot (&command->source.base, source);
|
||||
if (status)
|
||||
goto CLEANUP_COMMAND;
|
||||
|
||||
|
|
@ -300,11 +274,11 @@ _cairo_meta_surface_mask (void *abstract_surface,
|
|||
command->header.region = CAIRO_META_REGION_ALL;
|
||||
command->op = op;
|
||||
|
||||
status = _init_pattern_with_snapshot (&command->source.base, source);
|
||||
status = _cairo_pattern_init_snapshot (&command->source.base, source);
|
||||
if (status)
|
||||
goto CLEANUP_COMMAND;
|
||||
|
||||
status = _init_pattern_with_snapshot (&command->mask.base, mask);
|
||||
status = _cairo_pattern_init_snapshot (&command->mask.base, mask);
|
||||
if (status)
|
||||
goto CLEANUP_SOURCE;
|
||||
|
||||
|
|
@ -346,7 +320,7 @@ _cairo_meta_surface_stroke (void *abstract_surface,
|
|||
command->header.region = CAIRO_META_REGION_ALL;
|
||||
command->op = op;
|
||||
|
||||
status = _init_pattern_with_snapshot (&command->source.base, source);
|
||||
status = _cairo_pattern_init_snapshot (&command->source.base, source);
|
||||
if (status)
|
||||
goto CLEANUP_COMMAND;
|
||||
|
||||
|
|
@ -401,7 +375,7 @@ _cairo_meta_surface_fill (void *abstract_surface,
|
|||
command->header.region = CAIRO_META_REGION_ALL;
|
||||
command->op = op;
|
||||
|
||||
status = _init_pattern_with_snapshot (&command->source.base, source);
|
||||
status = _cairo_pattern_init_snapshot (&command->source.base, source);
|
||||
if (status)
|
||||
goto CLEANUP_COMMAND;
|
||||
|
||||
|
|
@ -459,7 +433,7 @@ _cairo_meta_surface_show_text_glyphs (void *abstract_surface,
|
|||
command->header.region = CAIRO_META_REGION_ALL;
|
||||
command->op = op;
|
||||
|
||||
status = _init_pattern_with_snapshot (&command->source.base, source);
|
||||
status = _cairo_pattern_init_snapshot (&command->source.base, source);
|
||||
if (status)
|
||||
goto CLEANUP_COMMAND;
|
||||
|
||||
|
|
|
|||
|
|
@ -192,6 +192,36 @@ _cairo_pattern_init_copy (cairo_pattern_t *pattern,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
cairo_status_t
|
||||
_cairo_pattern_init_snapshot (cairo_pattern_t *pattern,
|
||||
const cairo_pattern_t *other)
|
||||
{
|
||||
cairo_status_t status;
|
||||
|
||||
/* We don't bother doing any fancy copy-on-write implementation
|
||||
* for the pattern's data. It's generally quite tiny. */
|
||||
status = _cairo_pattern_init_copy (pattern, other);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
/* But we do let the surface snapshot stuff be as fancy as it
|
||||
* would like to be. */
|
||||
if (pattern->type == CAIRO_PATTERN_TYPE_SURFACE) {
|
||||
cairo_surface_pattern_t *surface_pattern =
|
||||
(cairo_surface_pattern_t *) pattern;
|
||||
cairo_surface_t *surface = surface_pattern->surface;
|
||||
|
||||
surface_pattern->surface = _cairo_surface_snapshot (surface);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
if (surface_pattern->surface->status)
|
||||
return surface_pattern->surface->status;
|
||||
}
|
||||
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void
|
||||
_cairo_pattern_fini (cairo_pattern_t *pattern)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2239,6 +2239,10 @@ cairo_private cairo_status_t
|
|||
_cairo_pattern_init_copy (cairo_pattern_t *pattern,
|
||||
const cairo_pattern_t *other);
|
||||
|
||||
cairo_private cairo_status_t
|
||||
_cairo_pattern_init_snapshot (cairo_pattern_t *pattern,
|
||||
const cairo_pattern_t *other);
|
||||
|
||||
cairo_private void
|
||||
_cairo_pattern_init_solid (cairo_solid_pattern_t *pattern,
|
||||
const cairo_color_t *color,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue