logoalt Hacker News

embedding-shapetoday at 9:00 AM0 repliesview on HN

> Do you have a writeup somewhere?

I don't (yet), but do subscribe to the RSS feed on my website, I'll publish a writeup there once I've fleshed out exactly how it has to work for all the applications currently using it.

> Specifically how you solved cross platform rendering equivalence? Do you use an intermediate representation or just pure vis-a-vis splatting via native APIs?

In short, my current approach is something like a small renderer-neutral display-list IR, then each frame produces ordered DrawOps in logical coordinates, which then a shared renderer applies transforms, clipping, opacity, paths and whatever, which finally dispatches to platform canvas implementations backed by native APIs.

It's about ~50K LOC in total right now, to support Linux (Wayland + X11), macOS, Windows, iOS, Android, Sailfish OS and headless/offscreen rendering variants for each of those. This is like the 3rd iteration on this library, and for the first time I managed to get all the features in place without reaching +100K LOC, so feels like a pretty good approach so far.

The equivalence is semantic and conformance-tested essentially, not guaranteed pixel-perfect. For me, consistent design across the platforms is more important.