2009-11-22 Dirk Schulze <krit@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Nov 2009 01:33:53 +0000 (01:33 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Nov 2009 01:33:53 +0000 (01:33 +0000)
        Reviewed by Nikolas Zimmermann.

        Tests to the filterRes implementation for SVG Filters
        [https://bugs.webkit.org/show_bug.cgi?id=6021]

        big-sized-filter: tests if filter quality is scaled down on a too
            big SourceImage (SourceGraphic, SourceAlpha)
        big-sized-filter-2: tests if the filter quality is scaled down
            on a too big filter effect size.
        filterRes: Various tests of SVG Filters with different values for
            filterRes attributes. Checks
            * that kernel values (if present) are scaled with the filterRes
            * subRegion calculation is correct for effects with deeper
              dependencies.

        * platform/mac/svg/filters/big-sized-filter-2-expected.txt: Added.
        * platform/mac/svg/filters/big-sized-filter-expected.checksum: Added.
        * platform/mac/svg/filters/big-sized-filter-expected.png: Added.
        * platform/mac/svg/filters/big-sized-filter-expected.txt: Added.
        * platform/mac/svg/filters/filterRes-expected.checksum: Added.
        * platform/mac/svg/filters/filterRes-expected.png: Added.
        * platform/mac/svg/filters/filterRes-expected.txt: Added.
        * svg/filters/big-sized-filter-2.svg: Added.
        * svg/filters/big-sized-filter.svg: Added.
        * svg/filters/filterRes.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51301 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac/svg/filters/big-sized-filter-2-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/filterRes-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/filterRes-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/svg/filters/filterRes-expected.txt [new file with mode: 0644]
LayoutTests/svg/filters/big-sized-filter-2.svg [new file with mode: 0644]
LayoutTests/svg/filters/big-sized-filter.svg [new file with mode: 0644]
LayoutTests/svg/filters/filterRes.svg [new file with mode: 0644]

index 21eaced36f12c7f9433d4177bb1234d9dc2cad45..b72866605b124473d12df535d4b38b93902b30d7 100644 (file)
@@ -1,3 +1,31 @@
+2009-11-22  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Tests to the filterRes implementation for SVG Filters
+        [https://bugs.webkit.org/show_bug.cgi?id=6021]
+
+        big-sized-filter: tests if filter quality is scaled down on a too
+            big SourceImage (SourceGraphic, SourceAlpha)
+        big-sized-filter-2: tests if the filter quality is scaled down
+            on a too big filter effect size.
+        filterRes: Various tests of SVG Filters with different values for
+            filterRes attributes. Checks
+            * that kernel values (if present) are scaled with the filterRes
+            * subRegion calculation is correct for effects with deeper
+              dependencies.
+
+        * platform/mac/svg/filters/big-sized-filter-2-expected.txt: Added.
+        * platform/mac/svg/filters/big-sized-filter-expected.checksum: Added.
+        * platform/mac/svg/filters/big-sized-filter-expected.png: Added.
+        * platform/mac/svg/filters/big-sized-filter-expected.txt: Added.
+        * platform/mac/svg/filters/filterRes-expected.checksum: Added.
+        * platform/mac/svg/filters/filterRes-expected.png: Added.
+        * platform/mac/svg/filters/filterRes-expected.txt: Added.
+        * svg/filters/big-sized-filter-2.svg: Added.
+        * svg/filters/big-sized-filter.svg: Added.
+        * svg/filters/filterRes.svg: Added.
+
 2009-11-22  Jakub Wieczorek  <faw217@gmail.com>
 
         Reviewed by Adam Barth.
diff --git a/LayoutTests/platform/mac/svg/filters/big-sized-filter-2-expected.txt b/LayoutTests/platform/mac/svg/filters/big-sized-filter-2-expected.txt
new file mode 100644 (file)
index 0000000..c2ae04e
--- /dev/null
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (0,0) size 20x20
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+    RenderSVGContainer {g} at (0,0) size 20x20
+      RenderPath {rect} at (0,0) size 20x20 [fill={[type=SOLID] [color=#FF0000]}] [filter=filter] [data="M0.00,0.00 L20.00,0.00 L20.00,20.00 L0.00,20.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.checksum b/LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.checksum
new file mode 100644 (file)
index 0000000..1fce7a2
--- /dev/null
@@ -0,0 +1 @@
+5ca950940e92ad43c979676273dfbed6
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.png b/LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.png
new file mode 100644 (file)
index 0000000..ee84659
Binary files /dev/null and b/LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.txt b/LayoutTests/platform/mac/svg/filters/big-sized-filter-expected.txt
new file mode 100644 (file)
index 0000000..65c3e72
--- /dev/null
@@ -0,0 +1,11 @@
+KRenderingPaintServer {id="gradient" [type=LINEAR-GRADIENT] [stops=[(0.00,#008000), (0.10,#FF0000)]] [start=(0,0)] [end=(1,1)]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (0,0) size 20000x20000
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+      RenderSVGHiddenContainer {linearGradient} at (0,0) size 0x0
+        RenderSVGGradientStop {stop} at (0,0) size 0x0
+        RenderSVGGradientStop {stop} at (0,0) size 0x0
+    RenderSVGContainer {g} at (0,0) size 20000x20000
+      RenderPath {rect} at (0,0) size 20000x20000 [fill={[type=LINEAR-GRADIENT] [stops=[(0.00,#008000), (0.10,#FF0000)]] [start=(0,0)] [end=(1,1)]}] [filter=filter] [data="M0.00,0.00 L20000.00,0.00 L20000.00,20000.00 L0.00,20000.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/filters/filterRes-expected.checksum b/LayoutTests/platform/mac/svg/filters/filterRes-expected.checksum
new file mode 100644 (file)
index 0000000..465d6f1
--- /dev/null
@@ -0,0 +1 @@
+fd47ba5b79debb914d2c391d026c9eee
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/filters/filterRes-expected.png b/LayoutTests/platform/mac/svg/filters/filterRes-expected.png
new file mode 100644 (file)
index 0000000..801bd66
Binary files /dev/null and b/LayoutTests/platform/mac/svg/filters/filterRes-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/filters/filterRes-expected.txt b/LayoutTests/platform/mac/svg/filters/filterRes-expected.txt
new file mode 100644 (file)
index 0000000..8d0fe21
--- /dev/null
@@ -0,0 +1,21 @@
+KRenderingPaintServer {id="linGrad" [type=LINEAR-GRADIENT] [stops=[(0.00,#FF0000), (1.00,#00FF00)]] [start=(0,0)] [end=(1,1)]}
+KRenderingPaintServer {id="radGrad" [type=RADIAL-GRADIENT] [stops=[(0.00,#FF0000), (1.00,#00FF00)]] [center=(0.50,0.50)] [focal=(0.50,0.50)] [radius=0.50]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (10,10) size 445.50x100
+    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+      RenderSVGHiddenContainer {linearGradient} at (0,0) size 0x0
+        RenderSVGGradientStop {stop} at (0,0) size 0x0
+        RenderSVGGradientStop {stop} at (0,0) size 0x0
+      RenderSVGHiddenContainer {radialGradient} at (0,0) size 0x0
+        RenderSVGGradientStop {stop} at (0,0) size 0x0
+        RenderSVGGradientStop {stop} at (0,0) size 0x0
+    RenderSVGImage {image} at (10,10) size 100x100 [filter=f1]
+    RenderPath {rect} at (130,10) size 100x100 [fill={[type=SOLID] [color=#000000]}] [filter=over] [data="M130.00,10.00 L230.00,10.00 L230.00,110.00 L130.00,110.00 Z"]
+    RenderSVGContainer {g} at (250,10) size 100x100 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,10.00)}] [filter=gauss]
+      RenderPath {rect} at (250,10) size 75x75 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00 L75.00,0.00 L75.00,75.00 L0.00,75.00 Z"]
+      RenderPath {rect} at (275,35) size 75x75 [fill={[type=SOLID] [color=#0000FF]}] [data="M25.00,25.00 L100.00,25.00 L100.00,100.00 L25.00,100.00 Z"]
+    RenderSVGContainer {g} at (389.50,29.50) size 66x66 [transform={m=((1.00,0.00)(0.00,1.00)) t=(370.00,10.00)}] [filter=dilate2]
+      RenderPath {rect} at (389.50,29.50) size 51x51 [stroke={[type=SOLID] [color=#FF0000]}] [data="M20.00,20.00 L70.00,20.00 L70.00,70.00 L20.00,70.00 Z"]
+      RenderPath {rect} at (404.50,44.50) size 51x51 [stroke={[type=SOLID] [color=#0000FF]}] [data="M35.00,35.00 L85.00,35.00 L85.00,85.00 L35.00,85.00 Z"]
diff --git a/LayoutTests/svg/filters/big-sized-filter-2.svg b/LayoutTests/svg/filters/big-sized-filter-2.svg
new file mode 100644 (file)
index 0000000..cfbe939
--- /dev/null
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+<filter id="filter" filterUnits="userSpaceOnUse" x="0" y="0" width="20000" height="20000">
+<feFlood flood-color="green" x="0" y="0" width="20000" height="20000"/>
+</filter>
+</defs>
+<g>
+<rect x="0" y="0" width="20" height="20" style="fill:red;filter:url(#filter);"/>
+</g>
+</svg>
diff --git a/LayoutTests/svg/filters/big-sized-filter.svg b/LayoutTests/svg/filters/big-sized-filter.svg
new file mode 100644 (file)
index 0000000..cdde009
--- /dev/null
@@ -0,0 +1,14 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+<linearGradient id="gradient" gradientUnits="objectBoundingBox" x1="0" y1="0" x2="1" y2="1">
+<stop offset="0" stop-color="green" />
+<stop offset="0.1" stop-color="red" />
+</linearGradient>
+<filter id="filter">
+<feOffset/>
+</filter>
+</defs>
+<g>
+<rect x="0" y="0" width="20000" height="20000" style="fill:url(#gradient);filter:url(#filter);"/>
+</g>
+</svg>
diff --git a/LayoutTests/svg/filters/filterRes.svg b/LayoutTests/svg/filters/filterRes.svg
new file mode 100644 (file)
index 0000000..a51191e
--- /dev/null
@@ -0,0 +1,42 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+<linearGradient id="linGrad" x1="0%" y1="0%" x2="100%" y2="100%">
+<stop offset="0%" style="stop-color:rgb(255,0,0);stop-opacity:1"/>
+<stop offset="100%" style="stop-color:rgb(0,255,0);stop-opacity:1"/>
+</linearGradient>
+<radialGradient id="radGrad" cx="50%" cy="50%" r="50%" fx="50%" fy="50%">
+<stop offset="0%" style="stop-color:rgb(255,0,0);stop-opacity:1"/>
+<stop offset="100%" style="stop-color:rgb(0,255,0);stop-opacity:1"/>
+</radialGradient>
+<filter id="f1" filterUnits="objectBoundingBox" x="0" y="0" width="1" height="1" primitiveUnits="objectBoundingBox" filterRes="50 60">
+    <feFlood flood-color="#000" x="5%" y="5%" width="5%" height="5%" result="flood1"/>
+    <feFlood flood-color="#000" x="0%" y="0%" width="5%" height="5%" result="flood2"/>
+    <feComposite in="flood1" in2="flood2" result="pair"/>
+    <feTile in="pair" result="tile"/>
+    <feDisplacementMap in="tile" in2="SourceGraphic" scale="64" xChannelSelector="R" yChannelSelector="G"/>
+</filter>
+<filter id="over" filterUnits="objectBoundingBox" primitiveUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%" filterRes="20 200">
+    <feFlood flood-color="#f00" flood-opacity="0.5" result="res1" x="0%" y="0%" width="75%" height="75%"/>
+    <feFlood flood-color="#00f" flood-opacity="0.5" result="res2" x="25%" y="25%" width="75%" height="75%"/>
+    <feComposite in2="res1" in="res2" operator="over"/>
+</filter>
+<filter id="gauss" filterRes="20 42.1">
+    <feGaussianBlur stdDeviation="10"/>
+</filter>
+<filter id="dilate2" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%"  filterRes="50 49.999">
+       <feMorphology operator="dilate" radius="3 1"/>
+</filter>
+</defs>
+
+<image x="10" y="10" width="100" height="100" xlink:href="../W3C-SVG-1.1/resources/sphere.png" filter="url(#f1)"/>
+<rect x="130" y="10" width="100" height="100" filter="url(#over)"/>
+<g filter="url(gauss)"  transform="translate(250, 10)">
+    <rect x="0" y="0" width="75" height="75" fill="red"/>
+    <rect x="25" y="25" width="75" height="75" fill="blue"/>
+</g>
+<g filter="url(dilate2)"  transform="translate(370, 10)">
+    <rect x="20" y="20" width="50" height="50" style="fill:none;stroke:red;"/>
+    <rect x="35" y="35" width="50" height="50" style="fill:none;stroke:blue"/>
+</g>
+</svg>
+