4 ms·
What happened to Cairo the 2d graphics tool?
by gigatexal 3y ago
What happened to Cairo the 2d graphics tool?
- jb1991 3y agoNothing happened to it. It’s just slow.
- yetihehe 3y agoIt's not that slow, I was amazed by performance when I first used it, but maybe other libs are even faster.
- mort96 3y agoIt's perfectly decent for a CPU renderer, CPU rendering is just slow.
- yetihehe 3y agoI had to make a map module for python desktop application , options were either embed full browser inside and use google maps, or do it myself. C module using cairo was MUCH faster and easier to achieve in 2013. So much faster I didn't have to implement some optimizations I planned because it was already running at about 50fps on average computers with ~1000 individually drawn markers on a map. Requiring any gpu for this was not possible anyway.
- gigatexal 3y agoCan it be GPU accelerated? (Is that even a dumb question to ask?)
- tetromino_ 3y agoCairo has only limited support for GPU acceleration and hasn't seen much development this decade. So users who care about performance have either switched away from Cairo entirely or are at least reducing its usage and are taking it out of the fast path.
- Asm2D 3y agoGPU support was removed from Cairo, because it was slower than CPU rendering and nobody wanted to maintain it.
- tetromino_ 3y agoCairo's OpenGL support was removed, but I thought Cairo's X11 backend still has GPU acceleration for a few operations through XRender (depending on your video driver).
- Asm2D 3y agoThat's true, Cairo still provides XRender backend. Not sure it's that usable though as I think nobody really focuses on improving XRender, so it's probably in the same state as Cairo itself.
- Asm2D 3y agoCairo is in a maintenance-only mode. Nobody develops this library anymore and it only has a maintainer or two. Since nobody really worked on Cairo in the past 15 years it's not optimized for modern hardware. You can see some existing benchmarks here: - https://blend2d.com/performance.html Both the benchmarking tool and Blend2D are open-source projects so anyone can verify the numbers presented are indeed correct, and anyone can review/improve the backend-specific code that is used by the benchmarking tool.
- hgs3 3y ago> Cairo is in a maintenance-only mode. That's too bad. Is their a successor planned or is Skia the recommended alternative?
- Asm2D 3y agoI think that when it comes to 2D rendering libraries there is in general not too many options if you want to target CPU or both CPU+GPU. Targeting GPU-only is bad for users that run on a hardware where GPU doesn't perform well or is not available at all due to driver issues or just not present (like servers). If you consider libraries that offer CPU rendering there are basically: - AGG (CPU only) - Blend2D (CPU only, GPU planned, but not now) - Cairo (CPU only) - Qt's QPainter (CPU only, GPU without anti-aliasing / deprecated) - Skia (CPU + GPU) - Tiny Skia (CPU only, not focused on performance) - GPU only libs (there is many in C++ and Rust) Nobody develops AGG and Cairo anymore and Qt's QPainter hasn't really improved in the past decade (Qt Company's focus is QtQuick, which doesn't use QPainter, so they don't really care about improving the performance of QPainter). So, only 2 libraries from this list have active development - Blend2D and Skia. As an author of Blend2D I hope that it will be a go-to replacement for both AGG and Cairo users. Architecturally, Blend2D should be fine after a 1.0 release as the plan is to offer a stable ABI with 1.0 - And since Blend2D only exports C-API it should be a great choice for users who want to use every cycle and who want their code to work instead of making changes every time the dependency is updated (hello Skia). At the moment Blend2D focuses on AGG users though, because AGG is much more widespread in commercial applications due to its licensing model and extensibility. However, AGG is really slow especially when rendering to large images (like 4K) so switching from AGG to Blend2D can offer a great performance benefits while avoiding other architectural changes of the application itself. BTW Blend2D is still under active development. It started as an experiment and historically it only offered great performance on X86 platforms, but that is changing with a new JIT backend, which provides both X86 and AArch64 support and is almost ready for merge. This is good news as it will enable great performance on Apple hardware and also other AArch64 devices, basically covering 99% of the market.
- pizza234 3y agoSome details in the article: > There was an attempt at making Cairo support GPU rendering, which did not work particularly well due to the library being designed around stateful operation based upon the PostScript model—resulting in a convenient and familiar API, great output quality, but hard to retarget and with some particularly slow corner cases. Meanwhile, other web engines have moved more work to the GPU, including 2D rendering, where many operations are considerably faster.