OLD | NEW |
1 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height
="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintAndPixelTest
()"> | 1 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="400" height
="400" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runRepaintAndPixelTest
()"> |
2 <script xlink:href="../resources/text-based-repaint.js"></script> | 2 <script xlink:href="../../../paint/invalidation/resources/text-based-repaint.js
"></script> |
3 <script type="text/javascript"> | 3 <script type="text/javascript"> |
4 window.testIsAsync = true; | 4 window.testIsAsync = true; |
5 window.outputRepaintRects = false; | 5 window.outputRepaintRects = false; |
6 var start = new Date(); | 6 var start = new Date(); |
7 </script> | 7 </script> |
8 <text x="10" y="15" font-weight="900" font-size="5">SVG Performance test.</text
> | 8 <text x="10" y="15" font-weight="900" font-size="5">SVG Performance test.</text
> |
9 <text x="10" y="95" font-weight="900" font-size="5">Test not started.</text> | 9 <text x="10" y="95" font-weight="900" font-size="5">Test not started.</text> |
10 <rect x="0" y="0" height="100" width="100" stroke="black" fill="none"/> | 10 <rect x="0" y="0" height="100" width="100" stroke="black" fill="none"/> |
11 <script type="text/javascript"><![CDATA[ | 11 <script type="text/javascript"><![CDATA[ |
12 var svg = document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'svg')
[0]; | 12 var svg = document.getElementsByTagNameNS('http://www.w3.org/2000/svg', 'svg')
[0]; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 var maxBlocks = Xs.length / maxPerBlock; | 49 var maxBlocks = Xs.length / maxPerBlock; |
50 var count = 0; | 50 var count = 0; |
51 function repaintTest() { | 51 function repaintTest() { |
52 for (var subcount = 0; subcount < maxPerBlock; subcount += 1) { | 52 for (var subcount = 0; subcount < maxPerBlock; subcount += 1) { |
53 var index = count * maxPerBlock + subcount; | 53 var index = count * maxPerBlock + subcount; |
54 var newI = document.createElementNS('http://www.w3.org/2000/svg', 'image')
; | 54 var newI = document.createElementNS('http://www.w3.org/2000/svg', 'image')
; |
55 newI.setAttribute('x', Xs[index] - (99 / Ss[index]) / 2); | 55 newI.setAttribute('x', Xs[index] - (99 / Ss[index]) / 2); |
56 newI.setAttribute('y', Ys[index] - (195 / Ss[index]) / 2); | 56 newI.setAttribute('y', Ys[index] - (195 / Ss[index]) / 2); |
57 newI.setAttribute('height', 195 / Ss[index]); | 57 newI.setAttribute('height', 195 / Ss[index]); |
58 newI.setAttribute('width', 99 / Ss[index]); | 58 newI.setAttribute('width', 99 / Ss[index]); |
59 newI.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '../../../svg/
hixie/perf/resources/smallcats.gif'); | 59 newI.setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'resources/sma
llcats.gif'); |
60 newI.setAttribute('transform', 'translate(50, 50) rotate(' + Rs[index] + '
) translate(-50, -50)'); | 60 newI.setAttribute('transform', 'translate(50, 50) rotate(' + Rs[index] + '
) translate(-50, -50)'); |
61 newI.appendChild(document.createTextNode(index)); // 'TEST')); | 61 newI.appendChild(document.createTextNode(index)); // 'TEST')); |
62 svg.insertBefore(newI, t); | 62 svg.insertBefore(newI, t); |
63 } | 63 } |
64 ++count; | 64 ++count; |
65 if (count < maxBlocks) { | 65 if (count < maxBlocks) { |
66 window.setTimeout(repaintTest, delay); | 66 window.setTimeout(repaintTest, delay); |
67 t.firstChild.data = 'Test in progress... ' + count + ' of ' + maxBlocks; | 67 t.firstChild.data = 'Test in progress... ' + count + ' of ' + maxBlocks; |
68 } else { | 68 } else { |
69 if (window.testRunner) | 69 if (window.testRunner) |
70 t.firstChild.data = 'Test completed'; | 70 t.firstChild.data = 'Test completed'; |
71 else { | 71 else { |
72 var end = new Date(); | 72 var end = new Date(); |
73 var elapsed = (end - start) / 1000; | 73 var elapsed = (end - start) / 1000; |
74 t.firstChild.data = 'Test completed in ' + elapsed.toFixed(2) + 's.'; | 74 t.firstChild.data = 'Test completed in ' + elapsed.toFixed(2) + 's.'; |
75 if (parent.reportResults) parent.reportResults(end - start); | 75 if (parent.reportResults) parent.reportResults(end - start); |
76 } | 76 } |
77 finishRepaintTest(); | 77 finishRepaintTest(); |
78 } | 78 } |
79 } | 79 } |
80 ]]></script> | 80 ]]></script> |
81 </svg> | 81 </svg> |
OLD | NEW |