[cairo] my quest for 565

David Hill David.Hill at Sun.COM
Fri May 18 17:38:19 PDT 2007


So after a long chat on IRC and plenty of playing around, it would seem 
that there are several somewhat unrelated issues here. I thought I would 
summarize and hope that more feedback would come out of it.

1) Xlib and goofy visual depths:
In cairo-image-surface.c, I added default return for case16, returning 
CAIRO_INTERNAL_FORMAT_BGR24 which is a lie, but NO ONE really uses that 
value...... and it made various versions of Xvnc show the right thing 
for RGB555, and it probably worked for BGR565.

As C. Worth said in the IRC: Supporting crazy xlib visuals, (here, we 
can take advantage of mask-based image formats in pixman all we want 
without exposing anything to the public cairo interface)

2) PNG and  pixman mask depths that dont match. This is probably best 
accomplished by copying the image to a supported surface and then saving 
that. I have code that does it on the fly for 565, and could be made 
mask based, but that is probably not what is really wanted for this problem.

3) In Carl's words: Providing a new, public 565 format for 
cairo-image-surface, (here, I'm inclined not to provide a fully general 
mask-based format yet).

It is case 3 that really affects me. We started using Cairo a while back 
and I was hoping to update my code base, and this particular choice is 
holding me up. Of course in my view it is more like restoring support 
but that is a nit. My default screen depth is usually RGB565 (a common 
depth in mobile space). We are currently only using the Image backend.

I would be quite happy with an #ifdef RGB565 if that would make things 
any easier, but I doubt it really does.

This certainly has pixman implications.

Thoughts, ideas, corrections ?

Dave





More information about the cairo mailing list