[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 16:34:46 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit b7ac53f4680df742c961a01edca104801c672e42
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Nov 26 11:52:32 2010 +0000
2010-11-26 Helder Correia <helder at sencha.com>
Reviewed by Ariya Hidayat.
[Qt] Blur shadow for rectangle fill
https://bugs.webkit.org/show_bug.cgi?id=44488
New fast canvas test to ensure fillRect shadow (with and without blur).
* fast/canvas/canvas-fillRect-shadow-expected.txt: Added.
* fast/canvas/canvas-fillRect-shadow.html: Added.
* fast/canvas/script-tests/canvas-fillRect-shadow.js: Added.
2010-11-26 Helder Correia <helder at sencha.com>
Reviewed by Ariya Hidayat.
[Qt] Blur shadow for rectangle fill
https://bugs.webkit.org/show_bug.cgi?id=44488
Shadow color opacity needs to be set when blurring shadow with
ContextShadow.
Test: fast/canvas/canvas-fillRect-shadow.html
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::fillRect):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72757 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8baa062..358dad6 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,5 +1,18 @@
2010-11-26 Helder Correia <helder at sencha.com>
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Blur shadow for rectangle fill
+ https://bugs.webkit.org/show_bug.cgi?id=44488
+
+ New fast canvas test to ensure fillRect shadow (with and without blur).
+
+ * fast/canvas/canvas-fillRect-shadow-expected.txt: Added.
+ * fast/canvas/canvas-fillRect-shadow.html: Added.
+ * fast/canvas/script-tests/canvas-fillRect-shadow.js: Added.
+
+2010-11-26 Helder Correia <helder at sencha.com>
+
Reviewed by Kenneth Rohde Christiansen.
New fast canvas test: createPattern + fillRect with shadow
diff --git a/LayoutTests/fast/canvas/canvas-fillRect-shadow-expected.txt b/LayoutTests/fast/canvas/canvas-fillRect-shadow-expected.txt
new file mode 100644
index 0000000..dcb23d3
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-fillRect-shadow-expected.txt
@@ -0,0 +1,73 @@
+Ensure correct behavior of canvas with fillRect shadow
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is 255
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is 255
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is 255
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is 255
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 76
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 76
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 76
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is around 76
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is smaller than 25
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is smaller than 25
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is smaller than 25
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is smaller than 25
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is smaller than 10
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is smaller than 10
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is smaller than 10
+PASS d[0] is 255
+PASS d[1] is 0
+PASS d[2] is 0
+PASS d[3] is smaller than 10
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/canvas/canvas-fillRect-shadow.html b/LayoutTests/fast/canvas/canvas-fillRect-shadow.html
new file mode 100644
index 0000000..f6fa68c
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-fillRect-shadow.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-fillRect-shadow.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/canvas/script-tests/canvas-fillRect-shadow.js b/LayoutTests/fast/canvas/script-tests/canvas-fillRect-shadow.js
new file mode 100644
index 0000000..1a94855
--- /dev/null
+++ b/LayoutTests/fast/canvas/script-tests/canvas-fillRect-shadow.js
@@ -0,0 +1,167 @@
+description("Ensure correct behavior of canvas with fillRect shadow");
+
+function print(message, color)
+{
+ var paragraph = document.createElement("div");
+ paragraph.appendChild(document.createTextNode(message));
+ paragraph.style.fontFamily = "monospace";
+ if (color)
+ paragraph.style.color = color;
+ document.getElementById("console").appendChild(paragraph);
+}
+
+function shouldBeAround(a, b)
+{
+ var evalA;
+ try {
+ evalA = eval(a);
+ } catch(e) {
+ evalA = e;
+ }
+
+ if (Math.abs(evalA - b) < 5)
+ print("PASS " + a + " is around " + b , "green")
+ else
+ print("FAIL " + a + " is not around " + b + " (actual: " + evalA + ")", "red");
+}
+
+function shouldBeSmaller(a, b)
+{
+ var evalA;
+ try {
+ evalA = eval(a);
+ } catch(e) {
+ evalA = e;
+ }
+
+ if (evalA < b)
+ print("PASS " + a + " is smaller than " + b , "green")
+ else
+ print("FAIL " + a + " is not smaller than " + b + " (actual: " + evalA + ")", "red");
+}
+
+var canvas = document.createElement('canvas');
+document.body.appendChild(canvas);
+canvas.setAttribute('width', '400');
+canvas.setAttribute('height', '650');
+var ctx = canvas.getContext('2d');
+
+ctx.shadowOffsetX = 200;
+ctx.fillStyle = 'rgba(0, 0, 255, 1)';
+
+ctx.shadowColor = 'rgba(255, 0, 0, 1.0)';
+ctx.fillRect(50, 50, 100, 100);
+
+ctx.shadowColor = 'rgba(255, 0, 0, 0.3)';
+ctx.fillRect(50, 200, 100, 100);
+
+ctx.shadowColor = 'rgba(255, 0, 0, 1.0)';
+ctx.shadowBlur = 5;
+ctx.fillRect(50, 350, 100, 100);
+
+ctx.shadowColor = 'rgba(255, 0, 0, 0.3)';
+ctx.fillRect(50, 500, 100, 100);
+
+var d; // imageData.data
+
+// Verify solid shadow.
+d = ctx.getImageData(250, 50, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBe('d[3]', '255');
+
+d = ctx.getImageData(250, 149, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBe('d[3]', '255');
+
+d = ctx.getImageData(349, 50, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBe('d[3]', '255');
+
+d = ctx.getImageData(349, 149, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBe('d[3]', '255');
+
+// Verify solid alpha shadow.
+d = ctx.getImageData(250, 200, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeAround('d[3]', '76');
+
+d = ctx.getImageData(250, 299, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeAround('d[3]', '76');
+
+d = ctx.getImageData(349, 200, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeAround('d[3]', '76');
+
+d = ctx.getImageData(349, 299, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeAround('d[3]', '76');
+
+// Verify blurry shadow.
+d = ctx.getImageData(248, 348, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeSmaller('d[3]', '25');
+
+d = ctx.getImageData(248, 451, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeSmaller('d[3]', '25');
+
+d = ctx.getImageData(351, 348, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeSmaller('d[3]', '25');
+
+d = ctx.getImageData(351, 451, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeSmaller('d[3]', '25');
+
+// Verify blurry alpha shadow.
+d = ctx.getImageData(248, 498, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeSmaller('d[3]', '10');
+
+d = ctx.getImageData(248, 601, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeSmaller('d[3]', '10');
+
+d = ctx.getImageData(351, 498, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeSmaller('d[3]', '10');
+
+d = ctx.getImageData(351, 601, 1, 1).data;
+shouldBe('d[0]', '255');
+shouldBe('d[1]', '0');
+shouldBe('d[2]', '0');
+shouldBeSmaller('d[3]', '10');
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ce915d6..4fdd9af 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-11-26 Helder Correia <helder at sencha.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Blur shadow for rectangle fill
+ https://bugs.webkit.org/show_bug.cgi?id=44488
+
+ Shadow color opacity needs to be set when blurring shadow with
+ ContextShadow.
+
+ Test: fast/canvas/canvas-fillRect-shadow.html
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::fillRect):
+
2010-11-26 Hans Wennborg <hans at chromium.org>
Reviewed by Jeremy Orlow.
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 9094c5a..a7fcb0b 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -707,6 +707,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
if (shadow->m_type == ContextShadow::BlurShadow) {
QPainter* shadowPainter = shadow->beginShadowLayer(p, normalizedRect);
if (shadowPainter) {
+ shadowPainter->setOpacity(static_cast<qreal>(shadow->m_color.alpha()) / 255);
shadowPainter->fillRect(normalizedRect, p->brush());
shadow->endShadowLayer(p);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list