In my app, I do tons of calls to the SKCanvas to draw hundreds of thousands of elements. Getting some lags and fps drop. After some profiling, I've found that a lot of performance is consumed by p/invoke.
Maybe if there will be a bulk draw method that will take data array with function type and arguments we will be able to achieve a huge performance benefit.
Example:
_canvas.BulkDraw(new DrawOp[]{
DrawOp.CreateDrawRect(args...),
DrawOp.CreateDrawText(args...),
...
});
What do you think? Am I right that this trick will improve performance or/and latency if draw call count is more than 1000?
The issue I see with this approach is memory consumption. We will need to create SKPaint for each DrawOP. I see a solution to this problem by the creation of SKPaintPropChangeOp, which will change the props of SKPaint.
Thanks a lot! That's what I need!
Most helpful comment
https://docs.microsoft.com/en-us/dotnet/api/SkiaSharp.SKPicture?view=skiasharp-1.68.1 is your friend