I have a scene where I'm drawing over 50 nearly identical non-rectangular shapes on the screen. The only difference between them is the position; the shader, texture, and sampler are all identical. To render these shapes, I need to call ·canvas.draw· 50 times, and each call takes around 80-100µs, leading to a total of about 5ms spent on drawing calls per frame.
Upon investigating, I found that half of the time is spent in skpaint_to_grpaint_impl. Given that everything except the drawing position is the same, is there a way to avoid making too many calls to skpaint_to_grpaint_impl? Maybe cache the result of skpaint_to_grpaint_impl?