tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

2d.reset.after-rasterization.html (930B)


      1 <!DOCTYPE html>
      2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
      3 <meta charset="UTF-8">
      4 <link rel="match" href="2d.reset.after-rasterization-expected.html">
      5 <title>Canvas test: 2d.reset.after-rasterization</title>
      6 <h1>2d.reset.after-rasterization</h1>
      7 <p class="desc">Reset after rasterizing a frame discards frame content.</p>
      8 <canvas id="canvas" width="100" height="50">
      9  <p class="fallback">FAIL (fallback content)</p>
     10 </canvas>
     11 <script>
     12  const canvas = new OffscreenCanvas(100, 50);
     13  const ctx = canvas.getContext('2d');
     14 
     15  ctx.fillStyle = 'rgba(255, 0, 0, 1)';
     16  ctx.fillRect(0, 0, 100, 50);
     17 
     18  ctx.getImageData(0, 0, 1, 1);  // Force previous draw calls to be rendered.
     19  ctx.reset();
     20 
     21  ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
     22  ctx.fillRect(0, 0, 100, 25);
     23 
     24  const outputCanvas = document.getElementById("canvas");
     25  outputCanvas.getContext('2d').drawImage(canvas, 0, 0);
     26 </script>