rendering is separated in two stages: painting and scaling