[cairo] Bringing back the dead... RGB16_565

Soeren Sandmann sandmann at daimi.au.dk
Wed Mar 17 11:03:03 PDT 2010


Oleg Romashin <romaxa at gmail.com> writes:

> Updated cairo 16bpp format support patch:
> https://bugs.freedesktop.org/attachment.cgi?id=34084&action=edit
> 
> 1)  Removed CAIRO_CONTENT_COLOR16
> 2) Fixed rendering from 16bpp image surface -> 16bpp Xlib surface
> 
> Can we get this version into upstream?

In this:

+           Visual *visual = NULL;
+           Screen *screen = DefaultScreenOfDisplay(display->display);
+           int j;
+           for (j = 0; j < screen->ndepths; j++) {
+               Depth *d = &screen->depths[j];
+               if (d->depth == 16 && d->nvisuals && &d->visuals[0]) {
+                   visual = &d->visuals[0];
+                   break;
+               }
+           }

don't you need to check that the visual is (a) the right class and (b)
the masks are actually 565 and not, say, 655?


Soren


More information about the cairo mailing list