GNOME Bugzilla – Bug 693931
Screenshots – Red/blue inverted
Last modified: 2013-02-16 03:10:01 UTC
Since the following commit, all screenshots are saved with colors inverted – blue is switched with red. As if the screenshot was saved in BGR instead of RGB. commit eb5a836822d03588852ac9da9ca49e627ad9f349 Author: Adel Gadllah <adel.gadllah@gmail.com> Date: Thu Feb 14 18:22:24 2013 +0100 screenshot: Write metadata to png file
Created attachment 236333 [details] [review] Use the right conversion from cairo to GdkPixbuf GdkPixbuf is stored in memory as individual bytes, in strict red-green-blue-alpha order, while cairo image surfaces are stored as 32bits units whose order depends on the endianess. It is probably possible to do something better, taking advantage of cogl and the GL using the actual component order, but for now it is easier to use the GDK utility to convert the cairo surface.
Review of attachment 236333 [details] [review]: > It is probably possible to do something better, taking advantage > of cogl and the GL using the actual component order, but for now > it is easier to use the GDK utility to convert the cairo surface. Not if we want to do complex compositing, like with the cursor image. OK.
(In reply to comment #2) > Review of attachment 236333 [details] [review]: > > > It is probably possible to do something better, taking advantage > > of cogl and the GL using the actual component order, but for now > > it is easier to use the GDK utility to convert the cairo surface. > > Not if we want to do complex compositing, like with the cursor image. Heh, the same complex compositing can be done with GdkPixbuf. Really, what you want here is a screensized FBO, Clear, BlitFramebuffer, ReadPixels into GdkPixbuf, and then gdk_pixbuf_composite() with the cursor image. (But cogl doesn't give us BlitFramebuffer because it's a GL 3 thing) All these "compositing" in software-rendered cairo and color format conversions are just gratuitous memcpy's
Attachment 236333 [details] pushed as 9b9f33b - Use the right conversion from cairo to GdkPixbuf