Live data from Hacker News

WebKit switching to Skia for 2d graphics rendering

blogs.igalia.com

31–40 of 181 posts

Re: WebKit switching to Skia for 2d graphics rendering

#31
post #26
post #10

Earlier quoted context omitted.

I mean I really don't know what library they could've tried other than Skia that's suitable to build a GPU renderer for Canvas's API, and they explain why they were hesitant to try Skia. Do you have any suggestions?

Mozilla's WebRender. It's actually a better option by their own criteria because it's developed as a standalone reusable library.

Oh I read the article with the assumption that this was 2D canvas rendering, but upon re-reading it I see that it's probably about normal web content. WebRender would've been a terrible fit for Canvas, but it would certainly make sense if this is about rendering normal web content.

Re: WebKit switching to Skia for 2d graphics rendering

#32
Could someone who knows Skia internals describe, if possible, the tradeoffs that Skia has made between performance, rendering quality and API DX?

Presumably this is partly why it has become so popular, but as someone who's been writing mostly 2D GL/WebGPU apps for a decade I've only briefly considered a Skia as an alternative, but this is mostly out of ignorance.

Re: WebKit switching to Skia for 2d graphics rendering

#34
post #19
post #13

So will they maintain a stable C API to skia? It is long-time known pain point that the skia official doesn't provide a usable C API.

Why would they? The API they (WebKit) are providing is the Canvas API, the fact that they're using Skia behind the scenes is an implementation detail... I don't see why they would go through the trouble of maintaining a stable C API for internal use in a C++ project?

Maybe so they could use newer versions of skia

Re: WebKit switching to Skia for 2d graphics rendering

#36
post #29

Didn't Flutter ditch Skia recently due to performance reasons?

Yes, from 2023 Jul 21 blog entry, https://medium.com/@wartelski/impeller-rendering-engine-is-i... :

"Impeller is a new Flutter rendering engine that the Flutter team claims solves the early-onset jank problem. It is designed as a replacement for Skia, with the goal of enabling better animations and addressing the jank issue, while also potentially providing support for 3D, which was not previously possible with Skia, as it exclusively supports 2D. Unlike Skia, Impeller compiles shaders during the build process instead of at runtime.

In Flutter 3.10, Impeller replaces Skia engine and becomes the primary rendering engine on iOS."

Re: WebKit switching to Skia for 2d graphics rendering

#37
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 a nice and small vector graphics library with GPU acceleration. So far Skia is the only real option, despite its downsides.

Re: WebKit switching to Skia for 2d graphics rendering

#39

I was curious how Igalia was funded and this was a surprisingly good interview on how they’re structured, how they work with the major browser companies, etc… Apparently many Apple, Google, Firefox engineers left to work for them. https://thenewstack.io/igalia-the-open-source-powerhouse-you...

It's in my city. Their offices are just a small flat in in a pretty bland neighborhood. I guess most of them work remote.

Re: WebKit switching to Skia for 2d graphics rendering

#40
post #32

Could someone who knows Skia internals describe, if possible, the tradeoffs that Skia has made between performance, rendering quality and API DX? Presumably this is partly why it has become so popular, but as someone who's been writing mostly 2D GL/WebGPU apps for a decade I've only briefly considered a Skia as an alternative, but this is mostly out of ignorance.

I've only briefly looked at skia internals.... And it's awfully complex!

But the external API is fairly simple. Basically you queue up various drawing commands and at the last minute tell it to execute the queued commands somewhere.

The queue is 'optimized' - for example if you tell it to draw some text and later crop the text out of the image, then no CPU/GPU time will be spent drawing text that won't be visible in the output. You can also draw text small and scale it up later without getting jagged edges as you would if you'd scaled up a raster image.

That ability lets you make tile based renderers, where you queue up all the commands for say a whole webpage, but then draw only a small square of the page like a map tile, and as the user scrolls/pans, you can draw more tiles as needed.

Post reply on HN