javascript - HTML5 canvas drawImage and scale performance -
i hear ctx.drawimage
destination width/height difference source width/height lead additional scale operation, isn't performance friendly operation. how this:
ctx.scale(0.5, 0.5); for(var in img) { ctx.drawimage(img[i], 0, 0); }
is difference (in performance point of view) with:
for(var in img) { ctx.drawimage(img[i], 0, 0, img[i].width, img[i].height, 0, 0, img[i].width * 0.5, img[i].height * 0.5); }
Comments
Post a Comment