2d.drawImage.floatsource.worker.js (647B)
1 // DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. 2 // OffscreenCanvas test in a worker:2d.drawImage.floatsource 3 // Description: 4 // Note: 5 6 importScripts("/resources/testharness.js"); 7 importScripts("/html/canvas/resources/canvas-tests.js"); 8 9 promise_test(async t => { 10 var canvas = new OffscreenCanvas(100, 50); 11 var ctx = canvas.getContext('2d'); 12 13 const response = await fetch('/images/green.png'); 14 const blob = await response.blob(); 15 const bitmap = await createImageBitmap(blob); 16 ctx.drawImage(bitmap, 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50); 17 _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); 18 }, ""); 19 done();