mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-02 19:00:35 +01:00
[cairo-clip] Pass the local pattern to create_similar_solid().
Avoid the short-lived pattern allocation within _cairo_surface_create_similar_solid() by providing the local solid pattern to use as the source.
This commit is contained in:
parent
7ff80234e3
commit
a55f1abf7c
1 changed files with 7 additions and 5 deletions
|
|
@ -395,20 +395,22 @@ _cairo_clip_intersect_mask (cairo_clip_t *clip,
|
|||
if (!status)
|
||||
_cairo_rectangle_intersect (&surface_rect, &target_rect);
|
||||
|
||||
_cairo_pattern_init_solid (&pattern.solid, CAIRO_COLOR_WHITE,
|
||||
CAIRO_CONTENT_COLOR);
|
||||
surface = _cairo_surface_create_similar_solid (target,
|
||||
CAIRO_CONTENT_ALPHA,
|
||||
surface_rect.width,
|
||||
surface_rect.height,
|
||||
CAIRO_COLOR_WHITE,
|
||||
NULL);
|
||||
if (surface->status)
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
&pattern.base);
|
||||
if (surface->status) {
|
||||
_cairo_pattern_fini (&pattern.base);
|
||||
return surface->status;
|
||||
}
|
||||
|
||||
/* Render the new clipping path into the new mask surface. */
|
||||
|
||||
_cairo_traps_translate (traps, -surface_rect.x, -surface_rect.y);
|
||||
_cairo_pattern_init_solid (&pattern.solid, CAIRO_COLOR_WHITE,
|
||||
CAIRO_CONTENT_COLOR);
|
||||
|
||||
status = _cairo_surface_composite_trapezoids (CAIRO_OPERATOR_IN,
|
||||
&pattern.base,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue