chang.shu@nokia.com | d5cb910 | 2010-05-21 20:47:13 +0000 | [diff] [blame^] | 1 | <!DOCTYPE html> |
| 2 | <title>Canvas test: 2d.composite.image.destination-in</title> |
| 3 | <script src="../tests.js"></script> |
| 4 | <link rel="stylesheet" href="../tests.css"> |
| 5 | <link rel="prev" href="2d.composite.image.source-in.html" title="2d.composite.image.source-in"> |
| 6 | <link rel="next" href="2d.composite.image.source-out.html" title="2d.composite.image.source-out"> |
| 7 | <body class="show_output"> |
| 8 | <p> |
| 9 | <a href="2d.composite.image.source-in.html" accesskey="p" title="[p] 2d.composite.image.source-in"><</a> |
| 10 | <a href="index.html">[index]</a> |
| 11 | <a href="2d.composite.image.source-out.html" accesskey="n" title="[n] 2d.composite.image.source-out">></a> |
| 12 | <h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.destination-in</h1> |
| 13 | <p class="desc"></p> |
| 14 | <div class="refs">References: |
| 15 | <ul> |
| 16 | <li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a> |
| 17 | |
| 18 | </ul> |
| 19 | </div> |
| 20 | |
| 21 | <p class="output">Actual output:</p> |
| 22 | <canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> |
| 23 | <p class="output expectedtext">Expected output:<p><img src="2d.composite.image.destination-in.png" class="output expected" id="expected" alt=""> |
| 24 | <ul id="d"></ul> |
| 25 | <script> |
| 26 | _addTest(function(canvas, ctx) { |
| 27 | |
| 28 | |
| 29 | ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; |
| 30 | ctx.fillRect(0, 0, 100, 50); |
| 31 | ctx.globalCompositeOperation = 'destination-in'; |
| 32 | ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); |
| 33 | _assertPixelApprox(canvas, 50,25, 0,255,255,95, "50,25", "0,255,255,95", 5); |
| 34 | |
| 35 | |
| 36 | }); |
| 37 | </script> |
| 38 | <img src="../images/yellow75.png" id="yellow75.png" class="resource"> |
| 39 | |