Live data from Hacker News

WebKit switching to Skia for 2d graphics rendering

blogs.igalia.com

71–80 of 181 posts

Re: WebKit switching to Skia for 2d graphics rendering

#72

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 wish there was a nice and small vector graphics library with GPU acceleration. I'm personally skeptical about GPU acceleration being the answer to 2D rendering for various reasons. I'm looking forward to Blend2D https://blend2d.com/ > which is JIT based maturing and being the preferred solution.

According to their benchmark, multi-threaded rendering on a Ryzen 7950X will take about 1.7ms with 4 cores for drawing 1000x polygons with 40 vertices each on a 32x32 px area, which seems like a reasonable approximation for a text character on a high-DPI display. The default font size in JetBrains fits about 2500 characters onto my screen, so I'd expect a 4.25ms frame time, meaning I am capped at 235 FPS with 4 CPU cores running at full speed.

I believe the best way is probably to use Blend2D for rendering glyph bitmaps and then compositing them into the full text on GPU.

Sadly, CPU memory is still plenty slow compared to GPU memory and when you need to copy around 100 MB images (4K RGB float), then that quickly becomes the limiting factor.

Re: WebKit switching to Skia for 2d graphics rendering

#73

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 was skeptical of your claims about building it so I went ahead and downloaded skia and built it myself. It was simple and on my 4 year old desktop (8 cores) it took under a minute to compile skia after it had downloaded its dependencies. All I did was run 2 commands ./tools/git-sync-deps and bazel build //:skia_public. This was not painful at all.

This doesn't reflect my experiences at all. I've never built it with bazel, are you sure it's not using some prebuilt binary?

The official instructions are https://skia.org/docs/user/build/

Re: WebKit switching to Skia for 2d graphics rendering

#74

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…

Not an expert on graphics libs - but I did notice that the Google project Flutter is moving away from Skia to something new called Impeller.

https://medium.com/@gauravswarankar/flutter-will-use-an-impe...

Re: WebKit switching to Skia for 2d graphics rendering

#75
post #56

Earlier quoted context omitted.

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.

I used to do that when I started out with C/C++...15 years ago. Now my patience is running out after 10 minutes. Tooling has become so much better, but it seems not that much with some C/C++ projects. At least the build times are better, I remember big libs would could take hours to build.

Meson and ninja improved a lot in this area for C/C++.

Re: WebKit switching to Skia for 2d graphics rendering

#76

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…

Not an expert on graphics libs - but I did notice that the Google project Flutter is moving away from Skia to something new called Impeller. https://medium.com/@gauravswarankar/flutter-will-use-an-impe...

I believe Impeller is even worse with regards to all the issues mentioned in the parent comment. In particular since it is so tight to Flutter.

Re: WebKit switching to Skia for 2d graphics rendering

#78
post #63

Earlier quoted context omitted.

What happened to Cairo the 2d graphics tool?

Nothing happened to it. It’s just slow.

It's not that slow, I was amazed by performance when I first used it, but maybe other libs are even faster.

Re: WebKit switching to Skia for 2d graphics rendering

#79

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 was skeptical of your claims about building it so I went ahead and downloaded skia and built it myself. It was simple and on my 4 year old desktop (8 cores) it took under a minute to compile skia after it had downloaded its dependencies. All I did was run 2 commands ./tools/git-sync-deps and bazel build //:skia_public. This was not painful at all.

It depends on what features you have enabled, how slow your internet connection is and obviously hardware/software config. On my 10th gen Intel i5 laptop 8gb ram (on Windows), it takes 15 minutes to build if I don't do anything else, but if I start using Firefox and IDEs, the build times are easily in the 20-25 minutes ballpark.

Re: WebKit switching to Skia for 2d graphics rendering

#80

Earlier quoted context omitted.

And some rendering libraries in .NET

And the new UI framework for Jetbrains Fleet. And the new UI framework for Clojure Humble UI

All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us?
Post reply on HN