[Webkit-unassigned] [Bug 33164] New: [WinCairo] Improper Cairo Context Color Depth Sometimes Used

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 4 11:47:08 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33164

           Summary: [WinCairo] Improper Cairo Context Color Depth
                    Sometimes Used
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: bfulgham at webkit.org


I tracked down the cause of an annoying ASSERTION hit during some WebKit
operations when running under the WinCairo port.  WebKit would assert when
checking that the target bitsPerPixel was 32.

This was caused by two cases:
(1) Sometimes a device context to a 24-bits-per-pixel context was being used
(for example, when printing).
(2) Sometimes a new device context was passed that did not have a corresponding
(existing) bitmap that could be selected from 'GetCurrentObject'.

In the second case, the bitmap structure returned by GetObject was filled with
garbage, causing the assertion and possibly causing construction of extremely
large image surfaces (as the info.bmWidth/bmHeight field were filled in with
uninitialized data).

This patch corrects both problems by confirming that a valid bitmap handle is
returned by GetCurrentObject, and falling back to the default
cairo_win32_surface_create method, which constructs a standard GDI-compatible
24-bits-per-pixel surface from a raw device context handle.

We only want to pay the price of a 32-bit cairo surface for rendering when its
needed, otherwise we take no advantage of native GDI drawing operations inside
Cairo.

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



More information about the webkit-unassigned mailing list