git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@29357 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Wolfgang Lux 2010-01-22 08:16:50 +00:00
parent 89e0508bbb
commit 4ea7b58019
5 changed files with 32 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2010-01-22 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/x11/XWindowBuffer.m (+windowBufferForWindow:depthInfo:):
* Source/art/ARTGState.m (-GSSetDevice:):
* Source/cairo/XGCairoXImageSurface.m (-initWithDevice:):
Fix bug #28590 (with a little help from Fred Kiefer).
2010-01-21 15:45-EST Riccardo Mottola <rmottola@users.sf.net> 2010-01-21 15:45-EST Riccardo Mottola <rmottola@users.sf.net>
Committed by: Gregory John Casamento <greg.casamento@gmail.com> Committed by: Gregory John Casamento <greg.casamento@gmail.com>
@ -7,7 +14,7 @@
2010-01-14 Wolfgang Lux <wolfgang.lux@gmail.com> 2010-01-14 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/x11/XGServerEvent.m (-processEvent:): * Source/x11/XGServerEvent.m (-processEvent:):
* Source/x11/XGServerWindow.m (-_wm_state:, -_ewmh_state, -_checkStyle, * Source/x11/XGServerWindow.m (-_wm_state:, -_ewmh_state, -_checkStyle,
-_rootWindowForScreen:, -window::::, -nativeWindow:::::): Revise -_rootWindowForScreen:, -window::::, -nativeWindow:::::): Revise
detection of window miniaturization and deminiaturization based on detection of window miniaturization and deminiaturization based on

View file

@ -50,6 +50,11 @@ struct XWindowBuffer_depth_info_s
holds the alpha value. */ holds the alpha value. */
BOOL inline_alpha; BOOL inline_alpha;
int inline_alpha_ofs; int inline_alpha_ofs;
/* If the buffer stores the data with the client's native byte order,
this should be YES. Normally, an XImage uses the byte order of the
X server. */
BOOL byte_order_from_client;
}; };
/* /*

View file

@ -638,6 +638,7 @@ draw_info_t ART_DI;
di.bytes_per_pixel = DI.bytes_per_pixel; di.bytes_per_pixel = DI.bytes_per_pixel;
di.inline_alpha = DI.inline_alpha; di.inline_alpha = DI.inline_alpha;
di.inline_alpha_ofs = DI.inline_alpha_ofs; di.inline_alpha_ofs = DI.inline_alpha_ofs;
di.byte_order_from_client = NO;
ASSIGN(wi, [XWindowBuffer windowBufferForWindow: window depthInfo: &di]); ASSIGN(wi, [XWindowBuffer windowBufferForWindow: window depthInfo: &di]);
} }

View file

@ -53,6 +53,8 @@
di.bytes_per_pixel = 4; di.bytes_per_pixel = 4;
di.inline_alpha = YES; di.inline_alpha = YES;
di.inline_alpha_ofs = 0; di.inline_alpha_ofs = 0;
/* The cairo image surface uses the client's byte order (cf. bug #28590). */
di.byte_order_from_client = YES;
ASSIGN(wi, [XWindowBuffer windowBufferForWindow: GSWINDEVICE depthInfo: &di]); ASSIGN(wi, [XWindowBuffer windowBufferForWindow: GSWINDEVICE depthInfo: &di]);

View file

@ -389,6 +389,22 @@ no_xshm:
wi->window->xframe.size.height, wi->window->xframe.size.height,
8, 0); 8, 0);
/* Normally, the data of an XImage is saved with the X server's
byte order. However, some backends (notably cairo) use the
native byte order of the client for the backend image. Since
XCreateImage sets up the image with the X server's byte order,
we must correct the byte order for those backends. Otherwise,
GNUstep applications would display wrong colors on an X server
that is running on a machine with a different byte order than
the client (bug #28590). */
if (wi->DI.byte_order_from_client)
{
#if GS_WORDS_BIGENDIAN
wi->ximage->byte_order = MSBFirst;
#else
wi->ximage->byte_order = LSBFirst;
#endif
}
wi->ximage->data = malloc(wi->ximage->height * wi->ximage->bytes_per_line); wi->ximage->data = malloc(wi->ximage->height * wi->ximage->bytes_per_line);
if (!wi->ximage->data) if (!wi->ximage->data)
{ {