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 673137 - Grab the current window -> Screenshot is mirrored
Grab the current window -> Screenshot is mirrored
Status: RESOLVED FIXED
Product: cogl
Classification: Platform
Component: general
1.10.x
Other Linux
: Normal normal
: ---
Assigned To: Cogl maintainer(s)
Cogl maintainer(s)
: 673227 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-30 05:47 UTC by sangu
Modified: 2013-07-05 14:47 UTC
See Also:
GNOME target: 3.4
GNOME version: 3.3/3.4


Attachments
Grab the current window (110.43 KB, image/png)
2012-03-30 05:47 UTC, sangu
  Details
texture: Fix error handling in get_texture_bits_via_offscreen (2.46 KB, patch)
2012-03-31 12:32 UTC, drago01
none Details | Review

Description sangu 2012-03-30 05:47:29 UTC
Created attachment 210920 [details]
Grab the current window

Grab the current window -> Taken screenshot reverses.

1. alt + prtscr or $ gnome-screenshot -i 

gnome-screenshot-3.4.0-1.fc17.x86_64
Comment 1 Matthias Clasen 2012-03-30 22:47:24 UTC
Bizarre; however, the code that writes out the screenshot lives in gnome-shell, so lets move this bug there.
Comment 2 Jasper St. Pierre (not reading bugmail) 2012-03-30 23:06:00 UTC
What version of gnome-shell are you using?
Comment 3 sangu 2012-03-31 01:28:35 UTC
(In reply to comment #2)
> What version of gnome-shell are you using?
$ rpm -q gnome-shell
gnome-shell-3.4.0-1.fc17.x86_64
Comment 4 drago01 2012-03-31 12:07:09 UTC
*** Bug 673227 has been marked as a duplicate of this bug. ***
Comment 5 drago01 2012-03-31 12:11:23 UTC
Cogl-WARNING **: ./cogl-framebuffer.c:1334: GL error (1282): Invalid operation
Cogl-WARNING **: ./cogl-framebuffer.c:1334: GL error (1282): Invalid operation

Seems like bug 669368 is back ...
Comment 6 drago01 2012-03-31 12:32:12 UTC
Created attachment 211029 [details] [review]
texture: Fix error handling in get_texture_bits_via_offscreen

get_texture_bits_via_offscreen does not check the return value of
cogl_framebuffer_read_pixels_into_bitmap which results into never
using the fallback path texture_get_cb.

cogl_framebuffer_read_pixels_into_bitmap does not check whether the framebuffer
is properly allocated though; so fix that as well.
Comment 7 Neil Roberts 2012-04-02 22:59:43 UTC
It looks like I accidentally took out the call to cogl_framebuffer_allocate from get_texture_bits_via_offscreen in 10a38bb14fac3. Sorry about that. I guess we might want to add it back in to bail out sooner. The patch looks good to land anyway though so I've pushed it to master and the cogl-1.10 branch. Thanks for fixing this again!
Comment 8 Margarita Manterola 2013-07-05 12:14:14 UTC
Hi,

I'm trying to port this patch to Ubuntu's precise that still ships a cogl without it.  However, after applying the patch and recompiling, I get a black image instead of the correctly reversed image.  Does this patch depend on some other previous patch?

-- 
Regards,
Marga
Comment 9 drago01 2013-07-05 12:20:05 UTC
(In reply to comment #8)
> Hi,
> 
> I'm trying to port this patch to Ubuntu's precise that still ships a cogl
> without it.  However, after applying the patch and recompiling, I get a black
> image instead of the correctly reversed image.  Does this patch depend on some
> other previous patch?

Which GPU / driver are you using?
Comment 10 Margarita Manterola 2013-07-05 13:38:49 UTC
Hi,

It's an nvidia card with the proprietary driver.  I also tested the quantal version and I got a black screen.  I found a number of bugs reporting that but for virtual machines, so apparently this particular fix is bad for some cards?

-- 
Regards,
Marga
Comment 11 drago01 2013-07-05 13:44:17 UTC
(In reply to comment #10)
> Hi,
> 
> It's an nvidia card with the proprietary driver.  I also tested the quantal
> version and I got a black screen.  I found a number of bugs reporting that but
> for virtual machines, so apparently this particular fix is bad for some cards?

https://bugzilla.gnome.org/show_bug.cgi?id=696094#c7
Comment 12 Margarita Manterola 2013-07-05 13:46:11 UTC
But how did I trigger it just by adding the call to framebuffer allocate and the return value checking?
Comment 13 Margarita Manterola 2013-07-05 14:47:30 UTC
I've tested the same versions on a machine with intel graphics card and the screenshot was not flipped. So, yes, it's an nvidia issue.  But the fix reported here makes it worse, not better.