OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <script src="resources/repaint.js"></script> | 2 <script src="resources/repaint.js"></script> |
3 <body onload="runRepaintTest();"> | 3 <body onload="runRepaintTest();"> |
4 <canvas id="canvas-source-in" width="100" height="100"></canvas> | 4 <canvas id="canvas-source-in" width="100" height="100"></canvas> |
5 <canvas id="canvas-copy" width="100" height="100"></canvas> | 5 <canvas id="canvas-copy" width="100" height="100"></canvas> |
6 <script> | 6 <script> |
7 var compositeTypes = ['source-in','copy']; | 7 var compositeTypes = ['source-in','copy']; |
8 | 8 |
9 if (window.testRunner) | 9 if (window.testRunner) |
10 testRunner.dumpAsText(true); | 10 testRunner.dumpAsTextWithPixelResults(); |
11 | 11 |
12 for (i = 0; i < compositeTypes.length; i++) { | 12 for (i = 0; i < compositeTypes.length; i++) { |
13 var canvas = document.getElementById('canvas-' + compositeTypes[i]); | 13 var canvas = document.getElementById('canvas-' + compositeTypes[i]); |
14 var ctx = canvas.getContext('2d'); | 14 var ctx = canvas.getContext('2d'); |
15 ctx.fillStyle = '#0f0'; | 15 ctx.fillStyle = '#0f0'; |
16 ctx.fillRect(0, 0, 100, 100); | 16 ctx.fillRect(0, 0, 100, 100); |
17 } | 17 } |
18 | 18 |
19 function repaintTest() | 19 function repaintTest() |
20 { | 20 { |
21 for (i = 0; i < compositeTypes.length; i++) { | 21 for (i = 0; i < compositeTypes.length; i++) { |
22 var canvas = document.getElementById('canvas-' + compositeTypes[i]); | 22 var canvas = document.getElementById('canvas-' + compositeTypes[i]); |
23 var ctx = canvas.getContext('2d'); | 23 var ctx = canvas.getContext('2d'); |
24 ctx.globalCompositeOperation = compositeTypes[i]; | 24 ctx.globalCompositeOperation = compositeTypes[i]; |
25 ctx.fillStyle = '#00f'; | 25 ctx.fillStyle = '#00f'; |
26 ctx.fillRect(40, 40, 20, 20); | 26 ctx.fillRect(40, 40, 20, 20); |
27 } | 27 } |
28 } | 28 } |
29 | 29 |
30 </script> | 30 </script> |
31 </body> | 31 </body> |
OLD | NEW |