HTML5 Canvas efficiency -
does html5 canvas waste memory , cpu render pixels off window?
suppose have following 3 images want render onto 100
100
canvas:
+---------+-------+--------+-------+-------+--------------------+ | image | width | height | x | y | remark | +---------+-------+--------+-------+-------+--------------------+ | 1.svg | 50 | 80 | 10 | 10 | fits in | +---------+-------+--------+-------+-------+--------------------+ | 2.svg | 200 | 180 | -30 | 10 | partially fits | +---------+-------+--------+-------+-------+--------------------+ | 3.svg | 300 | 400 | 130 | 200 | totally off canvas | +---------+-------+--------+-------+-------+--------------------+
if draw 3 images onto canvas, native code intelligent enough not waste resources drawing parts of 2.svg
, whole of 3.svg
, or our responsibility clip/skip these in tile engine?
Comments
Post a Comment