{"ScriptPreparationCode":"const image = document.createElement(\u0027img\u0027);\r\nconst loading = new Promise(resolve =\u003E {\r\n image.src = \u0027https://1.bp.blogspot.com/-52MtzD0GfX0/WvP52CL1WjI/AAAAAAAAOVw/_OpK4JHeWK01d-7IiZ6vzojYGhXqLRXrACLcBGAs/s1600/EMxediL.jpg\u0027;\r\n image.addEventListener(\u0027load\u0027, () =\u003E resolve(image));\r\n});\r\n(async function setup () {\r\n \tawait loading;\r\n const width = image.naturalWidth;\r\n const height = image.naturalHeight;\r\n\r\n canvas = document.createElement(\u0027canvas\u0027);\r\n canvas.width = width;\r\n canvas.height = height;\r\n canvas.getContext(\u00272d\u0027).drawImage(image, 0, 0);\r\n\r\n offscreen = new OffscreenCanvas(width, height);\r\n offscreen.getContext(\u00272d\u0027).drawImage(image, 0, 0);\r\n\r\n bitmap = offscreen.transferToImageBitmap();\r\n\r\n const c1 = document.createElement(\u0027canvas\u0027);\r\n c1.width = width;\r\n c1.height = height;\r\n ctx1 = c1.getContext(\u00272d\u0027);\r\n\r\n const c2 = new OffscreenCanvas(width, height);\r\n ctx2 = c2.getContext(\u00272d\u0027);\r\n \r\n \tconst c3 = document.createElement(\u0027canvas\u0027);\r\n c3.width = width;\r\n c3.height = height;\r\n ctx3 = c3.getContext(\u0027bitmaprenderer\u0027);\r\n \r\n \tconst c4 = new OffscreenCanvas(width, height);\r\n ctx4 = c4.getContext(\u0027bitmaprenderer\u0027);\r\n})();\r\nasync function getTestObjects() {\r\n \tawait loading;\r\n \treturn {\r\n image,\r\n canvas,\r\n offscreen,\r\n bitmap,\r\n ctx1,\r\n ctx2,\r\n ctx3,\r\n ctx4,\r\n }\r\n}","TestCases":[{"Name":"HTMLCanvasElement 2d drawImage HTMLImageElement","Code":"(async function draw() {\r\n const {ctx1, image} = await getTestObjects();\r\n ctx1.drawImage(image, 0, 0);\r\n})();","IsDeferred":false},{"Name":"HTMLCanvasElement 2d drawImage HTMLCanvasElement","Code":"(async function draw() {\r\n const {ctx1, canvas} = await getTestObjects();\r\n ctx1.drawImage(canvas, 0, 0);\r\n})();","IsDeferred":false},{"Name":"HTMLCanvasElement 2d drawImage OffscrenCanvas","Code":"(async function draw() {\r\n const {ctx1, offscreen} = await getTestObjects();\r\n ctx1.drawImage(offscreen, 0, 0);\r\n})();","IsDeferred":false},{"Name":"HTMLCanvasElement 2d drawImage ImageBitmap","Code":"(async function draw() {\r\n const {ctx1, bitmap} = await getTestObjects();\r\n ctx1.drawImage(bitmap, 0, 0);\r\n})();","IsDeferred":false},{"Name":"OffscreenCanvas 2d drawImage HTMLImageELement","Code":"(async function draw() {\r\n const {ctx2, image} = await getTestObjects();\r\n ctx2.drawImage(image, 0, 0);\r\n})();","IsDeferred":false},{"Name":"OffscreenCanvas 2d drawImage HTMLCanvasElement","Code":"(async function draw() {\r\n const {ctx2, canvas} = await getTestObjects();\r\n ctx2.drawImage(canvas, 0, 0);\r\n})();","IsDeferred":false},{"Name":"OffscreenCanvas 2d drawImage OffscreenCanvas","Code":"(async function draw() {\r\n const {ctx2, offscreen} = await getTestObjects();\r\n ctx2.drawImage(offscreen, 0, 0);\r\n})();","IsDeferred":false},{"Name":"OffscreenCanvas 2d drawImage ImageBitmap","Code":"(async function draw() {\r\n const {ctx2, bitmap} = await getTestObjects();\r\n ctx2.drawImage(bitmap, 0, 0);\r\n})();","IsDeferred":false},{"Name":"HTMLCanvasElement bitmaprenderer transferFromImageBitmap ImageBitmap","Code":"(async function draw() {\r\n const {ctx3, offscreen} = await getTestObjects();\r\n ctx3.transferFromImageBitmap(offscreen.transferToImageBitmap());\r\n})();","IsDeferred":false},{"Name":"OffscreenCanvas bitmaprenderer transferFromImageBitmap ImageBitmap","Code":"(async function draw() {\r\n const {ctx4, offscreen} = await getTestObjects();\r\n ctx4.transferFromImageBitmap(offscreen.transferToImageBitmap());\r\n})();","IsDeferred":false}]}