After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693931 - Screenshots – Red/blue inverted
Screenshots – Red/blue inverted
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.7.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-02-16 02:12 UTC by Mantas Mikulėnas (grawity)
Modified: 2013-02-16 03:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use the right conversion from cairo to GdkPixbuf (2.28 KB, patch)
2013-02-16 02:55 UTC, Giovanni Campagna
committed Details | Review

Description Mantas Mikulėnas (grawity) 2013-02-16 02:12:56 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
Comment 1 Giovanni Campagna 2013-02-16 02:55:57 UTC
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.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-02-16 03:00:14 UTC
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.
Comment 3 Giovanni Campagna 2013-02-16 03:08:58 UTC
(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
Comment 4 Giovanni Campagna 2013-02-16 03:09:58 UTC
Attachment 236333 [details] pushed as 9b9f33b - Use the right conversion from cairo to GdkPixbuf