Make Cairo dither to Pixman dither conversion static

We don't use it anywhere outside of the image surface, so there's no
need to make it a project-wide private function.

The name is also updated: it's a cairo function, so it should not abuse
the pixman namespace.
This commit is contained in:
Emmanuele Bassi 2023-08-21 16:16:47 +01:00
parent e6ab85712c
commit ac26a16171
2 changed files with 8 additions and 13 deletions

View file

@ -250,20 +250,20 @@ _pixman_format_from_masks (cairo_format_masks_t *masks,
#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0)
/* Convenience function to convert #cairo_dither_t into #pixman_dither_t */
pixman_dither_t
_pixman_dither_from_cairo_dither (cairo_dither_t dither)
static pixman_dither_t
_cairo_dither_to_pixman_dither (cairo_dither_t dither)
{
switch(dither) {
default:
case CAIRO_DITHER_NONE:
case CAIRO_DITHER_DEFAULT:
return PIXMAN_DITHER_NONE;
switch (dither) {
case CAIRO_DITHER_FAST:
return PIXMAN_DITHER_FAST;
case CAIRO_DITHER_GOOD:
return PIXMAN_DITHER_GOOD;
case CAIRO_DITHER_BEST:
return PIXMAN_DITHER_BEST;
case CAIRO_DITHER_NONE:
case CAIRO_DITHER_DEFAULT:
default:
return PIXMAN_DITHER_NONE;
}
}
#endif
@ -951,7 +951,7 @@ _cairo_image_surface_paint (void *abstract_surface,
const cairo_clip_t *clip)
{
cairo_image_surface_t *surface = abstract_surface;
pixman_dither_t pixman_dither = _pixman_dither_from_cairo_dither(source->dither);
pixman_dither_t pixman_dither = _cairo_dither_to_pixman_dither (source->dither);
pixman_image_set_dither (surface->pixman_image, pixman_dither);
TRACE ((stderr, "%s (surface=%d)\n",

View file

@ -1606,11 +1606,6 @@ cairo_private cairo_bool_t
_pixman_format_to_masks (pixman_format_code_t pixman_format,
cairo_format_masks_t *masks);
#if PIXMAN_VERSION >= PIXMAN_VERSION_ENCODE(0,39,0)
cairo_private pixman_dither_t
_pixman_dither_from_cairo_dither (cairo_dither_t dither);
#endif
cairo_private void
_cairo_image_scaled_glyph_fini (cairo_scaled_font_t *scaled_font,