Avoid redundant canvas resizes and duplicate renders