[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 15:48:44 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 04f643f4986d804f32afdc0edaec48234aee4fd8
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 12 20:23:34 2010 +0000

    2010-11-12  Helder Correia  <helder at sencha.com>
    
            Reviewed by Andreas Kling.
    
            [Qt] Path::addArc() does not set right angle direction on full arcs
            https://bugs.webkit.org/show_bug.cgi?id=49138
    
            New test for nonzero winding rule correctness for full arc paths.
    
            * fast/canvas/canvas-arc-360-winding-expected.txt: Added.
            * fast/canvas/canvas-arc-360-winding.html: Added.
            * fast/canvas/script-tests/canvas-arc-360-winding.js: Added.
    2010-11-12  Helder Correia  <helder at sencha.com>
    
            Reviewed by Andreas Kling.
    
            [Qt] Path::addArc() does not set right angle direction on full arcs
            https://bugs.webkit.org/show_bug.cgi?id=49138
    
            Ensure correctness of nonzero winding rule for full arc paths.
            Invert the sign of the span if the direction is counterclockwise.
    
            Test: fast/canvas/canvas-arc-360-winding.html
    
            * platform/graphics/qt/PathQt.cpp:
            (WebCore::Path::addArc):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71936 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 9e4560c..382bc6d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-12  Helder Correia  <helder at sencha.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] Path::addArc() does not set right angle direction on full arcs
+        https://bugs.webkit.org/show_bug.cgi?id=49138
+
+        New test for nonzero winding rule correctness for full arc paths.
+
+        * fast/canvas/canvas-arc-360-winding-expected.txt: Added.
+        * fast/canvas/canvas-arc-360-winding.html: Added.
+        * fast/canvas/script-tests/canvas-arc-360-winding.js: Added.
+
 2010-11-05  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/canvas/canvas-arc-360-winding-expected.txt b/LayoutTests/fast/canvas/canvas-arc-360-winding-expected.txt
new file mode 100644
index 0000000..0a395dd
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-arc-360-winding-expected.txt
@@ -0,0 +1,18 @@
+This tests canvas full arc fill with nonzero winding rule. Eight green concentric thick circumferences should be displayed.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS data[0] is 0
+PASS data[1] is 0
+PASS data[2] is 0
+PASS data[0] is 0
+PASS data[1] is 255
+PASS data[2] is 0
+PASS data[0] is 0
+PASS data[1] is 0
+PASS data[2] is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/canvas/canvas-arc-360-winding.html b/LayoutTests/fast/canvas/canvas-arc-360-winding.html
new file mode 100644
index 0000000..c8f0e8e
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-arc-360-winding.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-arc-360-winding.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/canvas/script-tests/canvas-arc-360-winding.js b/LayoutTests/fast/canvas/script-tests/canvas-arc-360-winding.js
new file mode 100644
index 0000000..1fc2557
--- /dev/null
+++ b/LayoutTests/fast/canvas/script-tests/canvas-arc-360-winding.js
@@ -0,0 +1,41 @@
+description("This tests canvas full arc fill with nonzero winding rule. Eight green concentric thick circumferences should be displayed.");
+
+var canvas = document.createElement('canvas');
+document.body.appendChild(canvas)
+canvas.setAttribute('width', '300');
+canvas.setAttribute('height', '150');
+var ctx = canvas.getContext('2d');
+
+var r;
+var anticlockwise = true;
+ctx.beginPath();
+for (r = 200; r >= 10; r -= 10) {
+    ctx.moveTo(150 + r, 75);
+    ctx.arc(150, 75, r, 0, Math.PI*2, anticlockwise);
+    ctx.closePath();
+    anticlockwise = !anticlockwise;
+}
+ctx.fillStyle = 'rgba(0, 255, 0, 1)';
+ctx.strokeStyle = 'rgba(0, 255, 0, 1)';
+ctx.fill();
+ctx.stroke();
+
+var imageData = ctx.getImageData(297, 75, 1, 1);
+var data = imageData.data;
+shouldBe("data[0]", "0");
+shouldBe("data[1]", "0");
+shouldBe("data[2]", "0");
+
+imageData = ctx.getImageData(285, 5, 1, 1);
+data = imageData.data;
+shouldBe("data[0]", "0");
+shouldBe("data[1]", "255");
+shouldBe("data[2]", "0");
+
+imageData = ctx.getImageData(277, 75, 1, 1);
+data = imageData.data;
+shouldBe("data[0]", "0");
+shouldBe("data[1]", "0");
+shouldBe("data[2]", "0");
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5ea291f..fecb207 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-11-12  Helder Correia  <helder at sencha.com>
+
+        Reviewed by Andreas Kling.
+
+        [Qt] Path::addArc() does not set right angle direction on full arcs
+        https://bugs.webkit.org/show_bug.cgi?id=49138
+
+        Ensure correctness of nonzero winding rule for full arc paths.
+        Invert the sign of the span if the direction is counterclockwise.
+
+        Test: fast/canvas/canvas-arc-360-winding.html
+
+        * platform/graphics/qt/PathQt.cpp:
+        (WebCore::Path::addArc):
+
 2010-11-05  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/platform/graphics/qt/PathQt.cpp b/WebCore/platform/graphics/qt/PathQt.cpp
index b686fef..571b405 100644
--- a/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/WebCore/platform/graphics/qt/PathQt.cpp
@@ -290,12 +290,15 @@ void Path::addArc(const FloatPoint& p, float r, float sar, float ear, bool antic
     double width  = radius*2;
     double height = radius*2;
 
-    if ((!anticlockwise && (ea - sa >= 360)) || (anticlockwise && (sa - ea >= 360)))
+    if ((!anticlockwise && (ea - sa >= 360)) || (anticlockwise && (sa - ea >= 360))) {
         // If the anticlockwise argument is false and endAngle-startAngle is equal to or greater than 2*PI, or, if the
         // anticlockwise argument is true and startAngle-endAngle is equal to or greater than 2*PI, then the arc is the whole
         // circumference of this circle.
         span = 360;
-    else {
+
+        if (anticlockwise)
+            span = -span;
+    } else {
         if (!anticlockwise && (ea < sa))
             span += 360;
         else if (anticlockwise && (sa < ea))

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list