mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-13 15:10:30 +01:00
surface: skip OVER is the source is clear.
If the source has no alpha, the OVER operation becomes DST, i.e. a no-op.
This commit is contained in:
parent
453b1cba11
commit
f5cf131a9d
1 changed files with 24 additions and 0 deletions
|
|
@ -1926,6 +1926,12 @@ _cairo_surface_paint (cairo_surface_t *surface,
|
|||
if (op == CAIRO_OPERATOR_CLEAR && surface->is_clear)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
if (op == CAIRO_OPERATOR_OVER &&
|
||||
_cairo_pattern_is_clear (source))
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
status = _pattern_has_error (source);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -1971,6 +1977,12 @@ _cairo_surface_mask (cairo_surface_t *surface,
|
|||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (op == CAIRO_OPERATOR_OVER &&
|
||||
_cairo_pattern_is_clear (source))
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
status = _pattern_has_error (source);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -2097,6 +2109,12 @@ _cairo_surface_stroke (cairo_surface_t *surface,
|
|||
if (op == CAIRO_OPERATOR_CLEAR && surface->is_clear)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
if (op == CAIRO_OPERATOR_OVER &&
|
||||
_cairo_pattern_is_clear (source))
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
status = _pattern_has_error (source);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
@ -2147,6 +2165,12 @@ _cairo_surface_fill (cairo_surface_t *surface,
|
|||
if (op == CAIRO_OPERATOR_CLEAR && surface->is_clear)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
if (op == CAIRO_OPERATOR_OVER &&
|
||||
_cairo_pattern_is_clear (source))
|
||||
{
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
status = _pattern_has_error (source);
|
||||
if (unlikely (status))
|
||||
return status;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue