[cairo-bugs] [Bug 12756] New: Cairo doesn't support a 16bit visual (RGB16 5/5/5)

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Oct 9 16:24:55 PDT 2007


http://bugs.freedesktop.org/show_bug.cgi?id=12756

           Summary: Cairo doesn't support a 16bit visual (RGB16 5/5/5)
           Product: cairo
           Version: 1.4.9
          Platform: x86 (IA32)
        OS/Version: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: image backend
        AssignedTo: cworth at cworth.org
        ReportedBy: chris at heathens.co.nz
         QAContact: cairo-bugs at cairographics.org
                CC: chris at heathens.co.nz


15-bit color is all my poor video hardware can handle. Please don't drop
support for this!

BTW, I'm using version 1.4.10, but this wasn't an option in bugzilla.

Here's the patch that fixed it for me:

diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c
index ad41a4c..14c4b7c 100644
--- a/src/cairo-image-surface.c
+++ b/src/cairo-image-surface.c
@@ -168,6 +168,11 @@ _cairo_format_from_pixman_format (pixman_format_t
*pixman_format)
            gm == 0x07e0 &&
            bm == 0x001f)
            return CAIRO_INTERNAL_FORMAT_RGB16_565;
+       if (am == 0x0 &&
+           rm == 0x7c00 &&
+           gm == 0x03e0 &&
+           bm == 0x001f)
+           return CAIRO_INTERNAL_FORMAT_RGB15;
        break;
     case 8:
        if (am == 0xff &&
@@ -561,6 +566,7 @@ _cairo_content_from_format (cairo_format_t format)
        return CAIRO_CONTENT_COLOR_ALPHA;
     case CAIRO_FORMAT_RGB24:
     case CAIRO_INTERNAL_FORMAT_RGB16_565:
+    case CAIRO_INTERNAL_FORMAT_RGB15:
     case CAIRO_INTERNAL_FORMAT_BGR24:
        return CAIRO_CONTENT_COLOR;
     case CAIRO_FORMAT_A8:
diff --git a/src/cairoint.h b/src/cairoint.h
index 07846b8..5bf6212 100644
--- a/src/cairoint.h
+++ b/src/cairoint.h
@@ -344,7 +344,8 @@ typedef enum cairo_internal_surface_type {
 typedef enum cairo_internal_format {
     CAIRO_INTERNAL_FORMAT_ABGR32 = 0x1000,
     CAIRO_INTERNAL_FORMAT_BGR24,
-    CAIRO_INTERNAL_FORMAT_RGB16_565
+    CAIRO_INTERNAL_FORMAT_RGB16_565,
+    CAIRO_INTERNAL_FORMAT_RGB15
 } cairo_internal_format_t;

 typedef enum cairo_direction {


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the cairo-bugs mailing list