[cairo-bugs] [Bug 42739] New: Win32 DIB surfaces not correct for CAIRO_FORMAT_A1

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Nov 9 05:24:20 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=42739

             Bug #: 42739
           Summary: Win32 DIB surfaces not correct for CAIRO_FORMAT_A1
    Classification: Unclassified
           Product: cairo
           Version: 1.10.3
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: win32 backend
        AssignedTo: cairo-bugs at cairographics.org
        ReportedBy: alexl at redhat.com
         QAContact: cairo-bugs at cairographics.org


Created attachment 53328
  --> https://bugs.freedesktop.org/attachment.cgi?id=53328
Fix A1 format win32 surfaces

The in-memory format for a depth 1 bitmap in GDI is not the same as
cairo/pixman. To convert from one to the other you need to mirror the bits in
each byte.
I.e. for the leftmost bit set in a 4 byte sequence pixman would use:
 0x01, 0x00, 0x00, 0x00
Whereas GDI uses:
 0x80, 0x00, 0x00, 0x00

This means the DIB bits in the win32 surface are not right in the
CAIRO_FORMAT_A1 case. I'm attaching a patch that fixes this by skipping some
optimization in this case and converting things when needed.

This was originally discovered inh Gtk+ on win32, see
https://bugzilla.gnome.org/show_bug.cgi?id=653653 for the bug report.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the cairo-bugs mailing list