Changeset 64202 in webkit
- Timestamp:
- Jul 28, 2010 5:55:25 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64201 r64202 1 2010-07-28 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] putImageData(): Combine premultiplication and BGR->RGB 6 https://bugs.webkit.org/show_bug.cgi?id=43114 7 8 Further optimized putImageData() by doing BGR->RGB inside the 9 premultiplication routine. 10 11 * platform/graphics/qt/ImageBufferQt.cpp: 12 (WebCore::premultiplyABGRtoARGB): Renamed from premultiply. 13 (WebCore::putImageData): 14 1 15 2010-07-28 Andrei Popescu <andreip@google.com> 2 16 -
trunk/WebCore/platform/graphics/qt/ImageBufferQt.cpp
r64164 r64202 238 238 } 239 239 240 static inline unsigned int premultiply (unsigned int x)240 static inline unsigned int premultiplyABGRtoARGB(unsigned int x) 241 241 { 242 242 unsigned int a = x >> 24; 243 243 if (a == 255) 244 return x;244 return (x << 16) | ((x >> 16) & 0xff) | (x & 0xff00ff00); 245 245 unsigned int t = (x & 0xff00ff) * a; 246 246 t = (t + ((t >> 8) & 0xff00ff) + 0x800080) >> 8; 247 t &=0xff00ff;247 t = ((t << 16) | (t >> 16)) & 0xff00ff; 248 248 249 249 x = ((x >> 8) & 0xff) * a; … … 298 298 // Premultiply and convert BGR to RGB. 299 299 quint32 pixel = srcScanLine[x]; 300 destScanLine[x] = premultiply (((pixel << 16) & 0xff0000) | ((pixel >> 16) & 0xff) | (pixel & 0xff00ff00));300 destScanLine[x] = premultiplyABGRtoARGB(pixel); 301 301 } 302 302 srcScanLine += source->width();
Note: See TracChangeset
for help on using the changeset viewer.