Live data from Hacker News

Skia: an open source 2D graphics library

skia.org

111–119 of 119 posts

Re: Skia: an open source 2D graphics library

#111

Earlier quoted context omitted.

That's the first question that occurred to me so I web-searched. Seems it is faster and has a broader API. I sort of expected that Raph Levien(1) might have contributed or that Cairo would be part of the base of Skia. But apparently not. (1) works at Google and wrote Cairo

I did not write Cairo, I wrote libart, and that was a long time ago. I'm good friends with several of the Skia authors, but don't actively work on it myself.

Oh, thanks for the correction.

Re: Skia: an open source 2D graphics library

#112

I've used it to create a desktop port of http://diep.io/ . It's great (easy to use, reasonably documented), but it's a pretty big dependency (I don't remember exactly, but I think like 20 MB or so?). Since diep.io uses the canvas 2d API, porting was pretty straight forward. The performance on desktop is unsurprisingly many times faster than the browser.

What motivated your choice of Skia over WebGL?

You mean canvas 2d? If you're making a 2d game, it's good enough and looks really nice. Performance is good enough in most cases. Because of some OpenGL gotchas in some drivers (macOS mostly), some operations are a lot slower in those OSes (I have a demo that runs at 3 fps on my macbook, and >144 fps on my windows). It's easier to use canvas 2d as you don't have to deal with any of that.

Re: Skia: an open source 2D graphics library

#113
post #81

Earlier quoted context omitted.

This can't be intentional, right?

Google does not seem interested in making the NDK anything more than implementing Java native methods, 3D graphics, audio or porting code from other platforms. Everything else should be done at Java level. I understand from the point of view of security, but what is safer, provide bindings to libraries already validated and installed on the device or forcing devs to package something else? Also even though they imple…

Java APIs ARE C APIs, for obvious reasons. There doesn't have to be any difference in security.

It is quite normal and traditional though, for C/C++ developers to work with what they call statically built binaries. They're a bit bigger (may God provide mercy, and huge amounts of free diskspace to those fools that enable debug), but the odds of them working flawless on a given device are much higher.

Re: Skia: an open source 2D graphics library

#114
post #81

Earlier quoted context omitted.

Google does not seem interested in making the NDK anything more than implementing Java native methods, 3D graphics, audio or porting code from other platforms. Everything else should be done at Java level. I understand from the point of view of security, but what is safer, provide bindings to libraries already validated and installed on the device or forcing devs to package something else? Also even though they imple…

Java APIs ARE C APIs, for obvious reasons. There doesn't have to be any difference in security. It is quite normal and traditional though, for C/C++ developers to work with what they call statically built binaries. They're a bit bigger (may God provide mercy, and huge amounts of free diskspace to those fools that enable debug), but the odds of them working flawless on a given device are much higher.

> Java APIs ARE C APIs,

You lost me there. I wouldn't call JNI boilerplate a C API.

> It is quite normal and traditional though, for C/C++ developers to work with what they call statically built binaries.

Polyglot dev here, including C and C++.

The way a library is linked is orthogonal to be made available on the SDK.

Re: Skia: an open source 2D graphics library

#115
post #107

Somehow the text it renders looks worse than all the other common graphics libraries on Linux - which all use FreeType and Harfbuzz. I am not sure what QtWebEngine does differently, because it uses Blink and the text looks fine.

"looks worse" is a pretty nebulous statement. Can you go into detail? Do you think text in Chrome looks bad?

It seems like lack if subpixel rendering plus the spacing between letters is somehow screwed. Really hard to put a finger on it, it just looks wrong to me. I do think that text in Chrome looks bad on Linux. I could compare magnified screenshots now but I'm too lazy, sorry. Don't care much about Chrome anyway.

Re: Skia: an open source 2D graphics library

#116
post #42

Aseprite switched to Skia a year or so ago ( https://github.com/aseprite/aseprite ). Regret it. Google doesn't care to maintain CMake support for it, so there goes pulling it in via source and building as a library dependency. https://github.com/aseprite/aseprite/issues/1598#issuecommen... You may ask, "why don't you just write your own CMake module like everyone else?" I've tried. I think the build system changed a…

Skia team here- We had an experimental cmake build that we let go last year, but sounds like there is more interest in it than we thought. It should not be hard to restore it, so we've got it on our todo list now.

Re: Skia: an open source 2D graphics library

#117
post #36

This looks really useful! Does anyone know how this compares to something like Cairo?

Note that Skia is a C++ library and does not provide a stable C API.

Skia has a C API under development that is our approach to API stability, but it is not comprehensive and still being added to (sometimes by our clients to get access to the APIs they need).

Re: Skia: an open source 2D graphics library

#119
post #64

Earlier quoted context omitted.

It's true. Google has essentially made it as painful as possible to use Skia outside of the google ecosystem. The build system is what's mostly kept me from using it in personal projects.

Xamarins wrapper for C# made it a breeze to use from C# at least - just add the package. The same is likely true for all ecosystems with reasonable package management. It’s only ironic that C++ libs are hardest to use from...C++

I believe that... but the only reason why is they bent over backwards to come up with something that works today, and likely won't work in another 3 months, given the rate of turnover of build systems.
Post reply on HN