[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andreas.kling at nokia.com
andreas.kling at nokia.com
Wed Dec 22 14:45:21 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7b0cde3658e09a3454dd1b69e3dd34461b7dba2d
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 19 12:46:03 2010 +0000
2010-10-19 Andreas Kling <kling at webkit.org>
Reviewed by Tor Arne Vestbø.
[Qt] getImageData returns wrong data for non-0,0 source offset
https://bugs.webkit.org/show_bug.cgi?id=47898
Test: fast/canvas/canvas-getImageData-negative-source.html
* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::getImageData): Add missing *4's to get correct pixel offset.
2010-10-19 Andreas Kling <kling at webkit.org>
Reviewed by Tor Arne Vestbø.
[Qt] getImageData returns wrong data for non-0,0 source offset
https://bugs.webkit.org/show_bug.cgi?id=47898
* fast/canvas/canvas-getImageData-negative-source-expected.txt: Added.
* fast/canvas/canvas-getImageData-negative-source.html: Added.
* fast/canvas/script-tests/canvas-getImageData-negative-source.js: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index f61c1d7..ceaee0b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-19 Andreas Kling <kling at webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] getImageData returns wrong data for non-0,0 source offset
+ https://bugs.webkit.org/show_bug.cgi?id=47898
+
+ * fast/canvas/canvas-getImageData-negative-source-expected.txt: Added.
+ * fast/canvas/canvas-getImageData-negative-source.html: Added.
+ * fast/canvas/script-tests/canvas-getImageData-negative-source.js: Added.
+
2010-10-19 Ben Murdoch <benm at google.com>
Reviewed by Steve Block.
diff --git a/LayoutTests/fast/canvas/canvas-getImageData-negative-source-expected.txt b/LayoutTests/fast/canvas/canvas-getImageData-negative-source-expected.txt
new file mode 100644
index 0000000..f8a6b1e
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-getImageData-negative-source-expected.txt
@@ -0,0 +1,21 @@
+Test the handling of negative sourceRect offset in getImageData().
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS imgdata[0] is 0
+PASS imgdata[1] is 0
+PASS imgdata[2] is 0
+PASS imgdata[3] is 0
+PASS imgdata[60] is 0
+PASS imgdata[61] is 128
+PASS imgdata[62] is 0
+PASS imgdata[63] is 255
+PASS imgdata[64] is 255
+PASS imgdata[65] is 0
+PASS imgdata[66] is 0
+PASS imgdata[67] is 255
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/canvas/canvas-getImageData-negative-source.html b/LayoutTests/fast/canvas/canvas-getImageData-negative-source.html
new file mode 100644
index 0000000..17b85db
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-getImageData-negative-source.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../js/resources/js-test-style.css">
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/canvas-getImageData-negative-source.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/canvas/script-tests/canvas-getImageData-negative-source.js b/LayoutTests/fast/canvas/script-tests/canvas-getImageData-negative-source.js
new file mode 100644
index 0000000..c675737
--- /dev/null
+++ b/LayoutTests/fast/canvas/script-tests/canvas-getImageData-negative-source.js
@@ -0,0 +1,31 @@
+description("Test the handling of negative sourceRect offset in getImageData().");
+
+ctx = document.createElement('canvas').getContext('2d');
+
+ctx.fillStyle = 'red';
+ctx.fillRect(0, 0, 100, 100);
+ctx.fillStyle = 'green';
+ctx.fillRect(0, 0, 6, 6);
+
+var imageData = ctx.getImageData(-10, 0, 100, 1);
+var imgdata = imageData.data;
+
+// Fully transparent black
+shouldBe("imgdata[0]", "0");
+shouldBe("imgdata[1]", "0");
+shouldBe("imgdata[2]", "0");
+shouldBe("imgdata[3]", "0");
+
+// Green
+shouldBe("imgdata[60]", "0");
+shouldBe("imgdata[61]", "128");
+shouldBe("imgdata[62]", "0");
+shouldBe("imgdata[63]", "255");
+
+// Red
+shouldBe("imgdata[64]", "255");
+shouldBe("imgdata[65]", "0");
+shouldBe("imgdata[66]", "0");
+shouldBe("imgdata[67]", "255");
+
+successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f2ac373..b46b347 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,17 @@
2010-10-19 Andreas Kling <kling at webkit.org>
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] getImageData returns wrong data for non-0,0 source offset
+ https://bugs.webkit.org/show_bug.cgi?id=47898
+
+ Test: fast/canvas/canvas-getImageData-negative-source.html
+
+ * platform/graphics/qt/ImageBufferQt.cpp:
+ (WebCore::getImageData): Add missing *4's to get correct pixel offset.
+
+2010-10-19 Andreas Kling <kling at webkit.org>
+
Reviewed by Kenneth Rohde Christiansen.
[Qt] Correct initial state of ImageBuffer QPen
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index 798eaeb..4ec6966 100644
--- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -217,7 +217,7 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const ImageBufferData& i
const uchar* bits = image.bits();
#endif
- quint32* destRows = reinterpret_cast_ptr<quint32*>(&data[desty * rect.width() + destx]);
+ quint32* destRows = reinterpret_cast_ptr<quint32*>(&data[desty * rect.width() * 4 + destx * 4]);
if (multiplied == Unmultiplied) {
for (int y = 0; y < numRows; ++y) {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list