Bug 4321 - Endianess problem when running gtk programs over remote X
Summary: Endianess problem when running gtk programs over remote X
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: xlib backend (show other bugs)
Version: 1.0.0
Hardware: Other Linux (All)
: high normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-31 08:32 UTC by Sjoerd Simons
Modified: 2005-08-30 22:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Proposed patch (4.95 KB, patch)
2005-08-31 10:40 UTC, Owen Taylor
Details | Splinter Review
Second attempt (5.90 KB, patch)
2005-08-31 13:14 UTC, Owen Taylor
Details | Splinter Review

Description Sjoerd Simons 2005-08-31 08:32:42 UTC
When running gtk apps over remote X from a powerpc machine to a x86, some things
get strange colors. From the looks of it, some things aren't byteswapped while
they should.

As one can see in http://people.spacelabs.nl/~sjoerd/colorselector.png, on the
left there is a colorselector running on a remote ppc machine on the rigt a
colorselector running locally.

I tried the libpixman patch in 
https://bugs.freedesktop.org/show_bug.cgi?id=4260#c8, but that didn't help..

Library Versions:
gtk 2.8.0
cairo 1.0.0
Comment 1 Owen Taylor 2005-08-31 08:59:48 UTC
Have a test setup now to reproduce this; it's pretty straightforward problem
of doing XPutImage()/XGetImage() without regard to the endianess of the 
destination display.
Comment 2 Owen Taylor 2005-08-31 10:40:29 UTC
Created attachment 3140 [details] [review]
Proposed patch

This patch fixes the problem for me with gtk-demo and and makes 'make check'
pass displaying remotely from a ppc64 system to x86.

(the text tests are failing, which may be the same problem as bug 4274,
but they fail uniformly for the xlib and image backends)
Comment 3 Owen Taylor 2005-08-31 13:14:03 UTC
Created attachment 3141 [details] [review]
Second attempt

Here's a new version that uses existing endian-detection code
and deals with bitmap swapping as well. (Issues pointed out
by keithp)
Comment 4 Keith Packard 2005-08-31 13:19:47 UTC
This verison of the patch looks good to me; it still lacks "real" format
conversion (from depth 16 to depth 15, for example), but at least when the
server supports a pixman depth, things should work a lot better now.
Comment 5 Owen Taylor 2005-08-31 15:10:22 UTC
2005-08-31  Owen Taylor  <otaylor@redhat.com>

        * src/cairo-xlib-surface.c (_get_image_surface)
        (_draw_image_surface): Handle displays which don't match
        the local endianness by byteswapping on GetImage/PutImage.
        (#4321, reported by Sjoerd Simons)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.