[Webkit-unassigned] [Bug 41113] [WinCairo] Text box backgrounds do not render in partially opaque layers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 24 09:29:47 PDT 2010


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





--- Comment #4 from Brent Fulgham <bfulgham at webkit.org>  2010-06-24 09:29:47 PST ---
I hadn't noticed this problem before -- this is a great fix!

I only had one minor suggestion:
> +    unsigned char* bytes = reinterpret_cast<unsigned char*>(info.bmBits);
> +    if (!supportAlphaBlend)
> +        for (size_t i = 0; i < info.bmHeight * info.bmWidthBytes; i += 4)
> +            bytes[i + 3] = 255;
> +

Could the byte flipping code be represented as a static function for clarity?  For example:

static void setRGBABitmapAlpha(unsigned char* bytes, size_t length, unsigned char level)
{
    for (size_t i = 0; i < length; i += 4)
        bytes[i + 3] = level;
}

... then your other change would read:
    if (!supportAlphaBlend)
        setRGBABitmapAlpha(bytes, info.bmHeight * info.bmWidthBytes, 255);

Otherwise, looks great!

-- 
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