mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 11:51:27 +00:00
Fix bug #28590.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@29357 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
89e0508bbb
commit
4ea7b58019
5 changed files with 32 additions and 1 deletions
|
@ -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>
|
||||
Committed by: Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
|
@ -7,7 +14,7 @@
|
|||
|
||||
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,
|
||||
-_rootWindowForScreen:, -window::::, -nativeWindow:::::): Revise
|
||||
detection of window miniaturization and deminiaturization based on
|
||||
|
|
|
@ -50,6 +50,11 @@ struct XWindowBuffer_depth_info_s
|
|||
holds the alpha value. */
|
||||
BOOL inline_alpha;
|
||||
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;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -638,6 +638,7 @@ draw_info_t ART_DI;
|
|||
di.bytes_per_pixel = DI.bytes_per_pixel;
|
||||
di.inline_alpha = DI.inline_alpha;
|
||||
di.inline_alpha_ofs = DI.inline_alpha_ofs;
|
||||
di.byte_order_from_client = NO;
|
||||
|
||||
ASSIGN(wi, [XWindowBuffer windowBufferForWindow: window depthInfo: &di]);
|
||||
}
|
||||
|
|
|
@ -53,6 +53,8 @@
|
|||
di.bytes_per_pixel = 4;
|
||||
di.inline_alpha = YES;
|
||||
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]);
|
||||
|
||||
|
|
|
@ -389,6 +389,22 @@ no_xshm:
|
|||
wi->window->xframe.size.height,
|
||||
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);
|
||||
if (!wi->ximage->data)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue