avoid memory allocations during draw