Thanks for working on the SkiaSharp c# bindings to Skia.
Unfortunately my project and plans with it had to be put on hold for now. Here was my experience which might be helpful or perhaps if someone reading would be so kind to point out something which I may have glossed over.
To the point:
- SkiaSharp views were particularly helpful in getting the understanding needed to pull SkiaSharp off the curb.
- SkiaSharp documentation and community just isn't there yet. I considered giving back with trying to help with a 'Getting Started' guide and Skia 101 post but alas I had to abandon ship. Since to me such documentation is secondary to 'native' Skia Documentation which is the root major problem.
- Skia.... Everyone talks about how great Skia is and how its the prime option out there for cross platform rendering. Which is great but the problem here is that the Skia website, documentation, and resources is a landmind of badly put together seemingly internal information. You fish for hours for little crumbs of information hoping you can connect the dots at some point -> but never can. The website is seemingly built for Skia internal developers which already had Skia 101, 102, and 103 courses and fully up to speed on how to work with Skia. (Where can I sign up for those?!?!?!) Its basically a dead project if you would look at its resources, documentation, and community perspective. Outside of Google backing of course. There is simply no high level information on this topic available anywhere.
- You might then have the idea that since google utilizes it and is in use by chromium that you could use Chromium sources to try to learn how Skia is used... Bad mistake, don't even try. I lost weeks of my life trying to understand that overly complex source code from hell. I still don't fully understand how Chrome utilizes Skia to this day.
- Video card hardware vs CPU software rendering is a very complex topic. WPF is a case in point since they simply got video card rendering wrong. The way primitives were tessellated and rendered was simply inefficient and major bottleneck. The fact is that a lot of rendering is lines and text which don't specifically 'tessellate' well for rendering on a video card it is easy to get wrong and end up with worse performance than just CPU driven rendering. Unfortunately there is no information on how Skia achieves any hardware rendering magic and a deep dive in sources will leave you wishing you had just drank a 6 pack instead. There is simply no high level information on this topic available anywhere which would be neccisary to make the correct decisions on implementation of a UI Framework.
- SVG rendering, this was the item which mostly killed my project, since I was willing to wade through the horrors of the above as I knowingly was on the bleeding edge of development and hoping to provide a interesting simple crossplatform UI framework to the world... alas SVG rendering was the death knell. Since any UI today is built with SVG assets. E.g. you can easily get all the google material UI assets in SVG form. This is excellent, unfortunately you can't use any of that at this time with SkiaSharp. There are 3 possible approaches I tried, SkiaSharp 1.55 has a SVG implementation which basically doesn't work since its only implemented for simple shapes. There then is a reference from twitter from Miguel de Icaza https://github.com/gentledepp/SVG/tree/skiasharp which you have to look carefully for the SkiaSharp tree which there again is no documentation, monolith library which I couldn't even get to pull off the curb with exceptions being generated at trying to initialize the SkiaGraphics device based on a Desktop Software rendering SKSurface. It's simply still in development, debugging through sources for hours yields many 'TODO's' and questions all left through the source, indicating that its just not ready. Maybe some day it will be but given that there are no documentation on how to use that library and no community at all to speak with the non-SkiaSharp branch I'm not hopefull. Lastly there is an FFImageLoader library which has 'PreviewSVG' support. However the SVG support appears via code analysis the same implementation of SkiaSharp 1.55 which is just simple SVG support. -> Wont work.
I've exhausted all options at my disposal and writing a SkiaSharp SVG renderer just isn't an option since I'd rather work in the salt mines for 6 months then try to do that. I understand why it doesn't exist since SVG is just a beast and not so simple task. Its mostly frustrating because you know that google somewhere has to be rendering SVG in Skia for Chrome. It is possible and done right, but the code is so complex and seemingly deeply rooted in their Blink renderer that its just not usable.
That was my experience. Was quite a ride.