Live data from Hacker News

WebKit switching to Skia for 2d graphics rendering

blogs.igalia.com

81–90 of 181 posts

Re: WebKit switching to Skia for 2d graphics rendering

#81

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.

Using the official instructions, it took 4 minutes to scratch download skia and all its deps and build it with ninja. It only had 1235 build actions ... that's like zero.

If this seems like a big lift, people are going to hate building Chromium.

Re: WebKit switching to Skia for 2d graphics rendering

#82
post #73

Earlier quoted context omitted.

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/

It looks like they are several years into a migration to bazel and support both a bazel and gn based build. Bazel is usually faster. It's possible the gn based build builds everything in the repo including all tests, but the bazel one is more targeted, building less things

https://skia.org/docs/dev/contrib/bazel/

Re: WebKit switching to Skia for 2d graphics rendering

#83
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.

I think only Microsoft maintains a stable C API for their SkiaSharp. Skia only cares about google projects. I don't even know why they bother to opensource it.

Open source doesn't mean there are any obligations. It's surprising how we don't see more of this. I imagine Google wouldn't even bother with making the source available if there was an obligation attached.

Re: WebKit switching to Skia for 2d graphics rendering

#84

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.

Does Skia have a continuous build somewhere? Is there any way to piggyback off the config for that?

I found this:

https://github.com/google/skia-buildbot

Assuming that the Skia maintainers keep that working, it might be easier to build the buildbot and use that to build Skia, than to build Skia directly!

Re: WebKit switching to Skia for 2d graphics rendering

#85
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…

Could you please tell me what PSOs are? I am not sure I found the proper abbreviation.

Re: WebKit switching to Skia for 2d graphics rendering

#86

Awesome! Glad to see skia is finding uses in places other than fuschia

Note that skia is only ever used on fuchsia for flutter. It shares that dependency on skia for all platforms it targets (which haven't otherwise been migrated to impeller).

Re: WebKit switching to Skia for 2d graphics rendering

#88
I wish WebKit GTK was more performant in general (and also in the MDN compatibility list but its another topic). It is getting better but it really is a blocker on shipping quality application with Tauri on Linux. There is a reason most apps using native webviews only target macos and windows, WebKit GfK is mostly undocumented for frontend engineers and often very much outdated / not installed on end user machines.

Re: WebKit switching to Skia for 2d graphics rendering

#89
post #85

Earlier quoted context omitted.

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…

Could you please tell me what PSOs are? I am not sure I found the proper abbreviation.

PSO = Pipeline State Object

Re: WebKit switching to Skia for 2d graphics rendering

#90

Earlier quoted context omitted.

> 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.

What happened to Cairo the 2d graphics tool?

Can it be GPU accelerated? (Is that even a dumb question to ask?)
Post reply on HN