1 decade ago by SlotGamer
I'm hoping someone can explain if I am understanding this correctly...
Drawing to a user-created canvas draws it with the CPU in user memory. But in the case of drawing to the canvas in the DOM (which is the visible one we see), that is slower because it needs to copy image data from user memory to GPU memory when drawing it?
I'm contemplating drawing all my sprites/particles/background to on off screen canvas each frame and then drawing that entire offscreen canvas to the onscreen DOM canvas. I'm wondering if anyone else has done similar research with speed tests in this area? Is the canvas attached to the DOM slower to draw to than the other offscreen canvases? And maybe there is a significant speed difference on some platforms especially mobile?
Drawing to a user-created canvas draws it with the CPU in user memory. But in the case of drawing to the canvas in the DOM (which is the visible one we see), that is slower because it needs to copy image data from user memory to GPU memory when drawing it?
I'm contemplating drawing all my sprites/particles/background to on off screen canvas each frame and then drawing that entire offscreen canvas to the onscreen DOM canvas. I'm wondering if anyone else has done similar research with speed tests in this area? Is the canvas attached to the DOM slower to draw to than the other offscreen canvases? And maybe there is a significant speed difference on some platforms especially mobile?