tor-browser

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

2d.composite.uncovered.fill.destination-in.html (1231B)


      1 <!DOCTYPE html>
      2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
      3 <meta charset="UTF-8">
      4 <title>OffscreenCanvas test: 2d.composite.uncovered.fill.destination-in</title>
      5 <meta name="timeout" content="long">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="/html/canvas/resources/canvas-tests.js"></script>
      9 
     10 <h1>2d.composite.uncovered.fill.destination-in</h1>
     11 <p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
     12 
     13 
     14 <script>
     15 var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.");
     16 var t_pass = t.done.bind(t);
     17 var t_fail = t.step_func(function(reason) {
     18    throw reason;
     19 });
     20 t.step(function() {
     21 
     22  var canvas = new OffscreenCanvas(100, 50);
     23  var ctx = canvas.getContext('2d');
     24 
     25  ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
     26  ctx.fillRect(0, 0, 100, 50);
     27  ctx.globalCompositeOperation = 'destination-in';
     28  ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
     29  ctx.translate(0, 25);
     30  ctx.fillRect(0, 50, 100, 50);
     31  _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5);
     32  t.done();
     33 
     34 });
     35 </script>