xfreerdp: fix 32bpp cursors

This commit is contained in:
Marc-André Moreau 2011-09-29 22:31:13 -04:00
parent 10331c5c44
commit df71487c56
4 changed files with 34 additions and 5 deletions

View File

@ -275,7 +275,7 @@ void xf_pointer_new(rdpUpdate* update, POINTER_NEW_UPDATE* pointer_new)
if (pointer_new->xorBpp > 24) if (pointer_new->xorBpp > 24)
{ {
printf("xorBpp:%d\n", pointer_new->xorBpp); freerdp_image_swap_color_order((uint8*) ci.pixels, ci.width, ci.height);
} }
cursor = XcursorImageLoadCursor(xfi->display, &ci); cursor = XcursorImageLoadCursor(xfi->display, &ci);

View File

@ -243,6 +243,7 @@ FREERDP_API uint8* freerdp_image_invert(uint8* srcData, uint8* dstData, int widt
FREERDP_API uint8* freerdp_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv); FREERDP_API uint8* freerdp_icon_convert(uint8* srcData, uint8* dstData, uint8* mask, int width, int height, int bpp, HCLRCONV clrconv);
FREERDP_API uint8* freerdp_mono_image_convert(uint8* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv); FREERDP_API uint8* freerdp_mono_image_convert(uint8* srcData, int width, int height, int srcBpp, int dstBpp, uint32 bgcolor, uint32 fgcolor, HCLRCONV clrconv);
FREERDP_API void freerdp_alpha_cursor_convert(uint8* alphaData, uint8* xorMask, uint8* andMask, int width, int height, int bpp, HCLRCONV clrconv); FREERDP_API void freerdp_alpha_cursor_convert(uint8* alphaData, uint8* xorMask, uint8* andMask, int width, int height, int bpp, HCLRCONV clrconv);
FREERDP_API void freerdp_image_swap_color_order(uint8* data, int width, int height);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -862,10 +862,10 @@ void freerdp_alpha_cursor_convert(uint8* alphaData, uint8* xorMask, uint8* andMa
{ {
/* use pattern (not solid black) for xor area */ /* use pattern (not solid black) for xor area */
xpixel = (i & 1) == (j & 1); xpixel = (i & 1) == (j & 1);
xpixel = xpixel ? 0xffffff : 0; xpixel = xpixel ? 0xFFFFFF : 0;
xpixel |= 0xff000000; xpixel |= 0xFF000000;
} }
else if (xpixel == 0xff000000) else if (xpixel == 0xFF000000)
{ {
xpixel = 0; xpixel = 0;
} }
@ -876,3 +876,21 @@ void freerdp_alpha_cursor_convert(uint8* alphaData, uint8* xorMask, uint8* andMa
} }
} }
void freerdp_image_swap_color_order(uint8* data, int width, int height)
{
int x, y;
uint32* pixel;
uint8 a, r, g, b;
pixel = (uint32*) data;
for (y = 0; y < height; y++)
{
for (x = 0; x < width; x++)
{
GetARGB32(a, r, g, b, *pixel);
*pixel = ABGR32(a, r, g, b);
pixel++;
}
}
}

View File

@ -506,7 +506,11 @@ void rdp_write_pointer_capability_set(STREAM* s, rdpSettings* settings)
stream_write_uint16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */ stream_write_uint16(s, colorPointerFlag); /* colorPointerFlag (2 bytes) */
stream_write_uint16(s, settings->pointer_cache_size); /* colorPointerCacheSize (2 bytes) */ stream_write_uint16(s, settings->pointer_cache_size); /* colorPointerCacheSize (2 bytes) */
stream_write_uint16(s, settings->pointer_cache_size); /* pointerCacheSize (2 bytes) */
if (settings->large_pointer)
{
stream_write_uint16(s, settings->pointer_cache_size); /* pointerCacheSize (2 bytes) */
}
rdp_capability_set_finish(s, header, CAPSET_TYPE_POINTER); rdp_capability_set_finish(s, header, CAPSET_TYPE_POINTER);
} }
@ -1877,6 +1881,12 @@ void rdp_write_confirm_active(STREAM* s, rdpSettings* settings)
rdp_write_offscreen_bitmap_cache_capability_set(s, settings); rdp_write_offscreen_bitmap_cache_capability_set(s, settings);
} }
if (settings->large_pointer)
{
numberCapabilities++;
rdp_write_large_pointer_capability_set(s, settings);
}
if (settings->remote_app) if (settings->remote_app)
{ {
numberCapabilities += 2; numberCapabilities += 2;