Using Skia on other platforms
I've been remiss in posting frequently. There's a lot going on but not a lot in tidbit form.
Here's a nice post on why we use one graphics engine on Windows and Linux and another on the Mac.
On Linux the natural thing would have been to use Cairo. We in fact do use Cairo in various bits of the UI, because it's a simple way to get pixels onto an X surface. We already depend on Cairo because GTK does. (Disclaimer: I'm a big fan of Cairo: I contributed the initial Ruby bindings and mentored the Summer of Code student who did the Haskell bindings.)
However, the question here is what to use in the WebKit port — the part that actually draws the pages. A brief Cairo vs Skia rundown for that context:
- Initially (on Windows) they chose Skia over Cairo because of performance. I understand Cairo has done a lot of work on performance in the years since that decision was made. It would be interesting to compare performance with a recent Cairo. (I recall seeing a blog where they did this, but it was written in Japanese so it was difficult to understand the conclusion.)
- Now (on Linux) Cairo would likely have subtle differences in
rendering from Skia. I'm worried about e.g. complex polygons in a
<canvas>
— on Linux we basically rely on sites only ever testing against Windows Chrome so it'd be nice to match it bug for bug. - (Note that the hardware acceleration backends of Cairo don't apply here since we render in a sandboxed subprocess that doesn't have access to anything except memory.)
- The final thing Cairo brings over Skia is PDF/printing support. We will need printing eventually, so we'll likely need a Cairo port anyway? (I know almost nothing about printing and never do it on Linux.)
Thankfully WebKit already has a Cairo backend implementation that we'd surely be able to reuse (unless for whatever reason it's easier to do a Skia-on-Cairo port). I'm still scared of the above-mentioned subtle differences.