Live data from Hacker News

Skia: an open source 2D graphics library

skia.org

101–110 of 119 posts

Re: Skia: an open source 2D graphics library

#101
post #96

Earlier quoted context omitted.

For a few things. These days most of Servo rendering is done on the GPU by WebRender. I think we only use Skia for canvas right now. Hopefully we'll drop it altogether once Pathfinder is completed.

Will it be possible for others to use webrender/Pathfinder similar to Skia or Cairo? Or is it pretty connected to servo?

Not sure about Pathfinder but WebRender for sure, it's already usable outside of servo. People are attempting GUI toolkits and other things.

Re: Skia: an open source 2D graphics library

#102
post #43

For anyone thinking of skipping looking at this one. I was not interested either until I read this part: > It serves as the graphics engine for Google Chrome and Chrome OS, Android, Mozilla Firefox and Firefox OS, and many other products.

Similar situation to the freetype/harfbuzz all-but-Microsoft/Apple (open source) monoculture. I'm interested to understand more about how some categories of software libraries don't foster multiple strong open source alternatives, while others do.

Text rendering and layout is hard. There are few open source Freetype competitors, but they are all lacking compared to it. Same for HarfBuzz, though the alternative I know of are either dormant or abandoned.

Re: Skia: an open source 2D graphics library

#103
post #91

Earlier quoted context omitted.

For xi-editor I considered Skia but ultimately decided to write my own OpenGL renderer. I think Skia would have worked, but the dependency was heavyweight and I'm able to tweak my renderer (for example, it gets linear-sRGB color blending right, while Skia uses an approximation). I have a draft blog post on this in the queue, but juggling just a few too many things at the moment.

Isn't skia able to call OpenGL too? Do you think your own thing will be lighter weight in the end? Which parts of skia do you think you won't need? (For sRGB, a patch for skia might be less work than a full new 2d library. Also depends on if your goal is to write fun code or to get a product out, of course.)

It all depends how you count. I consider the total cost of adopting a dependency the size of Skia to be quite a bit more than the lines of code written; I would have had to write _some_ code to do the interfacing. Then there's the question of source code download size and clean build times, which would have both gone up by more than an order of magnitude.

Re: Skia: an open source 2D graphics library

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

Been one feet in the gamedev space for pretty much my whole teenage and adult life, and it's the first time I've heard about it. It might be me just not paying attention, or maybe it's not that popular for end-users.

You could use it inside your custom game engine, but it wouldn't make much sense. Most 2D games work with bitmaps and sprite-sheets and Skia gives you full vector graphics. It's huge dependency, inflates your executable by few tens of megabytes and still doesn't give you window management and input handling and so on. SDL is still the king here - it provides just enough to build upon in reliable and cross-platform fashion.

Skia would be more useful for graphical applications focused on vector graphics (diagrams, plots, layout editors, CAD...). And for general purpose 2D graphic platforms like browsers have.

Re: Skia: an open source 2D graphics library

#106
post #49
post #39

Ugh... This build system is _horrible_. bash-dependent meta-builder for ninja-build working in git checkouts. Are both actual releases and traditional build systems that out of fashion?

You guys are killing me. After downloading twenty-some git repos(?) as dependencies (most of which my system already has), this (I’ll try to quit complaining about this better mousetrap now): kamloops$ gn Traceback (most recent call last): File "/home/bch/work/skia/src/vendor/depot_tools/gn.py", line 38, in sys.exit(main(sys.argv)) File "/home/bch/work/skia/src/vendor/depot_tools/gn.py", line 22, in main bin_path = g…

> After downloading twenty-some git repos(?) as dependencies (most of which my system already has)

Skia statically links in copies of these dependencies for testing purposes only. There is a mode ("is_official_build") that will search for your system libraies.

Re: Skia: an open source 2D graphics library

#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?

Re: Skia: an open source 2D graphics library

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

Nice but got "Failed to run, possibly violated security container"

The little server that runs fiddle.skia.org is probably overloaded.

Re: Skia: an open source 2D graphics library

#109
post #106
post #49

Earlier quoted context omitted.

You guys are killing me. After downloading twenty-some git repos(?) as dependencies (most of which my system already has), this (I’ll try to quit complaining about this better mousetrap now): kamloops$ gn Traceback (most recent call last): File "/home/bch/work/skia/src/vendor/depot_tools/gn.py", line 38, in sys.exit(main(sys.argv)) File "/home/bch/work/skia/src/vendor/depot_tools/gn.py", line 22, in main bin_path = g…

> After downloading twenty-some git repos(?) as dependencies (most of which my system already has) Skia statically links in copies of these dependencies for testing purposes only . There is a mode ("is_official_build") that will search for your system libraies.

Ah. I used that flag on first build attempt (which failed), then did a “tools/git-sync-deps” to pacify the build system (w/o any flags), wherein the repo cloning did commence.

Re: Skia: an open source 2D graphics library

#110
post #91

Earlier quoted context omitted.

For xi-editor I considered Skia but ultimately decided to write my own OpenGL renderer. I think Skia would have worked, but the dependency was heavyweight and I'm able to tweak my renderer (for example, it gets linear-sRGB color blending right, while Skia uses an approximation). I have a draft blog post on this in the queue, but juggling just a few too many things at the moment.

Isn't skia able to call OpenGL too? Do you think your own thing will be lighter weight in the end? Which parts of skia do you think you won't need? (For sRGB, a patch for skia might be less work than a full new 2d library. Also depends on if your goal is to write fun code or to get a product out, of course.)

When leading an Android platform team several years ago, we enable the OpenGL backend to Skia to see if it would accelerate general UI rendering.

The conclusion was after a whole bunch of bug fixes (OpenGL ES 2.0 IIRC), it ran but (a) ate up a lot of GPU memory (b) was slower than the 2D rendering for 80% of the drawing operations (c) some rendering ops (such as the font wide) could not be easily accelerated, meaning you would need to flush the GPU partially rendered frame periodically, then bring into the CPU cache, draw over and then flush again before writing more GPU operations.

Fun experiment - poor outcome!

Post reply on HN