Live data from Hacker News

Skia: an open source 2D graphics library

skia.org

71–80 of 119 posts

Re: Skia: an open source 2D graphics library

#71
post #7

Earlier quoted context omitted.

Skia is probably the most popular 2D graphics library at the moment. I don't really know why this got on HN now. It's already extremely popular. I use it in a little WIP game engine. It's very pleasant, excellent little library. There's an online jsfiddle-esque demo here https://fiddle.skia.org/ if you want to try it out.

I have a little 2d game that I'd like to port over to Skia. What did you end up using to handle input and audio and other gamey things?

I used https://github.com/jkuhlmann/gainput for input. I never did get around to handling audio.

For the UI I used imgui. Skia actually comes with an imgui backend (it's used for the Viewer tool) that is easy enough to hack into whatever you need.

Re: Skia: an open source 2D graphics library

#72
Fun fact, it is used in Android, but not exposed to the NDK.

So C++ applications on Android that wish to use Skia, do have to use the Java API via JNI (android.graphics.Canvas) with the respective performance impact due to marshaling, or package their own Skia version, thus increasing their APK size and having to deal with a build system that only makes sense for Google employees.

Re: Skia: an open source 2D graphics library

#73
post #7

Earlier quoted context omitted.

Skia is probably the most popular 2D graphics library at the moment. I don't really know why this got on HN now. It's already extremely popular. I use it in a little WIP game engine. It's very pleasant, excellent little library. There's an online jsfiddle-esque demo here https://fiddle.skia.org/ if you want to try it out.

How many Android devices are out there right now? They've all been using Skia since day one.

It is not exposed to native code.

Re: Skia: an open source 2D graphics library

#74

There is also a .NET binding for Windows and Xamarin: https://www.nuget.org/packages/SkiaSharp/

Has anyone used this? Are there any examples?

The rather awesome, cross-platform, Microcharts (https://github.com/aloisdeniel/Microcharts) is built on top of SkiaSharp.

Re: Skia: an open source 2D graphics library

#75
How about font rendering? Would I use freetype/harfbuzz with this? They're such a bitch to build on Windows. Currently I'm using DirectWrite but having portability would be a nice bonus, as it seems that the API of this isn't worse than Direct2D.

Re: Skia: an open source 2D graphics library

#76
post #75

How about font rendering? Would I use freetype/harfbuzz with this? They're such a bitch to build on Windows. Currently I'm using DirectWrite but having portability would be a nice bonus, as it seems that the API of this isn't worse than Direct2D.

freetype and harfbuzz don't draw text. Freetype reads font files and gives you individual glyphs, and harfbuzz does "shaping". Pango does layout but also doesn't draw text.

Re: Skia: an open source 2D graphics library

#77

There is also a .NET binding for Windows and Xamarin: https://www.nuget.org/packages/SkiaSharp/

We do lots of markup/drawing/overlay apps using Xamarin and SkiaSharp (SKCanvas/SKCanvasView/SKBitmap).

Skia is a great library. Pretty fast across UWP, Android, iOS and nice to have a common cross platform one that works well across most platforms (UWP, Win, Mac, iOS, Android).

UWP combined with Windows Ink (InkCanvas) is fun stuff.

Re: Skia: an open source 2D graphics library

#79
post #7

C++ 11, nice. Does anyone use this? And if you do how does it compare to alternatives

Skia is probably the most popular 2D graphics library at the moment. I don't really know why this got on HN now. It's already extremely popular. I use it in a little WIP game engine. It's very pleasant, excellent little library. There's an online jsfiddle-esque demo here https://fiddle.skia.org/ if you want to try it out.

What's realtime perf like?

Re: Skia: an open source 2D graphics library

#80
post #72

Fun fact, it is used in Android, but not exposed to the NDK. So C++ applications on Android that wish to use Skia, do have to use the Java API via JNI (android.graphics.Canvas) with the respective performance impact due to marshaling, or package their own Skia version, thus increasing their APK size and having to deal with a build system that only makes sense for Google employees.

This can't be intentional, right?
Post reply on HN