| <title>Canvas test: 2d.composite.image.source-atop</title> |
| <script src="../tests.js"></script> |
| <link rel="stylesheet" href="../tests.css"> |
| <link rel="prev" href="2d.composite.image.destination-out.html" title="2d.composite.image.destination-out"> |
| <link rel="next" href="2d.composite.image.destination-atop.html" title="2d.composite.image.destination-atop"> |
| <body class="show_output"> |
| <a href="2d.composite.image.destination-out.html" accesskey="p" title="[p] 2d.composite.image.destination-out"><</a> |
| <a href="index.html">[index]</a> |
| <a href="2d.composite.image.destination-atop.html" accesskey="n" title="[n] 2d.composite.image.destination-atop">></a> |
| <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>.source-atop</h1> |
| <div class="refs">References: |
| <li><a href="spec.html#testrefs.2d.composite.source-atop">2d.composite.source-atop</a> |
| <p class="output">Actual output:</p> |
| <canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> |
| <p class="output expectedtext">Expected output:<p><img src="2d.composite.image.source-atop.png" class="output expected" id="expected" alt=""> |
| _addTest(function(canvas, ctx) { |
| ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; |
| ctx.fillRect(0, 0, 100, 50); |
| ctx.globalCompositeOperation = 'source-atop'; |
| ctx.drawImage(document.getElementById('yellow75.png'), 0, 0); |
| _assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5); |
| <img src="../images/yellow75.png" id="yellow75.png" class="resource"> |