Live data from Hacker News

WebKit switching to Skia for 2d graphics rendering

blogs.igalia.com

171–180 of 181 posts

Re: WebKit switching to Skia for 2d graphics rendering

#171

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…

There are some Skia alternatives:

- NanoVG

- bgfx with vg-renderer

- Impeller

- Starling

Re: WebKit switching to Skia for 2d graphics rendering

#173
post #119

Earlier quoted context omitted.

What happened to Cairo the 2d graphics tool?

Cairo is in a maintenance-only mode. Nobody develops this library anymore and it only has a maintainer or two. Since nobody really worked on Cairo in the past 15 years it's not optimized for modern hardware. You can see some existing benchmarks here: - https://blend2d.com/performance.html Both the benchmarking tool and Blend2D are open-source projects so anyone can verify the numbers presented are indeed correct, and…

That’s crazy. I once lurked in the IRC of the project. I knew the creator. He was a family friend. I was a silly teen kid toying with Linux he was a dev who worked at redhat and lived in the same town as me.

I wonder what he’s up to these days?

Update/edit:

Ahh he moved on to Ampere: https://www.linkedin.com/in/carl-worth

Also I was a bad fan: the library had a co-founder too I thought it was a bespoke creation of Carl’s own making.

I remember building a bunch of stuff from source back in the day and a lot of Linux applications had Cairo as a dependency.

Re: WebKit switching to Skia for 2d graphics rendering

#175
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,…

Do not forget: https://www.amanithvg.com (I'm one of the authors, 20+ years of active development). Full OpenVG 1.1 API, CPU only, cross-platform and analytical coverage antialiasing (rendering quality) as main feature. The rasterizer is really fast. I swear ;) At Mazatech we are working to a new GPU backend just these days.

AmanithVG is the library on which our SVG renderer: https://www.amanithsvg.com is based. All closed source as now, but things may change in future.

I will do some benchmarks of the current (and next, when the new GPU backend will be ready) version of our libraries against other libraries. Do you know if there are any standard tests (besides the classic post script Tiger)? Maybe we can all agree on a common test set for all vector graphics libs bechmarks?

Re: WebKit switching to Skia for 2d graphics rendering

#176
post #145

Earlier quoted context omitted.

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,…

Do not forget: https://www.amanithvg.com (I'm one of the authors, 20+ years of active development). Full OpenVG 1.1 API, CPU only, cross-platform and analytical coverage antialiasing (rendering quality) as main feature. The rasterizer is really fast. I swear ;) At Mazatech we are working to a new GPU backend just these days. AmanithVG is the library on which our SVG renderer: https://www.amanithsvg.com is based. All…

That's right! I didn't consider closed source libraries when writing the list. There would be more options in that case like Direct2D and CoreGraphics. However, my opinion is that nobody should be using closed source libraries to render 2D graphics in 2024 :)

Regarding benchmarks - I think Tiger is not enough. Tiger is a great benchmark to exercise the rasterizer and stroker, but it doesn't provide enough metrics about anything else. Tt's very important how fast a 2D renderer renders small geometries, be it rectangles or paths. Because when you look at screen most stuff is actually small. That's the main reason why Blend2D benchmarking tool scales the size of geometries from 8x8 to 256x256 pixels to make sure small geometries are rendered fast and covered by benchmarks. When you explore the results you will notice how inefficient other libraries actually are when it comes to this.

Re: WebKit switching to Skia for 2d graphics rendering

#177
post #150
post #145

Earlier quoted context omitted.

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,…

I'm the author of another CPU-only 2D vector graphics library that might be of interest: - Canvas Ity ( https://github.com/a-e-k/canvas_ity ) It's a tiny single-header C++ library in the style of the STB libraries. My aim was to make it dirt simple to be able to drop into almost any project and get high-quality rendering while providing an API comfortable to those used to . I've been checking out Blend2D every now an…

Nice project, thanks for sharing!

BTW for comparison - Blend2D can render SVG tiger in 1.68ms on the same machine (I also have 7950X) so it can provide almost an order of magnitude better performance in this case, which is great I think. But I understand the purpose of your library, sometimes it's nice to have something small :)

Re: WebKit switching to Skia for 2d graphics rendering

#178
post #62

Earlier quoted context omitted.

There's often multiple compilation steps, first compiling some application specific representation down to HLSL/GLSL/MSL source code, then compiling that down to DXIL/SPIRV/Metal bytecode, and then handing that off to the driver for compilation to native code. The first two steps at least can be done ahead of time, the bytecode is stable. Metal and CUDA actually let you AOT compile native binaries since they have rel…

The bytecode compilation doesn't really matter, it's still gonna jank. Maybe not as badly, but it will. The only way to get rid of jank is to cache not the bytecode and not even the native code, but the PSOs. Realistically, that is only possible on the target machine, unless you have a ginormous farm of machines representing all the permutations of hardware and drivers. That's basically what Steam does with its mass…

I have not seen shipping prebuilt PSOs outside of game console platforms. Typically games that care do on device caching if any. Unfortunately, lots of projects just take shader hitches as given.

Re: WebKit switching to Skia for 2d graphics rendering

#179
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,…

There is also thorvg by Samsung (or the authors work in there and they are also using it, not 100% sure but it's production ready)

https://github.com/thorvg/thorvg#dependencies

AFAIK they have experimental GPU backend but I'm not sure how far they are with it.

Post reply on HN