RESOLVED FIXED 30823
Fix alpha handling when using wxWidgets 2.9
https://bugs.webkit.org/show_bug.cgi?id=30823
Summary Fix alpha handling when using wxWidgets 2.9
Vadim Zeitlin
Reported 2009-10-27 08:29:54 PDT
Created attachment 41955 [details] Patch fixing alpha transparency handling for wx port Transparency in PNG images didn't work in wxWebKit because the wxBitmap "has alpha" internal flag was not set before wxGraphicsBitmap was created from it. This flag is set in wxPixelData dtor and, generally speaking, bitmap data can't be accessed at all while it is locked for the raw access via wxPixelData so we must ensure that the local "data" variable is destroyed before using bitmap in any way. This patch does just this: in spite of many apparent changes it simply adds a block around "data" variable to ensure that it is destroyed (this should be more clear if the patch is applied and "diff -b" is done).
Attachments
Patch fixing alpha transparency handling for wx port (3.68 KB, patch)
2009-10-27 08:29 PDT, Vadim Zeitlin
no flags
Patch fixing alpha transparency handling for wx port (v2) (3.80 KB, patch)
2009-10-27 17:29 PDT, Vadim Zeitlin
kevino: review-
"Standalone" version of the patch (2.01 KB, patch)
2009-11-06 18:35 PST, Vadim Zeitlin
kevino: review+
kevino: commit-queue-
Vadim Zeitlin
Comment 1 2009-10-27 08:32:17 PDT
Sorry, I forgot to mention that this patch was done on top of bug 30822. However even if 30822 is not applied, this one should still be as it fixes a real user-visible bug. Please let me know if I should redo the patch against the base line (OTOH it basically just adds two lines with "{" and "}" so maybe there is no need for this).
Eric Seidel (no email)
Comment 2 2009-10-27 11:48:45 PDT
Comment on attachment 41955 [details] Patch fixing alpha transparency handling for wx port Your ChangeLog does not make it clear what this patch does. I believe webkit style is to use spaces around operators: + p.Red() = bytes[i+2]; + p.Green() = bytes[i+1]; + p.Blue() = bytes[i+0]; + p.Alpha() = bytes[i+3];
Vadim Zeitlin
Comment 3 2009-10-27 17:28:17 PDT
(In reply to comment #2) > (From update of attachment 41955 [details]) > Your ChangeLog does not make it clear what this patch does. I've tried to make it more precise while still remaining brief. I hope it's more clear now. > I believe webkit style is to use spaces around operators: > + p.Red() = bytes[i+2]; > + p.Green() = bytes[i+1]; > + p.Blue() = bytes[i+0]; > + p.Alpha() = bytes[i+3]; Sorry, I just indented this code, I didn't modify it at all. I've reformatted it now and will attach the new patch in a moment.
Vadim Zeitlin
Comment 4 2009-10-27 17:29:13 PDT
Created attachment 41997 [details] Patch fixing alpha transparency handling for wx port (v2)
Kevin Ollivier
Comment 5 2009-11-05 20:55:17 PST
Hi Vadim, The patch itself does resolve the problem, but this patch won't apply cleanly because you made the patch on top of a branch that has your changes to NativeImagePtr in it. If you submit a fixed patch against stock trunk sources, I'll be happy to r+ and land it.
Vadim Zeitlin
Comment 6 2009-11-06 18:35:08 PST
Created attachment 42682 [details] "Standalone" version of the patch Here is the version of the patch which should apply cleanly. As I wrote, it's completely trivial: it just adds a scope (and also spaces around "+" operator as requested although IMO this shouldn't be applied together with this patch at all as it has nothing to do with it...).
Kevin Ollivier
Comment 7 2009-11-09 12:37:58 PST
Landed in r50677, thanks! Note that the patch didn't conform to WebKit style since the code inside the braces was not indented, but as I wanted to get this landed, I fixed the issue before commit this time. However, most reviewers will r- a patch that doesn't conform, so things will go quicker if you make sure style issues are addressed before submission.
Note You need to log in before you can comment on or make changes to this bug.