libfreerdp-cache: fix 15bpp

This commit is contained in:
Marc-André Moreau 2014-09-12 01:11:40 -04:00
parent 7130b7064e
commit efd9b8f7a9

View File

@ -107,13 +107,17 @@ void update_gdi_cache_bitmap_v2(rdpContext* context, CACHE_BITMAP_V2_ORDER* cach
rdpBitmap* bitmap;
rdpBitmap* prevBitmap;
rdpCache* cache = context->cache;
rdpSettings* settings = context->settings;
bitmap = Bitmap_Alloc(context);
Bitmap_SetDimensions(context, bitmap, cacheBitmapV2->bitmapWidth, cacheBitmapV2->bitmapHeight);
if (!cacheBitmapV2->bitmapBpp)
cacheBitmapV2->bitmapBpp = context->settings->ColorDepth;
cacheBitmapV2->bitmapBpp = settings->ColorDepth;
if ((settings->ColorDepth == 15) && (cacheBitmapV2->bitmapBpp == 16))
cacheBitmapV2->bitmapBpp = settings->ColorDepth;
bitmap->Decompress(context, bitmap,
cacheBitmapV2->bitmapDataStream, cacheBitmapV2->bitmapWidth, cacheBitmapV2->bitmapHeight,
@ -134,8 +138,9 @@ void update_gdi_cache_bitmap_v3(rdpContext* context, CACHE_BITMAP_V3_ORDER* cach
{
rdpBitmap* bitmap;
rdpBitmap* prevBitmap;
BOOL isCompressed = TRUE;
BOOL compressed = TRUE;
rdpCache* cache = context->cache;
rdpSettings* settings = context->settings;
BITMAP_DATA_EX* bitmapData = &cacheBitmapV3->bitmapData;
bitmap = Bitmap_Alloc(context);
@ -143,15 +148,13 @@ void update_gdi_cache_bitmap_v3(rdpContext* context, CACHE_BITMAP_V3_ORDER* cach
Bitmap_SetDimensions(context, bitmap, bitmapData->width, bitmapData->height);
if (!cacheBitmapV3->bpp)
cacheBitmapV3->bpp = context->settings->ColorDepth;
cacheBitmapV3->bpp = settings->ColorDepth;
/* According to http://msdn.microsoft.com/en-us/library/gg441209.aspx
* CACHE_BITMAP_REV3_ORDER::bitmapData::codecID = 0x00 (uncompressed) */
isCompressed = (bitmapData->codecID != RDP_CODEC_ID_NONE);
compressed = (bitmapData->codecID != RDP_CODEC_ID_NONE);
bitmap->Decompress(context, bitmap,
bitmapData->data, bitmap->width, bitmap->height,
bitmapData->bpp, bitmapData->length, isCompressed,
bitmapData->bpp, bitmapData->length, compressed,
bitmapData->codecID);
bitmap->New(context, bitmap);