Debian Codegraph @

test_non_regression/fail/filter/filters-background-01-f.svg

raw
1 <svg id="svg-root" width="100%" height="100%"
2 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
3 xmlns:xlink="http://www.w3.org/1999/xlink">
4 <!--======================================================================-->
5 <!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =-->
6 <!--= Institute of Technology, European Research Consortium for =-->
7 <!--= Informatics and Mathematics (ERCIM), Keio University). =-->
8 <!--= All Rights Reserved. =-->
9 <!--= See http://www.w3.org/Consortium/Legal/. =-->
10 <!--======================================================================-->
11 <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
12 template-version="1.4" reviewer="[reviewer]" author="ED" status="created"
13 version="$Revision: 1.2 $" testname="$RCSfile: filters-background-01-f.svg,v $">
14 <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/filters.html#AccessingBackgroundImage">
15 <p>
16 Test background image processing.
17 </p>
18 <p>
19 The first subtest enables background image processing and adds an empty ‘g’ element
20 which invokes the ShiftBGAndBlur filter. This filter takes the current accumulated
21 background image (i.e., the entire reference graphic) as input, shifts its offscreen
22 down, blurs it, and then writes the result to the canvas. Note that the offscreen for
23 the filter is initialized to transparent black, which allows the already rendered
24 rectangle, circle and triangle to show through after the filter renders its own
25 result to the canvas.
26 </p>
27 <p>
28 The second subtest enables background image processing and instead invokes the
29 ShiftBGAndBlur filter on the inner ‘g’ element. The accumulated background at the
30 time the filter is applied contains only the rectangle. Because the children
31 of the inner ‘g’ (i.e., the circle and triangle) are not part of the inner ‘g’ element's
32 background and because ShiftBGAndBlur ignores SourceGraphic, the children of the inner ‘g’
33 do not appear in the result.
34 </p>
35 <p>
36 The third subtest enables background image processing and invokes the ShiftBGAndBlur on the
37 ‘polygon’ element that draws the triangle. The accumulated background at the time the filter
38 is applied contains the rectangle plus the circle ignoring the effect of the ‘opacity’
39 property on the inner ‘g’ element. (Note that the blurred circle at the bottom does not
40 let the rectangle show through on its left side. This is due to ignoring the effect of
41 the ‘opacity’ property.) Because the triangle itself is not part of the accumulated background
42 and because ShiftBGAndBlur ignores SourceGraphic, the triangle does not appear in the result.
43 </p>
44 <p>
45 The fourth subtest is the same as the third except that filter ShiftBGAndBlur_WithSourceGraphic is
46 invoked instead of ShiftBGAndBlur. ShiftBGAndBlur_WithSourceGraphic performs the same effect as
47 ShiftBGAndBlur, but then renders the SourceGraphic on top of the shifted, blurred background
48 image. In this case, SourceGraphic is the blue triangle; thus, the result is the same as in
49 the fourth case except that the triangle now appears.
50 </p>
51 </d:testDescription>
52 <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
53 <p>
54 Run the test. No interaction required.
55 </p>
56 </d:operatorScript>
57 <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
58 <p>
59 The test is passed if:
60 </p>
61 <ul>
62 <li>each blue rectangle has the same shapes twice inside, once without filters applied, once with (blurred)</li>
63 <li>from left to right, the blue rectangles contain the following shapes: [rectangle, circle, triangle], [rectangle], [rectangle, circle], [rectangle, circle, triangle]</li>
64 </ul>
65 </d:passCriteria>
66 </d:SVGTestCase>
67 <title id="test-title">$RCSfile: filters-background-01-f.svg,v $</title>
68 <defs>
69 <font-face
70 font-family="SVGFreeSansASCII"
71 unicode-range="U+0-7F">
72 <font-face-src>
73 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
74 </font-face-src>
75 </font-face>
76 </defs>
77 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
78 <defs>
79 <filter id="ShiftBGAndBlur" filterUnits="userSpaceOnUse" x="0" y="0" width="1200" height="400">
80 <desc>
81 This filter discards the SourceGraphic, if any, and just produces
82 a result consisting of the BackgroundImage shifted down 125 units
83 and then blurred.
84 </desc>
85 <feOffset in="BackgroundImage" dx="0" dy="125" />
86 <feGaussianBlur stdDeviation="8" />
87 </filter>
88 <filter id="ShiftBGAndBlur_WithSourceGraphic"
89 filterUnits="userSpaceOnUse" x="0" y="0" width="1200" height="400">
90 <desc>
91 This filter takes the BackgroundImage, shifts it down 125 units, blurs it,
92 and then renders the SourceGraphic on top of the shifted/blurred background.
93 </desc>
94 <feOffset in="BackgroundImage" dx="0" dy="125" />
95 <feGaussianBlur stdDeviation="8" result="blur" />
96 <feMerge>
97 <feMergeNode in="blur"/>
98 <feMergeNode in="SourceGraphic"/>
99 </feMerge>
100 </filter>
101 </defs>
102
103 <g transform="scale(0.4) translate(-200 300)">
104 <g enable-background="new" transform="translate(270,0)">
105 <desc>The second adds an empty 'g' element which invokes ShiftBGAndBlur.</desc>
106 <rect x="25" y="25" width="100" height="100" fill="fuchsia"/>
107 <g opacity=".5">
108 <circle cx="125" cy="75" r="45" fill="#D3FF00"/>
109 <polygon points="160,25 160,125 240,75" fill="#7A16FF"/>
110 </g>
111 <g filter="url(#ShiftBGAndBlur)"/>
112 <rect x="5" y="5" width="260" height="260" fill="none" stroke="blue"/>
113 </g>
114
115 <g enable-background="new" transform="translate(540,0)">
116 <desc>The third invokes ShiftBGAndBlur on the inner group.</desc>
117 <rect x="25" y="25" width="100" height="100" fill="fuchsia"/>
118 <g filter="url(#ShiftBGAndBlur)" opacity=".5">
119 <circle cx="125" cy="75" r="45" fill="#D3FF00"/>
120 <polygon points="160,25 160,125 240,75" fill="#7A16FF"/>
121 </g>
122 <rect x="5" y="5" width="260" height="260" fill="none" stroke="blue"/>
123 </g>
124
125 <g enable-background="new" transform="translate(810,0)">
126 <desc>The fourth invokes ShiftBGAndBlur on the triangle.</desc>
127 <rect x="25" y="25" width="100" height="100" fill="fuchsia"/>
128 <g opacity=".5">
129 <circle cx="125" cy="75" r="45" fill="#D3FF00"/>
130 <polygon points="160,25 160,125 240,75" fill="#7A16FF"
131 filter="url(#ShiftBGAndBlur)"/>
132 </g>
133 <rect x="5" y="5" width="260" height="260" fill="none" stroke="blue"/>
134 </g>
135
136 <g enable-background="new" transform="translate(1080,0)">
137 <desc>The fifth invokes ShiftBGAndBlur_WithSourceGraphic on the triangle.</desc>
138 <rect x="25" y="25" width="100" height="100" fill="fuchsia"/>
139 <g opacity=".5">
140 <circle cx="125" cy="75" r="45" fill="#D3FF00"/>
141 <polygon points="160,25 160,125 240,75" fill="#7A16FF"
142 filter="url(#ShiftBGAndBlur_WithSourceGraphic)"/>
143 </g>
144 <rect x="5" y="5" width="260" height="260" fill="none" stroke="blue"/>
145 </g>
146 </g>
147 </g>
148 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
149 <text id="revision" x="10" y="340" stroke="none"
150 fill="black">$Revision: 1.2 $</text>
151 </g>
152 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
153 <!-- comment out this watermark once the test is approved -->
154 <g id="draft-watermark">
155 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
156 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
157 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
158 </g>
159 </svg>