RenderSession: Malloc buffers and write shapes only once in the constructor