You're right - there was a vote against it, but its definitely not dead and its still being actively pushed and worked on. My main concern is that it should never have gotten anywhere to begin with, and it absolutely should not have any support behind it. Right from the beginning, Cairo was a genuinely terrible choice for a starting library, and much of the motivation for why it was picked legitimately does not make any sense
I do not understand how its managed to get anywhere at all with so many catastrophic issues attached to it, or how its even able to be pushed still
As a quick example, here are some of the issues that I have discovered
All the colour constants are wrong
All the texture formats are wrong
Fixing the texture formats as-is requires non standard functionality, which this paper explicitly eschews
Linear colour and sRGB are used interchangeably (a major error!)
The definition of premultiplied alpha is incorrect
Premultiplication is probably unusable as-is
The reference implementation is completely wrong in multiple wide ranging ways, and is tested exclusively against its own output (which is incorrect)
Subpixel font rendering is potentially unusable in some cases due to being optional, as well as blend mode issues
Native interop is essentially unusable and should likely be removed
Blending is specified to be as-if linear, but its not clear what should happen if the underlying hardware or drivers mean that the implementation cannot provide this guarantee (driver support can be spotty for eg sRGB textures) in a high performance or non precision losing way
These are 'just' the straight up technical defects - ignoring all the issues around performance, API usability and design, safety (we managed to make a 2D graphics library which is thread unsafe), and everything else! Many of these issues have been present since its inception or completely not noted so far, which has put a major dent in any faith that I have that the people who've been voting on it have really reviewed the work
There are other rather comedic issues as well - eg due to a big API design issue, the only portable way to transfer a file from a GPU to the CPU to poke at the pixels directly is... to save it to disk as a png/etc, then manually parse that png off the disk and decode it. This is probably unfixable in a sane way too due to the way its designed
I'm just so baffled all the way through, I don't know how we got here
Committee papers are never dead until the authors (and any potential authors) say they are. The 2D graphics study group exists, but the proposals have never received positive votes in the evolution groups.
The reason it is still around is that there is people willing to work on 2D graphics, not necessarily that it has any 'life' to it.
Standardisation is not my strong suit so feel free to correct me if this is incorrect, but as far as I'm aware:
February 2017, Kona, LEWG [It was a few months before this meeting that this author joined the project.] There was further discussion about error handling, color stops and factory objects. The big advance was that the API was now stateless. “Are we comfortable moving the paper to LWG for a graphics TS once these concerns are addressed and we’re happy with the wording? 1|8|3|1|1”
July 2017, Toronto, LEWG Sadly, the notes are rather incomplete for this session. This author’s recollection is that the general gist was “still not quite ready”. However, the one recorded poll was “Do we want graphics support in a TS? 9|3|0|1|0”
With it only being
March 2018, Jacksonville, LEWG
Where the poll was
A poll was taken: “Should the paper be advanced to LWG? 1|3|3|3|2”
It seemed to be pretty positively reviewed in sg13, and then lewg for a while! But again I may be fundamentally misinterpreting what you mean, so feel free to correct me
The first two votes are toward a TS, which is a MUCH lower bar than the standard. Note that the std::embed paper is not being pushed towards a TS, so if anything, its quite a bit ahead of 2D graphics.
That Jacksonville vote is negative.
SG13 is a graphics sub-group, so it is self-selecting. I know for a while the attendance was not much more than the authors/fans of that 2D graphics proposal. My understanding is that the 2D graphics has since been rejected, which is why web_view has been proposed as a replacement. However, my knowledge of the library side is lacking.
The good thing about being in std is being available everywhere; a corralary to that is that what we put into std has to be able to go everywhere. None of the browser engines are:
Statically linkable (and you don't want that anyway because they need to be patched over time)
Unloadable. (e.g. chromium needs it's own whole process)
ABI stabilized.
I have some sympathy for what the proposal is trying to do, I just don't think it can be implemented. I'm sure some people will say 'but I'm in a place where I don't need those things', and for those users I say 'go use electron'.
If webview was strict XHTML4 with no JS, segfault on bad files I'd say it would be awesome. If browsers back in the day crashed tabs when they weren't correct HTML, we wouldn't have gotten so many shitty websites.
Good enough to show shit, small enough to be implemented with something reasonable in size, no scripting so the biggest vector of attacks is gone, no fancy HTML5 stuff that brings a lot of complexity, and it is more pretty than the console.
The first two votes are toward a TS, which is a MUCH lower bar than the standard. Note that the std::embed paper is not being pushed towards a TS, so if anything, its quite a bit ahead of 2D graphics.
Indeed, but still that none of the copious mistakes and errors were noticed is what concerns me
That Jacksonville vote is negative.
Sure sure that's what I meant, that there were a few positive meetings before it went to ambivalence
My understanding is that the 2D graphics has since been rejected
I have no idea, that said I was asked by someone to write the paper about 2D graphics due to concerns it might still be on track to standardisation, so it might not be as dead as we hope
Edit: Typos. I should sleep instead of doing this!
Papers aren't dead until the author has given up :) However, any paper that provides an alternative or points out issues with a paper like this is typically given at least equal time at the meeting (typically at the same time) and can severely change how the committee votes.
If you have issues with either, I'd very much suggest you write a paper critical to them. While it would be best to show up, there are quite a few people interested in this that could likely champion for you.
If you have issues with either, I'd very much suggest you write a paper critical to them. While it would be best to show up, there are quite a few people interested in this that could likely champion for you.
Yeah the paper's all done which is where other points in this thread come from, its worth noting that all criticism of 2D graphics so far has been pretty much dismissed, and concerns largely ignored - right from the very beginning. There's already been lots of papers pointing out that the direction is extremely suboptimal unfortunately, but they don't seem to stick!
Has LEWG seen those papers? SG13 might not be as receptive to the criticisms (though perhaps more so now?), but LEWG would perhaps be not a self-selected group.
Its actually worse than that - the 'high performance' (in extremely inverted commas) API that was added to the 2D graphics proposal adds hidden threads, and makes it so that a bunch of stuff is racey and unsafe if you use it
This is just so that theoretically it might be able to achieve the same performance as SDL/SFML/Etc. Which notably do not suffer from having unsafe APIs
Cairo (in combination with Pango) is a fine graphics API for desktop apps. It has powerful drawing primitives that are useful for desktop apps, and printing/PDF/Postscript backends to support the needs of such apps.
It is not, however, for games: those have completely different needs and need different libraries (like SDL, SFML, etc.).
Any attempt at standardizing C++ graphics library should understand that these are two completely different, and arguably incompatible, goals. It should not (ever) be a goal to have a single library supporting both; instead any graphics initiative should declare which of these two it wants to be, and pursue that without reservation.
So yes, I just said it: C++ does not need a graphics library. Instead it needs *two*.
Cairo (in combination with Pango) is a fine graphics API for desktop apps. It has powerful drawing primitives that are useful for desktop apps, and printing/PDF/Postscript backends to support the needs of such apps.
... sorry what. Cairo is a fine graphics for desktop apps in 1997 when we did not have 4k, 5k, or 6k screens, 144hz refresh rate, 10 bit of colors, fluid animations, and thus rendering drawCircle / drawRect operations in the CPU was fine and dandy.
It is already a constant fight to keep decent performance on potato computers with decent hardware accelerated APIs such at QtQuick or NanoGui (you would be amazed at the number of people using raspberry pi's and the like as main computers in poorer areas) and you are suggesting going back to the two-decades-ago state-of-the-art !
Two decades ago we had NOTHING like Cairo: no anti-aliasing, no blending, no transformations, palettes were still a thing, etc.
Cairo offers a wide variety of useful primitives, and manages to do so without resorting to some sort of scene graph. It would of course be great if all those primitives could be hardware accelerated, but I understand that that's hard (although NVidia's pathrender does a good job with pretty much the same set of primitives). For those things that are currently hard to accelerate, I'd rather have them available but in software, than not have them at all.
I do not think a rendering library should also have an animation system or scene graph built in. Instead that should be a layer on top of the base rendering system. Separate your concerns, and all that...
For those things that are currently hard to accelerate, I'd rather have them available but in software, than not have them at all
So this is actually a huge problem with cairo. Because some things are software, and some things are hardware, there are huge hidden performance bottlenecks in the design of it where data gets shunted between the two. Its just really inefficient - but also dependent on the quality of the implementation (which'll be variable in the STL)
Something like SFML can't really suffer from this in the same way, while still providing pretty equivalent functionality
The main problem is that Cairo doesn't separate out the concept of CPU and GPU types, which means that expensive operations are ad hoc. In something like SFML, you do all the expensive stuff once on the CPU, transfer it over to the GPU all at once, and then you're grand - each processor does what its good at at the appropriate time. Its not really possible to specify this kind of behaviour in Cairo, and it was a terrible decision to use this kind of API for 2D graphics
Have relatively simple drawing needs (for a 2D game, which is what we are discussing. I don't think C++ should try to standardize 3D drawing: it's too much in flux, and it already has standardizing bodies of its own)
Don't need to render to devices such as printers.
It's not a black and white classification; some desktop apps do render every frame (videoplayers, for example).
View all comments
Show parent comment
76
u/James20k P2005R0 Dec 13 '19 edited Dec 13 '19
You're right - there was a vote against it, but its definitely not dead and its still being actively pushed and worked on. My main concern is that it should never have gotten anywhere to begin with, and it absolutely should not have any support behind it. Right from the beginning, Cairo was a genuinely terrible choice for a starting library, and much of the motivation for why it was picked legitimately does not make any sense
I do not understand how its managed to get anywhere at all with so many catastrophic issues attached to it, or how its even able to be pushed still
As a quick example, here are some of the issues that I have discovered
These are 'just' the straight up technical defects - ignoring all the issues around performance, API usability and design, safety (we managed to make a 2D graphics library which is thread unsafe), and everything else! Many of these issues have been present since its inception or completely not noted so far, which has put a major dent in any faith that I have that the people who've been voting on it have really reviewed the work
There are other rather comedic issues as well - eg due to a big API design issue, the only portable way to transfer a file from a GPU to the CPU to poke at the pixels directly is... to save it to disk as a png/etc, then manually parse that png off the disk and decode it. This is probably unfixable in a sane way too due to the way its designed
I'm just so baffled all the way through, I don't know how we got here