mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-08 04:38:18 +02:00
quartz: Do not use opaque patterns as masks
When an opaque surface is used as a mask, Quartz converts it to greyscale and uses the result as an alpha value. Cairo expects the mask operation to ignore the color components and only use the alpha of the pattern. The expected behavior can be achieved by drawing the mask on a temporary surface with an alpha channel. Fixes clear-source.
This commit is contained in:
parent
7d89d69c49
commit
aa2fb0c05f
1 changed files with 6 additions and 2 deletions
|
|
@ -2399,8 +2399,12 @@ _cairo_quartz_surface_mask_cg (cairo_quartz_surface_t *surface,
|
|||
}
|
||||
|
||||
/* For these, we can skip creating a temporary surface, since we already have one */
|
||||
if (mask->type == CAIRO_PATTERN_TYPE_SURFACE && mask->extend == CAIRO_EXTEND_NONE)
|
||||
return _cairo_quartz_surface_mask_with_surface (surface, op, source, (cairo_surface_pattern_t *) mask, clip);
|
||||
if (mask->type == CAIRO_PATTERN_TYPE_SURFACE && mask->extend == CAIRO_EXTEND_NONE) {
|
||||
const cairo_surface_pattern_t *mask_spat = (const cairo_surface_pattern_t *) mask;
|
||||
|
||||
if (mask_spat->surface->content & CAIRO_CONTENT_ALPHA)
|
||||
return _cairo_quartz_surface_mask_with_surface (surface, op, source, mask_spat, clip);
|
||||
}
|
||||
|
||||
return _cairo_quartz_surface_mask_with_generic (surface, op, source, mask, clip);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue