Summary: | [Qt] getImageData(): Single-pass RGB->BGR and un-premultiplication | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||||
Component: | WebCore Misc. | Assignee: | QtWebKit Unassigned <webkit-qt-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | amandatheloves, ap, ashwinkumar9944, eilidhabbott, roger9an0, tbt19901508, tuborgmirch | ||||||
Priority: | P2 | Keywords: | Performance, Qt, QtTriaged | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Andreas Kling
2010-07-25 04:12:27 PDT
Created attachment 62523 [details]
Proposed patch
Comment on attachment 62523 [details]
Proposed patch
WebCore/platform/graphics/qt/ImageBufferQt.cpp:178
+ QImage image = imageData.m_pixmap.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
I think it would be nice with a comment here why you disconsider the bool multiplied, people might think that is an error in the future.
WebCore/platform/graphics/qt/ImageBufferQt.cpp:212
+ pixel = ((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) | (pixel & 0xff00ff00);
Maybe you should explain the RGB->BGR swapping here, just like a little comment
Comment on attachment 62523 [details]
Proposed patch
r- due to comments from John Brooks on IRC; this code should have a special path for opaque colors.
Created attachment 62557 [details]
Proposed patch v2
Added special path for un-premultiplication when alpha == 255.
Also added comments like Kenneth requested.
Comment on attachment 62557 [details] Proposed patch v2 Clearing flags on attachment: 62557 Committed r64041: <http://trac.webkit.org/changeset/64041> All reviewed patches have been landed. Closing bug. |