Question

When we draw on off screen canvas are we actually taking up any drawing power(as in is it really drawing some thing? or just data?) or space? and what happens to the other part of the sprite sheet when we only draw on part of it, does it take up any memory space? same applies to clipping.

Was it helpful?

Solution

It will and as Epistemex has said the amount of power it takes is dependant upon browser and client.

Treat the canvas as if it has a mask applied equal to it's size. You could drawImage a high resolution copy of the Mona Lisa and only see her face. However that hires image will have to have been loaded into memory somewhere.

Looking at it from the other angle (which I think you were driving at). Anything that doesn't get displayed on the canvas is technically "lost" so the canvas won't take up any extra memory once you've finished the current draw. However the process of drawing items that aren't display does cost overhead.

Hope that helped a little - expand your question if you'd like more info

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top