Live data from Hacker News

WebKit switching to Skia for 2d graphics rendering

blogs.igalia.com

151–160 of 181 posts

Re: WebKit switching to Skia for 2d graphics rendering

#152

Earlier quoted context omitted.

Out of interest what's difficult about it to build? In my experience CMake isn't exactly a great developer experience, and many projects of this size take similar times to build. Is the problem specific to Skia or Google open source projects, or is it more based on the (necessary) size of the project?

The difficult parts change all the time and usually boil down to some sort of undocumented or poorly-documented dependency, especially if you're trying to enable the GPU backends. Every time someone I know tries to get it building it takes them a week to figure out how to do it.

Took me less than an hour to figure out how to build it just reading the instructions they have on their website for building.

Skia really isn't that hard to use IMO even for GPU accelerated stuff.

Re: WebKit switching to Skia for 2d graphics rendering

#153

Earlier quoted context omitted.

> it's a pain to build Yes. So in Sciter I've replaced its build system with relatively simple premake5 script. That replacement took couple of days but was worth it. Premake5 generates human-readable IDE solutions and make files. So you need just a compiler to build the whole thing. > building it from source takes 20-30 minutes on a modern laptop. It is not that bad actually. Just tried full rebuild of x64/Windows v…

About premake5 in general. premake5 is a monolithic/portable executable that contains Lua + specific runtime. Thus it does not rely on installed Python as in GN case as other tools. Having standard and well known and documented Lua on board benefits the maker a lot. In my opinion any modern build system must include generic and known PL. And that above is the problem of modern CMake. It started as simple static decla…

> it does not rely on installed Python as in GN case as other tools.

I'm curious if you can expand on how you're using python, and what pain points you have there? I think python 3.9 was one for us but not too bad.

Re: WebKit switching to Skia for 2d graphics rendering

#154

Earlier quoted context omitted.

Out of interest what's difficult about it to build? In my experience CMake isn't exactly a great developer experience, and many projects of this size take similar times to build. Is the problem specific to Skia or Google open source projects, or is it more based on the (necessary) size of the project?

> In my experience CMake isn't exactly a great developer experience o_O unlike GN? Have you used it much? https://gn.googlesource.com/gn/

Yes GN IMO is a much better experience than CMake. Its fully self-contained in a single binary that you can easily just distribute with your code. I have a small python script I use with it to regen files, and then to run Ninja to do the actual builds.

I've been using it for years and have no complaints.

Re: WebKit switching to Skia for 2d graphics rendering

#155

Earlier quoted context omitted.

There's also the GTK Scene Graph Kit[0], which just added GPU-accelerated path drawing and is shaping up to be a decent Cairo replacement. 0: https://docs.gtk.org/gsk4/

Completely ignorant question: what's the issue with Cairo? I know it has had a hard time getting maintained but is there any article or blog talking about how it works or how it doesn't work? I've never used it directly but I'm super curious to know more !

The op talks a bit about the limitations of Cairo.

Re: WebKit switching to Skia for 2d graphics rendering

#156
post #145
post #134

Earlier quoted context omitted.

> Cairo is in a maintenance-only mode. That's too bad. Is their a successor planned or is Skia the recommended alternative?

I think that when it comes to 2D rendering libraries there is in general not too many options if you want to target CPU or both CPU+GPU. Targeting GPU-only is bad for users that run on a hardware where GPU doesn't perform well or is not available at all due to driver issues or just not present (like servers). If you consider libraries that offer CPU rendering there are basically: - AGG (CPU only) - Blend2D (CPU only,…

If I am not mistaken, NanoVG actually can render as by CPU (need external path rasterizer) as by GPU (OpenGL and other options).

NanoVG provided Canvas.Context kind of API in plain C.

Re: WebKit switching to Skia for 2d graphics rendering

#157
post #155

Earlier quoted context omitted.

Completely ignorant question: what's the issue with Cairo? I know it has had a hard time getting maintained but is there any article or blog talking about how it works or how it doesn't work? I've never used it directly but I'm super curious to know more !

The op talks a bit about the limitations of Cairo.

> There was an attempt at making Cairo support GPU rendering, which did not work particularly well due to the library being designed around stateful operation based upon the PostScript model—resulting in a convenient and familiar API, great output quality, but hard to retarget and with some particularly slow corner cases. Meanwhile, other web engines have moved more work to the GPU, including 2D rendering, where many operations are considerably faster.

Re: WebKit switching to Skia for 2d graphics rendering

#158

Couple things I've seen in this space looking around the past couple weeks... Flutter made a different engine called Impeller[0] which is replacing Skia. Which is a bit surprising as an ignorant outsider. I hope that works out. Rive ( https://rive.app ), is a new animation tool that targets multiple platforms including web and their CEO Guido Rosso gave a great interview on School of Motion[1] about how they are buil…

I've been following Rive for a while, it's an interesting approach. I think it was a response to the fact that Lottie was tied to AdobeXD (I think?). I'm not sure if Rive's renderer is open source though.

"I'm not sure if Rive's renderer is open source though."

I did not follow Rive yet (but will do now), but it seems the renderer is MIT licenced, here the wasm/js renderer:

https://github.com/rive-app/rive-wasm/blob/master/LICENSE

Open source renderer would be the requirement for me to invest into it (not gonna fall for flash again).

Re: WebKit switching to Skia for 2d graphics rendering

#159

Skia is a great library, but as all things Google it's a pain to build. They don't use CMake and building it from source takes 20-30 minutes on a modern laptop. Furthermore, it's constantly changing its APIs and much of it is undocumented and unclear on how to use optimally. Most of the decisions taken by development team aren't discussed in the open and this makes it hard to understand the codebase. I wish there was…

I recommend blend2d: https://blend2d.com/. Very well done, very fast. No GPU acceleration but it has a JIT and you can probably get further than you think without it.
Post reply on HN