{"ScriptPreparationCode":"$sourceWidth = 100;\r\n$sourceHeight = 100;\r\n$sourceCanvas = document.createElement(\u0022canvas\u0022);\r\n$sourceCanvas.width = $sourceWidth;\r\n$sourceCanvas.height = $sourceHeight;\r\n$sourceContext = $sourceCanvas.getContext(\u00222d\u0022);\r\n$sourceContext.fillStyle = \u0022rgba(0,100,200,1)\u0022;\r\n$sourceContext.fillRect(0, 0, $sourceWidth, $sourceHeight);\r\n\r\n$destCanvas = document.createElement(\u0022canvas\u0022);\r\n$destCanvas.width = 3000;\r\n$destCanvas.height = 3000;\r\n$destContext = $destCanvas.getContext(\u00222d\u0022);","TestCases":[{"Name":"Scaling from a small canvas area to a small canvas area (no scaling)","Code":"$destContext.drawImage($sourceCanvas, 0, 0, $sourceWidth, $sourceHeight, 0, 0, $sourceWidth, $sourceHeight);\r\n// Force the drawImage call to be evaluated within this benchmark code:\r\n$destContext.getImageData(0, 0, 1, 1);","IsDeferred":false},{"Name":"Scaling from a small canvas area to a smaller canvas area","Code":"$destContext.drawImage($sourceCanvas, 0, 0, $sourceWidth, $sourceHeight, 0, 0, 50, 50);\r\n// Force the drawImage call to be evaluated within this benchmark code:\r\n$destContext.getImageData(0, 0, 1, 1);","IsDeferred":false},{"Name":"Scaling from a small canvas area to a large canvas area","Code":"$destContext.drawImage($sourceCanvas, 0, 0, $sourceWidth, $sourceHeight, 0, 0, 3000, 3000);\r\n// Force the drawImage call to be evaluated within this benchmark code:\r\n$destContext.getImageData(0, 0, 1, 1);","IsDeferred":false}]}