[cairo] Cairo + GdkPixbuf

Benjamin Otte otte at redhat.com
Sun Jun 27 02:07:25 PDT 2010

On Sat, 2010-06-26 at 16:35 -0700, Bill Spitzak wrote:
> I don't know about this, it would seem that would continue to allow 
> inexperienced developers to use the slower formats. Not supporting them 
> may force them to make their source images in the faster format.
Judging by what _experienced_ people do, that's exactly what they do
today: http://git.gnome.org/browse/gtk+/tree/gdk/gdkcairo.c#n163
Unexperienced people will just write code themselves that looks kind of
okay, but is probably both slow and wrong. And I'd like to avoid the
code duplication everywhere. Plus, GPUs get the conversion done a lot
faster than we do, so letting them do it sounds like a good idea.

> It can be reduced to O(N) if more pixmap formats are allowed for source 
> images than destinations. This would likely cover what everybody really 
> wants.
Unfortunately that's not true. People want to convert to and from those 
formats - one way for loading the image and one way for writing the image.
That's an experience I had with the YUV work, too: It doesn't help to 
support formats in a read-only way at all. So going source-only for any 
format is a stupid idea IMO, especially because we'd require users to do 
all this fudgery to figure out if a writing to the specific format they 
are currently using is actually supported or not.

> As far as I can tell there are only *two* 4-byte image formats of any 
> interest: "ARGB32" and "RGBA".
As long as you ignore the less-common braindead formats like GdkPixbuf's
non-alpha format (24bit RGB) or people that actually knew that
premultiplied or ARGB is the way to go and used premultiplied RGBA or
unpremultiplied ARGB...
Of course, you can still say "not supported" and force them to do manual
labor for their backwards compatibility, but it's kinda trivial for
Cairo to implement it.


More information about the cairo mailing list