{"ScriptPreparationCode":"var canvasOne = document.getElementById(\u0022canvasOne\u0022);\r\nvar ctx = canvasOne.getContext(\u00222d\u0022, {desynchronized: true, alpha: true, preserveDrawingBuffer: true});\r\n\r\nvar canvasTwo = document.getElementById(\u0022canvasTwo\u0022);\r\nvar ctxTwo = canvasTwo.getContext(\u00222d\u0022);\r\n\r\nvar canvasThree = document.getElementById(\u0022canvasThree\u0022);\r\nvar ctxThree = canvasThree.getContext(\u00222d\u0022);\r\n\r\nvar canvasFour = document.getElementById(\u0022canvasFour\u0022);\r\nvar ctxFour = canvasFour.getContext(\u00222d\u0022);\r\n","TestCases":[{"Name":"Clear only","Code":"ctx.fillStyle = \u0027rgba(255, 255, 255, 0.3)\u0027;\r\nctx.fillRect(0, 0, 400, 400);\r\n\r\nctx.clearRect(0,0,ctx.canvas.width,ctx.canvas.height);\r\n\r\nctx.beginPath();\r\nctx.fillStyle = \u0027rgba(231, 76, 60, 0.1)\u0027;\r\nctx.arc(200, 200, 100, 0, Math.PI * 2, true);\r\nctx.fill();","IsDeferred":false},{"Name":"Save transform Clear restore","Code":"ctx.fillStyle = \u0027rgba(255, 255, 255, 0.3)\u0027;\r\nctx.fillRect(0, 0, 400, 400);\r\n\r\nctx.save();\r\nctx.setTransform(1,0,0,1,0,0);\r\nctx.clearRect(0,0,ctx.canvas.width,ctx.canvas.height);\r\nctx.restore();\r\n\r\nctx.beginPath();\r\nctx.fillStyle = \u0027rgba(231, 76, 60, 0.1)\u0027;\r\nctx.arc(200, 200, 100, 0, Math.PI * 2, true);\r\nctx.fill();","IsDeferred":false},{"Name":"Canvas w with memo","Code":"ctx.fillStyle = \u0027rgba(255, 255, 255, 0.3)\u0027;\r\nctx.fillRect(0, 0, 400, 400);\r\n \r\nvar w = ctx.canvas.width;\r\nctx.canvas.width = 1;\r\nctx.canvas.width = w;\r\n\r\nctx.beginPath();\r\nctx.fillStyle = \u0027rgba(231, 76, 60, 0.1)\u0027;\r\nctx.arc(200, 200, 100, 0, Math.PI * 2, true);\r\nctx.fill();","IsDeferred":false},{"Name":"w=w","Code":"ctx.fillStyle = \u0027rgba(255, 255, 255, 0.3)\u0027;\r\nctx.fillRect(0, 0, 400, 400);\r\n\r\nctx.canvas.width = ctx.canvas.width;\r\n\r\nctx.beginPath();\r\nctx.fillStyle = \u0027rgba(231, 76, 60, 0.1)\u0027;\r\nctx.arc(200, 200, 100, 0, Math.PI * 2, true);\r\nctx.fill();","IsDeferred":false},{"Name":"w\u002B=0","Code":"ctx.fillStyle = \u0027rgba(255, 255, 255, 0.3)\u0027;\r\nctx.fillRect(0, 0, 400, 400);\r\n\r\nctx.canvas.width \u002B= 0;\r\n\r\nctx.beginPath();\r\nctx.fillStyle = \u0027rgba(231, 76, 60, 0.1)\u0027;\r\nctx.arc(200, 200, 100, 0, Math.PI * 2, true);\r\nctx.fill();","IsDeferred":false},{"Name":"fillRect","Code":"ctx.fillStyle = \u0027rgba(255, 255, 255, 0.3)\u0027;\r\nctx.fillRect(0, 0, 400, 400);\r\n\r\nctx.fillStyle = \u0027rgba(0, 0, 0, 1)\u0027;\r\nctx.fillRect(0,0,ctx.canvas.width, ctx.canvas.height);\r\n\r\n\r\nctx.beginPath();\r\nctx.fillStyle = \u0027rgba(231, 76, 60, 0.1)\u0027;\r\nctx.arc(200, 200, 100, 0, Math.PI * 2, true);\r\nctx.fill();","IsDeferred":false},{"Name":"createImageData","Code":"ctx.fillStyle = \u0027rgba(255, 255, 255, 0.3)\u0027;\r\nctx.fillRect(0, 0, 400, 400);\r\n\r\nvar i = ctx.createImageData(ctx.canvas.width, ctx.canvas.height);\r\nctx.putImageData(i, 0, 0); // clear context by putting empty image data\r\n\r\nctx.beginPath();\r\nctx.fillStyle = \u0027rgba(231, 76, 60, 0.1)\u0027;\r\nctx.arc(200, 200, 100, 0, Math.PI * 2, true);\r\nctx.fill();","IsDeferred":false}]}