[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
senorblanco at chromium.org
senorblanco at chromium.org
Thu Dec 3 13:24:37 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 5f41455563d7504f8eb0e700f3ed9f0bb5542bf2
Author: senorblanco at chromium.org <senorblanco at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 2 15:27:16 2009 +0000
This is the WebKit-side change needed to fix canvas.getImageData() for
Chromium. The unpremultiply code in Skia assumes that unpremultiplied
values should be rounded, while CG does not. In addition, the fixed
point inversion used by Skia introduces slight inaccuracies that make
us fail this test. This change brings Chromium in line with
the CG path.
https://bugs.webkit.org/show_bug.cgi?id=30825
Reviewed by Dmitry Titov.
Covered by LayoutTests/fast/canvas/canvas-getImageData.html
* platform/graphics/skia/ImageBufferSkia.cpp:
(WebCore::getImageData):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4ce4f28..0da74fc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2009-10-27 Stephen White <senorblanco at chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ This is the WebKit-side change needed to fix canvas.getImageData() for
+ Chromium. The unpremultiply code in Skia assumes that unpremultiplied
+ values should be rounded, while CG does not. In addition, the fixed
+ point inversion used by Skia introduces slight inaccuracies that make
+ us fail this test. This change brings Chromium in line with
+ the CG path.
+ https://bugs.webkit.org/show_bug.cgi?id=30825
+
+ Covered by LayoutTests/fast/canvas/canvas-getImageData.html
+
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ (WebCore::getImageData):
+
2009-11-01 Kelly Norton <knorton at google.com>
Reviewed by Timothy Hatcher.
diff --git a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index a5c8926..6f3639c 100644
--- a/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -164,11 +164,12 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const SkBitmap& bitmap,
for (int x = 0; x < numColumns; ++x) {
unsigned char* destPixel = &destRow[x * 4];
if (multiplied == Unmultiplied) {
- SkColor color = SkPMColorToColor(srcRow[x]);
- destPixel[0] = SkColorGetR(color);
- destPixel[1] = SkColorGetG(color);
- destPixel[2] = SkColorGetB(color);
- destPixel[3] = SkColorGetA(color);
+ SkColor color = srcRow[x];
+ unsigned a = SkColorGetA(color);
+ destPixel[0] = a ? SkColorGetR(color) * 255 / a : 0;
+ destPixel[1] = a ? SkColorGetG(color) * 255 / a : 0;
+ destPixel[2] = a ? SkColorGetB(color) * 255 / a : 0;
+ destPixel[3] = a;
} else {
// Input and output are both pre-multiplied, we just need to re-arrange the
// bytes from the bitmap format to RGBA.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list