GUACAMOLE-249: Use reversed byte order for colors locally (verification needed).

This commit is contained in:
Michael Jumper 2019-09-29 16:08:27 -07:00
parent 7904d9c002
commit 17045d5d3a
4 changed files with 7 additions and 7 deletions

View File

@ -229,7 +229,7 @@ BOOL rdp_freerdp_pre_connect(freerdp* instance) {
instance->context->cache = cache_new(instance->settings); instance->context->cache = cache_new(instance->settings);
/* Init FreeRDP internal GDI implementation */ /* Init FreeRDP internal GDI implementation */
if (!gdi_init(instance, PIXEL_FORMAT_XRGB32)) if (!gdi_init(instance, PIXEL_FORMAT_BGRX32))
return FALSE; return FALSE;
/* Set up bitmap handling */ /* Set up bitmap handling */

View File

@ -73,13 +73,13 @@ BOOL guac_rdp_cache_bitmap(rdpContext* context, rdpBitmap* bitmap) {
BOOL guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap) { BOOL guac_rdp_bitmap_new(rdpContext* context, rdpBitmap* bitmap) {
/* Convert image data if present */ /* Convert image data if present */
if (bitmap->data != NULL && bitmap->format != PIXEL_FORMAT_XRGB32) { if (bitmap->data != NULL && bitmap->format != PIXEL_FORMAT_BGRX32) {
/* Allocate sufficient space for converted image */ /* Allocate sufficient space for converted image */
unsigned char* image_buffer = _aligned_malloc(bitmap->width * bitmap->height * 4, 16); unsigned char* image_buffer = _aligned_malloc(bitmap->width * bitmap->height * 4, 16);
/* Attempt image conversion */ /* Attempt image conversion */
if (!freerdp_image_copy(image_buffer, PIXEL_FORMAT_XRGB32, 0, 0, 0, if (!freerdp_image_copy(image_buffer, PIXEL_FORMAT_BGRX32, 0, 0, 0,
bitmap->width, bitmap->height, bitmap->data, bitmap->format, bitmap->width, bitmap->height, bitmap->data, bitmap->format,
0, 0, 0, &context->gdi->palette, FREERDP_FLIP_NONE)) { 0, 0, 0, &context->gdi->palette, FREERDP_FLIP_NONE)) {
_aligned_free(image_buffer); _aligned_free(image_buffer);

View File

@ -48,7 +48,7 @@ static UINT32 guac_rdp_get_pixel_format(int depth) {
/* 32- and 24-bit RGB (8 bits per color component) */ /* 32- and 24-bit RGB (8 bits per color component) */
case 32: case 32:
case 24: case 24:
return PIXEL_FORMAT_BGR24; return PIXEL_FORMAT_RGB24;
/* 16-bit palette (6-bit green, 5-bit red and blue) */ /* 16-bit palette (6-bit green, 5-bit red and blue) */
case 16: case 16:
@ -65,7 +65,7 @@ static UINT32 guac_rdp_get_pixel_format(int depth) {
} }
/* Unknown format */ /* Unknown format */
return PIXEL_FORMAT_BGR24; return PIXEL_FORMAT_RGB24;
} }
@ -76,7 +76,7 @@ UINT32 guac_rdp_convert_color(rdpContext* context, UINT32 color) {
/* Convert given color to ARGB32 */ /* Convert given color to ARGB32 */
return FreeRDPConvertColor(color, guac_rdp_get_pixel_format(depth), return FreeRDPConvertColor(color, guac_rdp_get_pixel_format(depth),
PIXEL_FORMAT_ARGB32, &gdi->palette); PIXEL_FORMAT_BGRA32, &gdi->palette);
} }

View File

@ -48,7 +48,7 @@ BOOL guac_rdp_pointer_new(rdpContext* context, rdpPointer* pointer) {
/* Convert to alpha cursor if mask data present */ /* Convert to alpha cursor if mask data present */
if (pointer->andMaskData && pointer->xorMaskData) if (pointer->andMaskData && pointer->xorMaskData)
freerdp_image_copy_from_pointer_data(data, PIXEL_FORMAT_ARGB32, freerdp_image_copy_from_pointer_data(data, PIXEL_FORMAT_BGRA32,
0, 0, 0, pointer->width, pointer->height, 0, 0, 0, pointer->width, pointer->height,
pointer->xorMaskData, pointer->lengthXorMask, pointer->xorMaskData, pointer->lengthXorMask,
pointer->andMaskData, pointer->lengthAndMask, pointer->andMaskData, pointer->lengthAndMask,