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

Jamey Sharp jamey at minilop.net
Fri Oct 13 16:06:09 PDT 2006


On Fri, Oct 13, 2006 at 01:44:48PM -0400, Behdad Esfahbod wrote:
> 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?

No, it clearly isn't. But it's coming out of the X backends, and we're
not trying to refactor the entire cairo code base :-), which is why we
only put it in the common X backend code.

If somebody wants to find copies of this function in more of the cairo
code base, I think that'd be great. :-)

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

Sounds good.

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/cairo/attachments/20061013/734f8061/attachment.pgp


More information about the cairo mailing list