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 668217 - gdk_cairo_region_create_from_surface() broken on big endian
gdk_cairo_region_create_from_surface() broken on big endian
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
3.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-01-18 21:03 UTC by Marcus Comstedt
Modified: 2012-01-21 01:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example program (2.29 KB, text/x-c-code)
2012-01-18 21:03 UTC, Marcus Comstedt
Details
Screenshot of example program running on amd64 (61.88 KB, image/png)
2012-01-18 21:04 UTC, Marcus Comstedt
Details
Screenshot of example program running on ppc (60.54 KB, image/png)
2012-01-18 21:05 UTC, Marcus Comstedt
Details

Description Marcus Comstedt 2012-01-18 21:03:27 UTC
Created attachment 205585 [details]
Example program

When using gdk_cairo_region_create_from_surface() on a big endian system, the points in the resulting region get reversed in horizontal groups of 8. I've attached an example program that clearly shows the problem, and I'll attach screenshots from running it on amd64 (little endian, works) and ppc (big endian, does not work).

The output from the program when running on ppc is

R 0: 0
R 1: 0
R 2: 0
R 3: 0
R 4: 0
R 5: 0
R 6: 0
R 7: 8
R 8: 8
R 9: 8

but the expected output is

R 0: 1
R 1: 2
R 2: 3
R 3: 4
R 4: 5
R 5: 6
R 6: 7
R 7: 8
R 8: 9
R 9: 10

Since the text output is wrong, my conclusion is that the bug is in gdk_cairo_region_create_from_surface(), and not in gtk_widget_shape_combine_region().
Comment 1 Marcus Comstedt 2012-01-18 21:04:50 UTC
Created attachment 205586 [details]
Screenshot of example program running on amd64
Comment 2 Marcus Comstedt 2012-01-18 21:05:30 UTC
Created attachment 205587 [details]
Screenshot of example program running on ppc
Comment 3 Matthias Clasen 2012-01-19 18:50:10 UTC
Which version is this ? This is supposedly fixed by

http://git.gnome.org/browse/gtk+/commit/?id=ab34c7989620db3890efdfb6849c64d5c70c1b76
Comment 4 Marcus Comstedt 2012-01-19 21:31:02 UTC
It is from the Ubuntu package libgtk-3-0 version 3.2.0-0ubuntu4 (in the current release of Oneiric Ozelot).  The README in the source tree says "This is GTK+ version 3.2.0.".

Could you please confirm that the indicated fix was made after that release?  It does indeed look highly relevant.

Thanks

 // Marcus
Comment 5 Matthias Clasen 2012-01-20 03:52:59 UTC
I don't know what patches ubuntu includes in their gtk build, but 3.2.0 was released in September, and the fix I pointed you at was made in November
Comment 6 Marcus Comstedt 2012-01-20 22:56:02 UTC
Ok, further investigation shows:

* None of the Ubuntu patches touch gdkcairo

* The code in the source archive looks like the "before" side of the fix

* Adding the patch of the fix to debian/patches/series results in a working libgdk

So I think it's safe to say that it is the same problem and the same fix.

Sorry for the noise.


  // Marcus
Comment 7 Matthias Clasen 2012-01-21 01:09:58 UTC
Cool, thanks