Changeset 47991 in webkit
- Timestamp:
- Sep 2, 2009 1:38:52 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r47990 r47991 1 2009-09-02 Dirk Schulze <krit@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 SVG Filter premultiplied color support for getImageDate/putImageData 6 [https://bugs.webkit.org/show_bug.cgi?id=27933] 7 8 Patch to get premultiplied color support for Skia on getImageDate/putImageData. 9 10 * platform/graphics/skia/ImageBufferSkia.cpp: 11 (WebCore::getImageData): 12 (WebCore::putImageData): 13 1 14 2009-09-02 Brady Eidson <beidson@apple.com> 2 15 -
trunk/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
r47126 r47991 162 162 uint32_t* srcRow = bitmap.getAddr32(originX, originY + y); 163 163 for (int x = 0; x < numColumns; ++x) { 164 // TODO: Support for premultiplied colors165 SkColor color = SkPMColorToColor(srcRow[x]);166 164 unsigned char* destPixel = &destRow[x * 4]; 167 destPixel[0] = SkColorGetR(color); 168 destPixel[1] = SkColorGetG(color); 169 destPixel[2] = SkColorGetB(color); 170 destPixel[3] = SkColorGetA(color); 165 if (multiplied == Unmultiplied) { 166 SkColor color = SkPMColorToColor(srcRow[x]); 167 destPixel[0] = SkColorGetR(color); 168 destPixel[1] = SkColorGetG(color); 169 destPixel[2] = SkColorGetB(color); 170 destPixel[3] = SkColorGetA(color); 171 } else { 172 // Input and output are both pre-multiplied, we just need to re-arrange the 173 // bytes from the bitmap format to RGBA. 174 destPixel[0] = SkGetPackedR32(srcRow[x]); 175 destPixel[1] = SkGetPackedG32(srcRow[x]); 176 destPixel[2] = SkGetPackedB32(srcRow[x]); 177 destPixel[3] = SkGetPackedA32(srcRow[x]); 178 } 171 179 } 172 180 destRow += destBytesPerRow; … … 226 234 uint32_t* destRow = bitmap.getAddr32(destX, destY + y); 227 235 for (int x = 0; x < numColumns; ++x) { 228 // TODO: Support for premultiplied colors229 236 const unsigned char* srcPixel = &srcRow[x * 4]; 230 destRow[x] = SkPreMultiplyARGB(srcPixel[3], srcPixel[0], 231 srcPixel[1], srcPixel[2]); 237 if (multiplied == Unpremultiplied) 238 destRow[x] = SkPreMultiplyARGB(srcPixel[3], srcPixel[0], 239 srcPixel[1], srcPixel[2]); 240 else 241 destRow[x] = SkPackARGB32(srcPixel[3], srcPixel[0], 242 srcPixel[1], srcPixel[2]); 232 243 } 233 244 srcRow += srcBytesPerRow;
Note: See TracChangeset
for help on using the changeset viewer.