[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
zherczeg at webkit.org
zherczeg at webkit.org
Wed Dec 22 12:16:55 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 1aa29114fc5c492c6f0fc33e02fd13127f3fff2c
Author: zherczeg at webkit.org <zherczeg at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 18 08:38:37 2010 +0000
WebCore: Fix displaying problem of feTurbulence.
https://bugs.webkit.org/show_bug.cgi?id=44111
Patch by Renata Hodovan <reni at inf.u-szeged.hu> on 2010-08-18
Reviewed by Dirk Schulze.
Change the order of calculating turbulenceFunctionResult
and clamping it. Furthermore remove the unnecessary rounding of m_seed.
Add a new test for checking the change of seed's value.
Test: svg/W3C-SVG-1.1/filters-turb-02-f.svg
* svg/graphics/filters/SVGFETurbulence.cpp:
(WebCore::FETurbulence::initPaint):
(WebCore::FETurbulence::calculateTurbulenceValueForPoint):
(WebCore::FETurbulence::apply):
LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=44111
Patch by Renata Hodovan <reni at inf.u-szeged.hu> on 2010-08-18
Reviewed by Dirk Schulze.
Update expected result of test svg/W3C-SVG-1.1/filters-turb-01-f.svg and
add a new test for checking the change of the seed value.
* platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.checksum:
* platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png:
* platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.checksum: Added.
* platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png: Added.
* platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt: Added.
* svg/W3C-SVG-1.1/filters-turb-02-f.svg: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index dca4cd1..3808ae3 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-08-18 Renata Hodovan <reni at inf.u-szeged.hu>
+
+ Reviewed by Dirk Schulze.
+ https://bugs.webkit.org/show_bug.cgi?id=44111
+
+ Update expected result of test svg/W3C-SVG-1.1/filters-turb-01-f.svg and
+ add a new test for checking the change of the seed value.
+
+ * platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.checksum:
+ * platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png:
+ * platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.checksum: Added.
+ * platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png: Added.
+ * platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt: Added.
+ * svg/W3C-SVG-1.1/filters-turb-02-f.svg: Added.
+
2010-08-17 Gavin Barraclough <barraclough at apple.com>
Reviewed by Sam Weinig.
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.checksum b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.checksum
index a1853e9..9676480 100644
--- a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.checksum
+++ b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.checksum
@@ -1 +1 @@
-197d4313f7f222ab4981ad65104effaf
\ No newline at end of file
+8768f07edbff5ceec871624d6fefdf8c
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png
index 4e4547b..814c66f 100644
Binary files a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png and b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-01-f-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.checksum b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.checksum
new file mode 100644
index 0000000..bf89cd3
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.checksum
@@ -0,0 +1 @@
+6125b42b109098b2382d5206eacfc33f
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png
new file mode 100644
index 0000000..95e37df
Binary files /dev/null and b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt
new file mode 100644
index 0000000..f2d10c3
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-turb-02-f-expected.txt
@@ -0,0 +1,96 @@
+layer at (0,0) size 480x360
+ RenderView at (0,0) size 480x360
+layer at (0,0) size 480x360
+ RenderSVGRoot {svg} at (0,0) size 480x360
+ RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+ RenderSVGContainer {g} at (59,26) size 362x270
+ RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+ RenderSVGResourceFilter {filter} [id="turbneg1"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="-0.20" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbneg2"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="-0.50" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbneg3"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="-0.80" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbzero"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="0.00" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbpos1"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="0.20" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbpos2"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="0.50" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbpos3"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="1.50" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbneg4"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="-1.00" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbneg5"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="-1.50" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbneg6"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="-2.00" numOctaves="1" stitchTiles="0"]
+ RenderSVGResourceFilter {filter} [id="turbneg7"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+ [feTurbulence type="TURBULANCE" baseFrequency="0.01, 0.01" seed="-2.60" numOctaves="1" stitchTiles="0"]
+ RenderSVGText {text} at (142,26) size 196x28 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 196x28
+ chunk 1 (middle anchor) text run 1 at (142.00,48.00) startOffset 0 endOffset 17 width 196.00: "feTurbulence seed"
+ RenderSVGContainer {g} at (59,74) size 362x222 [transform={m=((1.00,0.00)(0.00,1.00)) t=(65.00,80.00)}]
+ RenderPath {rect} at (65,80) size 50x50 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbneg3"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (9,63) size 32x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 32x21
+ chunk 1 (middle anchor) text run 1 at (9.50,80.00) startOffset 0 endOffset 4 width 31.00: "-0.8"
+ RenderPath {rect} at (115,80) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,0.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbneg2"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (59,63) size 32x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 32x21
+ chunk 1 (middle anchor) text run 1 at (59.50,80.00) startOffset 0 endOffset 4 width 31.00: "-0.5"
+ RenderPath {rect} at (165,80) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,0.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbneg1"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (109,63) size 32x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 32x21
+ chunk 1 (middle anchor) text run 1 at (109.50,80.00) startOffset 0 endOffset 4 width 31.00: "-0.2"
+ RenderPath {rect} at (215,80) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(150.00,0.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbzero"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (170,63) size 10x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 10x21
+ chunk 1 (middle anchor) text run 1 at (170.00,80.00) startOffset 0 endOffset 1 width 10.00: "0"
+ RenderPath {rect} at (265,80) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(200.00,0.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbpos1"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (212,63) size 26x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 26x21
+ chunk 1 (middle anchor) text run 1 at (212.50,80.00) startOffset 0 endOffset 3 width 25.00: "0.2"
+ RenderPath {rect} at (315,80) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,0.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbpos2"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (262,63) size 26x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 26x21
+ chunk 1 (middle anchor) text run 1 at (262.50,80.00) startOffset 0 endOffset 3 width 25.00: "0.5"
+ RenderPath {rect} at (365,80) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(300.00,0.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbpos3"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (312,63) size 26x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 26x21
+ chunk 1 (middle anchor) text run 1 at (312.50,80.00) startOffset 0 endOffset 3 width 25.00: "1.5"
+ RenderPath {rect} at (59,74) size 362x102 [stroke={[type=SOLID] [color=#000000]}] [data="M-5.00,-5.00 L355.00,-5.00 L355.00,95.00 L-5.00,95.00 Z"]
+ RenderPath {rect} at (65,200) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.00,120.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbneg4"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (17,183) size 16x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 16x21
+ chunk 1 (middle anchor) text run 1 at (17.00,200.00) startOffset 0 endOffset 2 width 16.00: "-1"
+ RenderPath {rect} at (115,200) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(50.00,120.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbneg5"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (59,183) size 32x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 32x21
+ chunk 1 (middle anchor) text run 1 at (59.50,200.00) startOffset 0 endOffset 4 width 31.00: "-1.5"
+ RenderPath {rect} at (59,194) size 112x102 [stroke={[type=SOLID] [color=#000000]}] [data="M-5.00,115.00 L105.00,115.00 L105.00,215.00 L-5.00,215.00 Z"]
+ RenderPath {rect} at (315,200) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,120.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbneg6"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (267,183) size 16x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 16x21
+ chunk 1 (middle anchor) text run 1 at (267.00,200.00) startOffset 0 endOffset 2 width 16.00: "-2"
+ RenderPath {rect} at (365,200) size 50x50 [transform={m=((1.00,0.00)(0.00,1.00)) t=(300.00,120.00)}] [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L50.00,0.00 L50.00,50.00 L0.00,50.00 Z"]
+ [filter="turbneg7"] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+ RenderSVGText {text} at (309,183) size 32x21 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 32x21
+ chunk 1 (middle anchor) text run 1 at (309.50,200.00) startOffset 0 endOffset 4 width 31.00: "-2.6"
+ RenderPath {rect} at (309,194) size 112x102 [stroke={[type=SOLID] [color=#000000]}] [data="M245.00,115.00 L355.00,115.00 L355.00,215.00 L245.00,215.00 Z"]
+ RenderSVGContainer {g} at (10,310) size 231x37
+ RenderSVGText {text} at (10,310) size 231x37 contains 1 chunk(s)
+ RenderSVGInlineText {#text} at (0,0) size 231x37
+ chunk 1 text run 1 at (10.00,340.00) startOffset 0 endOffset 16 width 231.00: "$Revision: 1.7 $"
+ RenderPath {rect} at (0,0) size 480x360 [stroke={[type=SOLID] [color=#000000]}] [data="M1.00,1.00 L479.00,1.00 L479.00,359.00 L1.00,359.00 Z"]
diff --git a/LayoutTests/svg/W3C-SVG-1.1/filters-turb-02-f.svg b/LayoutTests/svg/W3C-SVG-1.1/filters-turb-02-f.svg
new file mode 100644
index 0000000..779bacc
--- /dev/null
+++ b/LayoutTests/svg/W3C-SVG-1.1/filters-turb-02-f.svg
@@ -0,0 +1,147 @@
+<svg id="svg-root" width="100%" height="100%"
+ viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!--======================================================================-->
+ <!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =-->
+ <!--= Institute of Technology, European Research Consortium for =-->
+ <!--= Informatics and Mathematics (ERCIM), Keio University). =-->
+ <!--= All Rights Reserved. =-->
+ <!--= See http://www.w3.org/Consortium/Legal/. =-->
+ <!--======================================================================-->
+ <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
+ template-version="1.3" reviewer="CM" author="ED" status="accepted"
+ version="$Revision: 1.7 $" testname="$RCSfile: filters-turb-02-f.svg,v $">
+ <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/filters.html#feTurbulenceSeedAttribute">
+ <p>
+ This tests the <a>'seed'</a> attribute on <a>'feTurbulence'</a>.
+ </p>
+ </d:testDescription>
+ <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
+ <p>
+ Run the test. No interaction required.
+
+ </p>
+ </d:operatorScript>
+ <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
+ <p>You should see three rectangles with black stroke. In each of these rectangles there should be
+ a series of numbers indicating the value for <a>'seed'</a> that was used on the small rectangle
+ directly above the number. The top stroked rectangle should contain 7 smaller rects that all
+ have a different filter applied to them, the lower two rectangles should contain 2 smaller rects
+ each. The filtered rectangles in each stroked rectangle should all look exactly the same.
+ If the filtered rectangles are red, that indicates that the test has failed.
+ </p>
+ <p>
+ The test has passed if:
+ </p>
+ <ul>
+ <li>the top stroked rectangle contains 7 smaller rectangles that are all identical</li>
+ <li>the lower left stroked rectangle contains 2 smaller rectangles that are identical</li>
+ <li>the lower right stroked rectangle contains 2 smaller rectangles that are identical</li>
+ <li>there's no red visible inside the stroked rectangles</li>
+ </ul>
+ </d:passCriteria>
+ </d:SVGTestCase>
+ <title id="test-title">$RCSfile: filters-turb-02-f.svg,v $</title>
+ <defs>
+ <font-face
+ font-family="SVGFreeSansASCII"
+ unicode-range="U+0-7F">
+ <font-face-src>
+ <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
+ </font-face-src>
+ </font-face>
+ </defs>
+ <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
+ <defs>
+ <!-- test negative values, these two should be same as seed="0" and seed="1" -->
+ <filter id="turbneg1" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="-0.2" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+ <filter id="turbneg2" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="-0.5" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+ <filter id="turbneg3" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="-0.8" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+
+ <!-- the reference for seed="0" -->
+ <filter id="turbzero" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="0" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+
+ <!-- seed="0" is transformed by the setup_seed method to be equal to seed="1" -->
+ <filter id="turbpos1" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="0.2" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+ <filter id="turbpos2" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="0.5" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+ <filter id="turbpos3" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="1.5" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+
+ <!-- These should be the same -->
+ <filter id="turbneg4" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="-1" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+ <filter id="turbneg5" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="-1.5" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+
+ <!-- These should be the same -->
+ <filter id="turbneg6" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="-2" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+ <filter id="turbneg7" x="0" y="0" width="100%" height="100%">
+ <feTurbulence seed="-2.6" baseFrequency="0.01" type="turbulence"/>
+ </filter>
+
+ <style type="text/css">
+ #subtests text { fill: black }
+ </style>
+ </defs>
+
+ <text x="50%" y="2em" style="font-size:24px; text-anchor:middle">feTurbulence seed</text>
+
+ <g id="subtests" transform="translate(65 80)" text-anchor="middle" fill="red">
+ <rect width="50" height="50" filter="url(#turbneg3)"/>
+ <text x="25" y="80">-0.8</text>
+ <rect width="50" height="50" filter="url(#turbneg2)" transform="translate(50 0)"/>
+ <text x="75" y="80">-0.5</text>
+ <rect width="50" height="50" filter="url(#turbneg1)" transform="translate(100 0)"/>
+ <text x="125" y="80">-0.2</text>
+ <rect width="50" height="50" filter="url(#turbzero)" transform="translate(150 0)"/>
+ <text x="175" y="80">0</text>
+ <rect width="50" height="50" filter="url(#turbpos1)" transform="translate(200 0)"/>
+ <text x="225" y="80">0.2</text>
+ <rect width="50" height="50" filter="url(#turbpos2)" transform="translate(250 0)"/>
+ <text x="275" y="80">0.5</text>
+ <rect width="50" height="50" filter="url(#turbpos3)" transform="translate(300 0)"/>
+ <text x="325" y="80">1.5</text>
+ <rect x="-5" y="-5" width="360" height="100" stroke="black" fill="none"/>
+
+ <rect width="50" height="50" filter="url(#turbneg4)" transform="translate(0 120)"/>
+ <text x="25" y="200">-1</text>
+ <rect width="50" height="50" filter="url(#turbneg5)" transform="translate(50 120)"/>
+ <text x="75" y="200">-1.5</text>
+ <rect x="-5" y="115" width="110" height="100" stroke="black" fill="none"/>
+
+ <rect width="50" height="50" filter="url(#turbneg6)" transform="translate(250 120)"/>
+ <text x="275" y="200">-2</text>
+ <rect width="50" height="50" filter="url(#turbneg7)" transform="translate(300 120)"/>
+ <text x="325" y="200">-2.6</text>
+ <rect x="245" y="115" width="110" height="100" stroke="black" fill="none"/>
+ </g>
+ </g>
+ <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
+ <text id="revision" x="10" y="340" stroke="none"
+ fill="black">$Revision: 1.7 $</text>
+ </g>
+ <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
+ <!-- comment out this watermark once the test is approved --><!--
+ <g id="draft-watermark">
+ <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
+ <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
+ text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
+ </g>-->
+</svg>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d5aa474..9a74d59 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-08-18 Renata Hodovan <reni at inf.u-szeged.hu>
+
+ Reviewed by Dirk Schulze.
+
+ Fix displaying problem of feTurbulence.
+ https://bugs.webkit.org/show_bug.cgi?id=44111
+
+ Change the order of calculating turbulenceFunctionResult
+ and clamping it. Furthermore remove the unnecessary rounding of m_seed.
+ Add a new test for checking the change of seed's value.
+
+ Test: svg/W3C-SVG-1.1/filters-turb-02-f.svg
+
+ * svg/graphics/filters/SVGFETurbulence.cpp:
+ (WebCore::FETurbulence::initPaint):
+ (WebCore::FETurbulence::calculateTurbulenceValueForPoint):
+ (WebCore::FETurbulence::apply):
+
2010-08-17 Gavin Barraclough <barraclough at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp b/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
index 7bf40ed..399f7fc 100644
--- a/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
+++ b/WebCore/svg/graphics/filters/SVGFETurbulence.cpp
@@ -181,7 +181,7 @@ inline void FETurbulence::initPaint(PaintingData& paintingData)
gradient[1] /= normalizationFactor;
}
}
- for (int i = s_blockSize - 1; i >= 0; --i) {
+ for (int i = s_blockSize - 1; i > 0; --i) {
int k = paintingData.latticeSelector[i];
int j = paintingData.random() % s_blockSize;
ASSERT(j >= 0);
@@ -311,10 +311,12 @@ unsigned char FETurbulence::calculateTurbulenceValueForPoint(PaintingData& paint
}
}
- // Clamp result
- turbulenceFunctionResult = std::max(std::min(turbulenceFunctionResult, 255.f), 0.f);
+ // The value of turbulenceFunctionResult comes from ((turbulenceFunctionResult * 255) + 255) / 2 by fractalNoise
+ // and (turbulenceFunctionResult * 255) by turbulence.
if (m_type == FETURBULENCE_TYPE_FRACTALNOISE)
- return static_cast<unsigned char>(turbulenceFunctionResult * 127.5f + 127.5f); // It comes form (turbulenceFunctionResult * 255 + 255) / 2
+ turbulenceFunctionResult = turbulenceFunctionResult * 0.5f + 0.5f;
+ // Clamp result
+ turbulenceFunctionResult = std::max(std::min(turbulenceFunctionResult, 1.f), 0.f);
return static_cast<unsigned char>(turbulenceFunctionResult * 255);
}
@@ -328,7 +330,7 @@ void FETurbulence::apply(Filter* filter)
return;
RefPtr<ImageData> imageData = ImageData::create(imageRect.width(), imageRect.height());
- PaintingData paintingData(floorf(fabsf(m_seed)), imageRect.size());
+ PaintingData paintingData(m_seed, imageRect.size());
initPaint(paintingData);
FloatRect filterRegion = filter->filterRegion();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list