From: Marc-André Moreau Date: Fri, 12 Sep 2014 05:11:40 +0000 (-0400) Subject: libfreerdp-cache: fix 15bpp X-Git-Tag: 2.0.0-beta1+android10~817^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=efd9b8f7a96ad8d5b5182c27b958cb0521ba3da9;p=platform%2Fupstream%2Ffreerdp.git libfreerdp-cache: fix 15bpp --- diff --git a/libfreerdp/cache/bitmap.c b/libfreerdp/cache/bitmap.c index afffaa9..7b67b8d 100644 --- a/libfreerdp/cache/bitmap.c +++ b/libfreerdp/cache/bitmap.c @@ -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);