[cairo] [PATCH] share code common to Xlib and XCB backends

Behdad Esfahbod behdad at behdad.org
Fri Oct 13 10:44:48 PDT 2006


On Fri, 2006-10-13 at 12:57 -0400, Ian Osgood wrote:
> +int
> +_CAIRO_FORMAT_DEPTH (cairo_format_t format)
> +{
> +    switch (format) {
> +    case CAIRO_FORMAT_A1:
> +       return 1;
> +    case CAIRO_FORMAT_A8:
> +       return 8;
> +    case CAIRO_FORMAT_RGB24:
> +       return 24;
> +    case CAIRO_FORMAT_ARGB32:
> +    default:
> +       return 32;
> +    }
> +} 

This isn't really X specific, is it?

Also, If you are removing static from the definition, better to rename
it to something like _cairo_format_get_depth or something.

-- 
behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"



More information about the cairo mailing list