{"ScriptPreparationCode":"$sourceWidth = 3000;\r\n$sourceHeight = 3000;\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 = $sourceWidth;\r\n$destCanvas.height = $sourceHeight;\r\n$destContext = $destCanvas.getContext(\u00222d\u0022);\r\n$destContext.imageSmoothingEnabled = false;","TestCases":[{"Name":"Scaling from a large canvas area to a small canvas area","Code":"$destContext.drawImage($sourceCanvas, 0, 0, $sourceWidth, $sourceHeight, 0, 0, 100, 100);\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 large canvas area to a medium canvas area","Code":"$destContext.drawImage($sourceCanvas, 0, 0, $sourceWidth, $sourceHeight, 0, 0, 600, 600);\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 large canvas area to a large 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}]}