mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 03:48:03 +02:00
Drop _cairo_surface_is_opaque now that we have cairo_surface_get_content
This commit is contained in:
parent
0ba040d7f6
commit
9fa24975b4
3 changed files with 3 additions and 37 deletions
|
|
@ -1105,7 +1105,7 @@ _cairo_pattern_is_opaque (const cairo_pattern_t *abstract_pattern)
|
|||
case CAIRO_PATTERN_TYPE_SOLID:
|
||||
return _cairo_pattern_is_opaque_solid (abstract_pattern);
|
||||
case CAIRO_PATTERN_TYPE_SURFACE:
|
||||
return _cairo_surface_is_opaque (pattern->surface.surface);
|
||||
return cairo_surface_get_content (pattern->surface.surface) == CAIRO_CONTENT_COLOR;
|
||||
case CAIRO_PATTERN_TYPE_LINEAR:
|
||||
case CAIRO_PATTERN_TYPE_RADIAL:
|
||||
return _gradient_is_opaque (&pattern->gradient.base);
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ cairo_surface_get_content (cairo_surface_t *surface)
|
|||
{
|
||||
return surface->content;
|
||||
}
|
||||
slim_hidden_def(cairo_surface_get_content);
|
||||
|
||||
/**
|
||||
* cairo_surface_status:
|
||||
|
|
@ -2002,42 +2003,6 @@ _cairo_surface_composite_shape_fixup_unbounded (cairo_surface_t *dst,
|
|||
dst_x, dst_y, width, height);
|
||||
}
|
||||
|
||||
static cairo_bool_t
|
||||
_format_is_opaque (cairo_format_t format)
|
||||
{
|
||||
switch (format) {
|
||||
case CAIRO_FORMAT_ARGB32:
|
||||
return FALSE;
|
||||
case CAIRO_FORMAT_RGB24:
|
||||
return TRUE;
|
||||
case CAIRO_FORMAT_A8:
|
||||
return FALSE;
|
||||
case CAIRO_FORMAT_A1:
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* XXX: This function is funny in a couple of ways. First it seems to
|
||||
* be computing something like "not translucent" rather than "opaque"
|
||||
* since it returns TRUE for an A1 image surface. Second, it just
|
||||
* gives up on anything other than an image surface.
|
||||
*
|
||||
* I imagine something that might be more useful here (or in addition)
|
||||
* would be cairo_surface_get_content.
|
||||
*/
|
||||
cairo_bool_t
|
||||
_cairo_surface_is_opaque (const cairo_surface_t *surface)
|
||||
{
|
||||
if (_cairo_surface_is_image (surface)) {
|
||||
const cairo_image_surface_t *image_surface = (cairo_image_surface_t *) surface;
|
||||
|
||||
return _format_is_opaque (image_surface->format);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* _cairo_surface_copy_pattern_for_destination
|
||||
* @pattern: the pattern to copy
|
||||
|
|
|
|||
|
|
@ -2219,6 +2219,7 @@ slim_hidden_proto(cairo_restore)
|
|||
slim_hidden_proto(cairo_save)
|
||||
slim_hidden_proto(cairo_stroke_preserve)
|
||||
slim_hidden_proto(cairo_surface_destroy)
|
||||
slim_hidden_proto(cairo_surface_get_content)
|
||||
slim_hidden_proto(cairo_push_group)
|
||||
slim_hidden_proto(cairo_push_group_with_content)
|
||||
slim_hidden_proto(cairo_pop_group)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue