[cairo] Deprecating CAIRO_FORMAT_RGB16_565 and adding cairo-deprecated.h

Carl Worth cworth at cworth.org
Mon Sep 11 10:39:31 PDT 2006


On Sun, 10 Sep 2006 21:02:22 +0200, Jay Vaughan wrote:
>
> .. count me in the "hand raised to know what is needed to *implement*
> RGB565" rather than remove it, also .. I mean, there's lots of places
> such a format, plus cairo, are useful (hand-held LCD devices running
> Linux galore ..)

The drawing code currently in pixman should already support rendering
to an RGB565 format image. The parts of cairo that do not currently
support 565 can be found by compiling current cairo with a recent
version of gcc and looking for the warnings that complain about
CAIRO_FORMAT_RGB16_565 not being handled in a switch statement. The
current cases are:

	1. cairo-png.c:write_to_png - Need code to write an RGB565
           image out as a PNG file. The easy way would be to
           cairo_paint to a RGB24 surface first and then write that
           out with the existing code. The hard way would be to
           actually emit a 16-bit PNG file.

	2. cairo-xlib-surface.c:_CAIRO_FORMAT_TO_XRENDER_FORMAT - In
           this case, it's a matter of chasing down an
           XRenderPictFormat for the RGB565 cairo format. This is
           harder than the current code which uses
           XRenderFindStandardFormat since RGB565 is not a standard
           Render format. A functional, (though uninteresting), thing
           to do here would be to just fail and let the caller use an
           image fallback. A more interesting approach would be to
           chase down a 16-bit visual (if available) in the X server,
           and then use XRenderFindVisualFormat with that.

	3. cairo-xlib-surface.c:_cairo_xlib_surface_add_glyph - I
           haven't chased down what would need to happen here. I'll
           leave that as an exercise for the reader.

One other thing that should be kept in mind with adding support for
RGB565 is that it would put an additional required format on what
would need to be implemented in any pixman replacement.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060911/eb2c16db/attachment.pgp


More information about the cairo mailing list