[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 17:54:18 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bab1a23df337fa5ba72a4817e8769006ca15d5d5
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 2 13:39:21 2010 +0000

    2010-12-02  Andreas Kling  <kling at webkit.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] GraphicsContext::strokeRect() taints the context's lineWidth
            https://bugs.webkit.org/show_bug.cgi?id=50269
    
            * fast/canvas/canvas-lineWidth-intact-after-strokeRect-expected.txt: Added.
            * fast/canvas/canvas-lineWidth-intact-after-strokeRect.html: Added.
            * fast/canvas/script-tests/canvas-lineWidth-intact-after-strokeRect.js: Added.
    2010-12-02  Andreas Kling  <kling at webkit.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] GraphicsContext::strokeRect() taints the context's lineWidth
            https://bugs.webkit.org/show_bug.cgi?id=50269
    
            Test: fast/canvas/canvas-lineWidth-intact-after-strokeRect.html
    
            * platform/graphics/qt/GraphicsContextQt.cpp:
            (WebCore::GraphicsContext::strokeRect): Restore the context's
            original stroke thickness after painting.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ce95564..71cfe55 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-12-02  Andreas Kling  <kling at webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] GraphicsContext::strokeRect() taints the context's lineWidth
+        https://bugs.webkit.org/show_bug.cgi?id=50269
+
+        * fast/canvas/canvas-lineWidth-intact-after-strokeRect-expected.txt: Added.
+        * fast/canvas/canvas-lineWidth-intact-after-strokeRect.html: Added.
+        * fast/canvas/script-tests/canvas-lineWidth-intact-after-strokeRect.js: Added.
+
 2010-12-02  Alexander Pavlov  <apavlov at chromium.org>
 
         Unreviewed, build fix.
diff --git a/LayoutTests/fast/canvas/canvas-lineWidth-intact-after-strokeRect-expected.txt b/LayoutTests/fast/canvas/canvas-lineWidth-intact-after-strokeRect-expected.txt
new file mode 100644
index 0000000..9bed3fe
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-lineWidth-intact-after-strokeRect-expected.txt
@@ -0,0 +1,23 @@
+Test that the rendering context's lineWidth is intact after calling strokeRect()
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS ctx.fillStyle is '#ff0000'
+PASS imgdata[0] is 255
+PASS imgdata[1] is 0
+PASS imgdata[2] is 0
+PASS imgdata[3] is 255
+PASS imgdata[4] is 0
+PASS imgdata[5] is 0
+PASS imgdata[6] is 0
+PASS imgdata[7] is 0
+PASS ctx.lineWidth is 100
+PASS imgdata[0] is 0
+PASS imgdata[1] is 128
+PASS imgdata[2] is 0
+PASS imgdata[3] is 255
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/canvas/canvas-lineWidth-intact-after-strokeRect.html b/LayoutTests/fast/canvas/canvas-lineWidth-intact-after-strokeRect.html
new file mode 100644
index 0000000..9abec42
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-lineWidth-intact-after-strokeRect.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-lineWidth-intact-after-strokeRect.js"></script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/canvas/script-tests/canvas-lineWidth-intact-after-strokeRect.js b/LayoutTests/fast/canvas/script-tests/canvas-lineWidth-intact-after-strokeRect.js
new file mode 100644
index 0000000..793b441
--- /dev/null
+++ b/LayoutTests/fast/canvas/script-tests/canvas-lineWidth-intact-after-strokeRect.js
@@ -0,0 +1,40 @@
+description("Test that the rendering context's lineWidth is intact after calling strokeRect()");
+var ctx = document.createElement('canvas').getContext('2d');
+
+ctx.fillStyle = 'red';
+ctx.fillRect(0, 0, 1, 1);
+
+var imageData = ctx.getImageData(0, 0, 2, 1);
+var imgdata = imageData.data;
+shouldBe("ctx.fillStyle", "'#ff0000'");
+shouldBe("imgdata[0]", "255");
+shouldBe("imgdata[1]", "0");
+shouldBe("imgdata[2]", "0");
+shouldBe("imgdata[3]", "255");
+shouldBe("imgdata[4]", "0");
+shouldBe("imgdata[5]", "0");
+shouldBe("imgdata[6]", "0");
+shouldBe("imgdata[7]", "0");
+
+ctx.strokeStyle = 'red';
+ctx.lineWidth = 100;
+// NOTE: This version of strokeRect() is WebKit-specific and not part of the standard API.
+ctx.strokeRect(0, 0, 10, 10, 1);
+shouldBe("ctx.lineWidth", "100");
+
+ctx.strokeStyle = 'green';
+ctx.beginPath();
+ctx.moveTo(0, 0);
+ctx.lineTo(20, 20);
+ctx.stroke();
+
+imageData = ctx.getImageData(2, 2, 1, 1);
+imgdata = imageData.data;
+shouldBe("imgdata[0]", "0");
+shouldBe("imgdata[1]", "128");
+shouldBe("imgdata[2]", "0");
+shouldBe("imgdata[3]", "255");
+
+document.body.appendChild(ctx.canvas)
+
+var successfullyParsed = true;
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6b336cf..1ea091c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-02  Andreas Kling  <kling at webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] GraphicsContext::strokeRect() taints the context's lineWidth
+        https://bugs.webkit.org/show_bug.cgi?id=50269
+
+        Test: fast/canvas/canvas-lineWidth-intact-after-strokeRect.html
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::strokeRect): Restore the context's
+        original stroke thickness after painting.
+
 2010-12-02  Renata Hodovan  <reni at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 0d6c640..bbbcedb 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -1042,15 +1042,23 @@ void GraphicsContext::clearRect(const FloatRect& rect)
         p->setCompositionMode(currentCompositionMode);
 }
 
-void GraphicsContext::strokeRect(const FloatRect& rect, float width)
+void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth)
 {
     if (paintingDisabled())
         return;
 
     Path path;
     path.addRect(rect);
-    setStrokeThickness(width);
+
+    float previousStrokeThickness = strokeThickness();
+
+    if (lineWidth != previousStrokeThickness)
+        setStrokeThickness(lineWidth);
+
     strokePath(path);
+
+    if (lineWidth != previousStrokeThickness)
+        setStrokeThickness(previousStrokeThickness);
 }
 
 void GraphicsContext::setLineCap(LineCap lc)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list