#define TAG FREERDP_TAG("cache.bitmap")
static rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id,
- UINT32 index);
+ UINT32 index);
static BOOL bitmap_cache_put(rdpBitmapCache* bitmap_cache, UINT32 id,
- UINT32 index, rdpBitmap* bitmap);
-
-static void bitmap_free(rdpContext* context, rdpBitmap* bitmap)
-{
-}
+ UINT32 index, rdpBitmap* bitmap);
static BOOL update_gdi_memblt(rdpContext* context,
- MEMBLT_ORDER* memblt)
+ MEMBLT_ORDER* memblt)
{
rdpBitmap* bitmap;
rdpCache* cache = context->cache;
bitmap = offscreen_cache_get(cache->offscreen, memblt->cacheIndex);
else
bitmap = bitmap_cache_get(cache->bitmap, (BYTE) memblt->cacheId,
- memblt->cacheIndex);
+ memblt->cacheIndex);
/* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */
if (bitmap == NULL)
}
static BOOL update_gdi_mem3blt(rdpContext* context,
- MEM3BLT_ORDER* mem3blt)
+ MEM3BLT_ORDER* mem3blt)
{
BYTE style;
rdpBitmap* bitmap;
bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex);
else
bitmap = bitmap_cache_get(cache->bitmap, (BYTE) mem3blt->cacheId,
- mem3blt->cacheIndex);
+ mem3blt->cacheIndex);
/* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */
if (!bitmap)
}
static BOOL update_gdi_cache_bitmap(rdpContext* context,
- const CACHE_BITMAP_ORDER* cacheBitmap)
+ const CACHE_BITMAP_ORDER* cacheBitmap)
{
rdpBitmap* bitmap;
rdpBitmap* prevBitmap;
return FALSE;
Bitmap_SetDimensions(bitmap, cacheBitmap->bitmapWidth,
- cacheBitmap->bitmapHeight);
+ cacheBitmap->bitmapHeight);
if (!bitmap->Decompress(context, bitmap,
- cacheBitmap->bitmapDataStream, cacheBitmap->bitmapWidth,
- cacheBitmap->bitmapHeight,
- cacheBitmap->bitmapBpp, cacheBitmap->bitmapLength,
- cacheBitmap->compressed, RDP_CODEC_ID_NONE))
+ cacheBitmap->bitmapDataStream, cacheBitmap->bitmapWidth,
+ cacheBitmap->bitmapHeight,
+ cacheBitmap->bitmapBpp, cacheBitmap->bitmapLength,
+ cacheBitmap->compressed, RDP_CODEC_ID_NONE))
{
Bitmap_Free(context, bitmap);
return FALSE;
}
prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmap->cacheId,
- cacheBitmap->cacheIndex);
+ cacheBitmap->cacheIndex);
Bitmap_Free(context, prevBitmap);
return bitmap_cache_put(cache->bitmap, cacheBitmap->cacheId,
- cacheBitmap->cacheIndex,
- bitmap);
+ cacheBitmap->cacheIndex,
+ bitmap);
}
static BOOL update_gdi_cache_bitmap_v2(rdpContext* context,
- CACHE_BITMAP_V2_ORDER* cacheBitmapV2)
+ CACHE_BITMAP_V2_ORDER* cacheBitmapV2)
{
rdpBitmap* bitmap;
cacheBitmapV2->bitmapBpp = settings->ColorDepth;
Bitmap_SetDimensions(bitmap, cacheBitmapV2->bitmapWidth,
- cacheBitmapV2->bitmapHeight);
+ cacheBitmapV2->bitmapHeight);
if (!bitmap->Decompress(context, bitmap,
- cacheBitmapV2->bitmapDataStream,
- cacheBitmapV2->bitmapWidth,
- cacheBitmapV2->bitmapHeight,
- cacheBitmapV2->bitmapBpp,
- cacheBitmapV2->bitmapLength,
- cacheBitmapV2->compressed,
- RDP_CODEC_ID_NONE))
+ cacheBitmapV2->bitmapDataStream,
+ cacheBitmapV2->bitmapWidth,
+ cacheBitmapV2->bitmapHeight,
+ cacheBitmapV2->bitmapBpp,
+ cacheBitmapV2->bitmapLength,
+ cacheBitmapV2->compressed,
+ RDP_CODEC_ID_NONE))
{
Bitmap_Free(context, bitmap);
return FALSE;
}
prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmapV2->cacheId,
- cacheBitmapV2->cacheIndex);
+ cacheBitmapV2->cacheIndex);
if (!bitmap->New(context, bitmap))
{
Bitmap_Free(context, prevBitmap);
return bitmap_cache_put(cache->bitmap, cacheBitmapV2->cacheId,
- cacheBitmapV2->cacheIndex, bitmap);
+ cacheBitmapV2->cacheIndex, bitmap);
}
static BOOL update_gdi_cache_bitmap_v3(rdpContext* context,
- CACHE_BITMAP_V3_ORDER* cacheBitmapV3)
+ CACHE_BITMAP_V3_ORDER* cacheBitmapV3)
{
rdpBitmap* bitmap;
rdpBitmap* prevBitmap;
Bitmap_SetDimensions(bitmap, bitmapData->width, bitmapData->height);
if (!bitmap->Decompress(context, bitmap,
- bitmapData->data, bitmapData->width, bitmapData->height,
- bitmapData->bpp, bitmapData->length, compressed,
- bitmapData->codecID))
+ bitmapData->data, bitmapData->width, bitmapData->height,
+ bitmapData->bpp, bitmapData->length, compressed,
+ bitmapData->codecID))
{
Bitmap_Free(context, bitmap);
return FALSE;
}
prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmapV3->cacheId,
- cacheBitmapV3->cacheIndex);
+ cacheBitmapV3->cacheIndex);
Bitmap_Free(context, prevBitmap);
return bitmap_cache_put(cache->bitmap, cacheBitmapV3->cacheId,
- cacheBitmapV3->cacheIndex, bitmap);
+ cacheBitmapV3->cacheIndex, bitmap);
}
rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmapCache, UINT32 id,
- UINT32 index)
+ UINT32 index)
{
rdpBitmap* bitmap;
}
BOOL bitmap_cache_put(rdpBitmapCache* bitmapCache, UINT32 id, UINT32 index,
- rdpBitmap* bitmap)
+ rdpBitmap* bitmap)
{
if (id > bitmapCache->maxCells)
{
bitmapCache->context = bitmapCache->update->context;
bitmapCache->maxCells = settings->BitmapCacheV2NumCells;
bitmapCache->cells = (BITMAP_V2_CELL*) calloc(bitmapCache->maxCells,
- sizeof(BITMAP_V2_CELL));
+ sizeof(BITMAP_V2_CELL));
if (!bitmapCache->cells)
goto fail;
bitmapCache->cells[i].number = settings->BitmapCacheV2CellInfo[i].numEntries;
/* allocate an extra entry for BITMAP_CACHE_WAITING_LIST_INDEX */
bitmapCache->cells[i].entries = (rdpBitmap**) calloc((
- bitmapCache->cells[i].number + 1), sizeof(rdpBitmap*));
+ bitmapCache->cells[i].number + 1), sizeof(rdpBitmap*));
if (!bitmapCache->cells[i].entries)
goto fail;