2 <!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
3 <title>OffscreenCanvas test:
2d.composite.uncovered.fill.destination-in
</title>
4 <meta name=
"timeout" content=
"long">
5 <script src=
"/resources/testharness.js"></script>
6 <script src=
"/resources/testharnessreport.js"></script>
7 <script src=
"/html/canvas/resources/canvas-tests.js"></script>
9 <h1>2d.composite.uncovered.fill.destination-in
</h1>
10 <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>
14 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.");
15 var t_pass
= t
.done
.bind(t
);
16 var t_fail
= t
.step_func(function(reason
) {
21 var canvas
= new OffscreenCanvas(100, 50);
22 var ctx
= canvas
.getContext('2d');
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)';
30 ctx
.fillRect(0, 50, 100, 50);
31 _assertPixelApprox(canvas
, 50,25, 0,0,0,0, 5);