It seems like you're saving the drawn rects in memory, You should instead not save them in memory and keep the whole drawable surface as a surface and just blit the sprite of the brush for better performance. Cool app tho