2011-08-06 00:56:40 +04:00
|
|
|
/**
|
2012-10-09 07:02:04 +04:00
|
|
|
* FreeRDP: A Remote Desktop Protocol Implementation
|
2011-08-06 00:56:40 +04:00
|
|
|
* Bitmap Cache V2
|
|
|
|
*
|
|
|
|
* Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2012-08-15 01:09:01 +04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2012-09-24 02:41:07 +04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2012-11-20 08:49:08 +04:00
|
|
|
#include <winpr/crt.h>
|
|
|
|
|
2011-10-21 01:28:59 +04:00
|
|
|
#include <freerdp/freerdp.h>
|
2012-07-24 23:05:22 +04:00
|
|
|
#include <freerdp/constants.h>
|
2013-03-22 00:45:25 +04:00
|
|
|
#include <winpr/stream.h>
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2011-10-12 02:51:45 +04:00
|
|
|
#include <freerdp/cache/bitmap.h>
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2011-11-22 03:11:43 +04:00
|
|
|
void update_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
|
2011-10-13 23:51:07 +04:00
|
|
|
{
|
|
|
|
rdpBitmap* bitmap;
|
2011-11-22 03:11:43 +04:00
|
|
|
rdpCache* cache = context->cache;
|
2011-10-13 23:51:07 +04:00
|
|
|
|
2011-10-14 03:32:18 +04:00
|
|
|
if (memblt->cacheId == 0xFF)
|
2011-10-13 23:51:07 +04:00
|
|
|
bitmap = offscreen_cache_get(cache->offscreen, memblt->cacheIndex);
|
|
|
|
else
|
2012-10-09 11:01:37 +04:00
|
|
|
bitmap = bitmap_cache_get(cache->bitmap, (BYTE) memblt->cacheId, memblt->cacheIndex);
|
2011-10-13 23:51:07 +04:00
|
|
|
|
|
|
|
memblt->bitmap = bitmap;
|
2011-11-22 03:11:43 +04:00
|
|
|
IFCALL(cache->bitmap->MemBlt, context, memblt);
|
2011-10-13 23:51:07 +04:00
|
|
|
}
|
|
|
|
|
2011-11-22 03:11:43 +04:00
|
|
|
void update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
2011-10-13 23:51:07 +04:00
|
|
|
{
|
2012-10-09 11:01:37 +04:00
|
|
|
BYTE style;
|
2011-10-13 23:51:07 +04:00
|
|
|
rdpBitmap* bitmap;
|
2011-11-22 03:11:43 +04:00
|
|
|
rdpCache* cache = context->cache;
|
2012-02-13 03:12:28 +04:00
|
|
|
rdpBrush* brush = &mem3blt->brush;
|
2011-10-13 23:51:07 +04:00
|
|
|
|
2011-10-14 03:32:18 +04:00
|
|
|
if (mem3blt->cacheId == 0xFF)
|
2011-10-13 23:51:07 +04:00
|
|
|
bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex);
|
|
|
|
else
|
2012-10-09 11:01:37 +04:00
|
|
|
bitmap = bitmap_cache_get(cache->bitmap, (BYTE) mem3blt->cacheId, mem3blt->cacheIndex);
|
2011-10-13 23:51:07 +04:00
|
|
|
|
2012-02-13 03:12:28 +04:00
|
|
|
style = brush->style;
|
|
|
|
|
|
|
|
if (brush->style & CACHED_BRUSH)
|
|
|
|
{
|
|
|
|
brush->data = brush_cache_get(cache->brush, brush->index, &brush->bpp);
|
|
|
|
brush->style = 0x03;
|
|
|
|
}
|
|
|
|
|
2011-10-13 23:51:07 +04:00
|
|
|
mem3blt->bitmap = bitmap;
|
2011-11-22 03:11:43 +04:00
|
|
|
IFCALL(cache->bitmap->Mem3Blt, context, mem3blt);
|
2012-02-13 03:12:28 +04:00
|
|
|
brush->style = style;
|
2011-10-13 23:51:07 +04:00
|
|
|
}
|
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
void update_gdi_cache_bitmap(rdpContext* context, CACHE_BITMAP_ORDER* cache_bitmap)
|
2011-11-11 10:48:31 +04:00
|
|
|
{
|
2012-01-05 05:17:11 +04:00
|
|
|
rdpBitmap* bitmap;
|
|
|
|
rdpBitmap* prevBitmap;
|
|
|
|
rdpCache* cache = context->cache;
|
|
|
|
|
|
|
|
bitmap = Bitmap_Alloc(context);
|
|
|
|
|
|
|
|
Bitmap_SetDimensions(context, bitmap, cache_bitmap->bitmapWidth, cache_bitmap->bitmapHeight);
|
|
|
|
|
|
|
|
bitmap->Decompress(context, bitmap,
|
|
|
|
cache_bitmap->bitmapDataStream, cache_bitmap->bitmapWidth, cache_bitmap->bitmapHeight,
|
2012-07-25 03:54:29 +04:00
|
|
|
cache_bitmap->bitmapBpp, cache_bitmap->bitmapLength,
|
2013-01-12 17:49:01 +04:00
|
|
|
cache_bitmap->compressed, RDP_CODEC_ID_NONE);
|
2012-01-05 05:17:11 +04:00
|
|
|
|
|
|
|
bitmap->New(context, bitmap);
|
|
|
|
|
|
|
|
prevBitmap = bitmap_cache_get(cache->bitmap, cache_bitmap->cacheId, cache_bitmap->cacheIndex);
|
|
|
|
|
|
|
|
if (prevBitmap != NULL)
|
|
|
|
Bitmap_Free(context, prevBitmap);
|
|
|
|
|
|
|
|
bitmap_cache_put(cache->bitmap, cache_bitmap->cacheId, cache_bitmap->cacheIndex, bitmap);
|
2011-11-11 10:48:31 +04:00
|
|
|
}
|
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
void update_gdi_cache_bitmap_v2(rdpContext* context, CACHE_BITMAP_V2_ORDER* cache_bitmap_v2)
|
2011-10-13 23:51:07 +04:00
|
|
|
{
|
|
|
|
rdpBitmap* bitmap;
|
|
|
|
rdpBitmap* prevBitmap;
|
2011-11-22 04:41:49 +04:00
|
|
|
rdpCache* cache = context->cache;
|
2011-10-13 23:51:07 +04:00
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
bitmap = Bitmap_Alloc(context);
|
2011-10-13 23:51:07 +04:00
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
Bitmap_SetDimensions(context, bitmap, cache_bitmap_v2->bitmapWidth, cache_bitmap_v2->bitmapHeight);
|
2011-10-21 05:34:55 +04:00
|
|
|
|
2012-01-03 11:09:14 +04:00
|
|
|
if (cache_bitmap_v2->bitmapBpp == 0)
|
|
|
|
{
|
|
|
|
/* Workaround for Windows 8 bug where bitmapBpp is not set */
|
2012-11-07 19:33:06 +04:00
|
|
|
cache_bitmap_v2->bitmapBpp = context->instance->settings->ColorDepth;
|
2012-01-03 11:09:14 +04:00
|
|
|
}
|
|
|
|
|
2012-07-25 03:54:29 +04:00
|
|
|
bitmap->Decompress(context, bitmap,
|
|
|
|
cache_bitmap_v2->bitmapDataStream, cache_bitmap_v2->bitmapWidth, cache_bitmap_v2->bitmapHeight,
|
|
|
|
cache_bitmap_v2->bitmapBpp, cache_bitmap_v2->bitmapLength,
|
2013-01-12 17:49:01 +04:00
|
|
|
cache_bitmap_v2->compressed, RDP_CODEC_ID_NONE);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
bitmap->New(context, bitmap);
|
2011-10-13 23:51:07 +04:00
|
|
|
|
2011-11-11 10:48:31 +04:00
|
|
|
prevBitmap = bitmap_cache_get(cache->bitmap, cache_bitmap_v2->cacheId, cache_bitmap_v2->cacheIndex);
|
2011-10-13 23:51:07 +04:00
|
|
|
|
|
|
|
if (prevBitmap != NULL)
|
2011-11-22 04:41:49 +04:00
|
|
|
Bitmap_Free(context, prevBitmap);
|
2011-10-13 23:51:07 +04:00
|
|
|
|
2011-11-11 10:48:31 +04:00
|
|
|
bitmap_cache_put(cache->bitmap, cache_bitmap_v2->cacheId, cache_bitmap_v2->cacheIndex, bitmap);
|
2011-10-13 23:51:07 +04:00
|
|
|
}
|
|
|
|
|
2012-07-24 23:05:22 +04:00
|
|
|
void update_gdi_cache_bitmap_v3(rdpContext* context, CACHE_BITMAP_V3_ORDER* cache_bitmap_v3)
|
|
|
|
{
|
|
|
|
rdpBitmap* bitmap;
|
|
|
|
rdpBitmap* prevBitmap;
|
|
|
|
rdpCache* cache = context->cache;
|
|
|
|
BITMAP_DATA_EX* bitmapData = &cache_bitmap_v3->bitmapData;
|
|
|
|
|
|
|
|
bitmap = Bitmap_Alloc(context);
|
|
|
|
|
|
|
|
Bitmap_SetDimensions(context, bitmap, bitmapData->width, bitmapData->height);
|
|
|
|
|
|
|
|
if (cache_bitmap_v3->bitmapData.bpp == 0)
|
|
|
|
{
|
|
|
|
/* Workaround for Windows 8 bug where bitmapBpp is not set */
|
2012-11-07 19:33:06 +04:00
|
|
|
cache_bitmap_v3->bitmapData.bpp = context->instance->settings->ColorDepth;
|
2012-07-24 23:05:22 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bitmap->Decompress(context, bitmap,
|
|
|
|
bitmapData->data, bitmap->width, bitmap->height,
|
2012-10-09 10:31:28 +04:00
|
|
|
bitmapData->bpp, bitmapData->length, TRUE,
|
2012-07-25 03:54:29 +04:00
|
|
|
bitmapData->codecID);
|
2012-07-24 23:05:22 +04:00
|
|
|
|
|
|
|
bitmap->New(context, bitmap);
|
|
|
|
|
|
|
|
prevBitmap = bitmap_cache_get(cache->bitmap, cache_bitmap_v3->cacheId, cache_bitmap_v3->cacheIndex);
|
|
|
|
|
|
|
|
if (prevBitmap != NULL)
|
|
|
|
Bitmap_Free(context, prevBitmap);
|
|
|
|
|
|
|
|
bitmap_cache_put(cache->bitmap, cache_bitmap_v3->cacheId, cache_bitmap_v3->cacheIndex, bitmap);
|
|
|
|
}
|
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
void update_gdi_bitmap_update(rdpContext* context, BITMAP_UPDATE* bitmap_update)
|
2011-10-21 01:28:59 +04:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
rdpBitmap* bitmap;
|
|
|
|
BITMAP_DATA* bitmap_data;
|
2012-10-09 10:38:39 +04:00
|
|
|
BOOL reused = TRUE;
|
2011-11-22 04:41:49 +04:00
|
|
|
rdpCache* cache = context->cache;
|
2011-10-21 01:28:59 +04:00
|
|
|
|
|
|
|
if (cache->bitmap->bitmap == NULL)
|
2011-10-21 05:34:55 +04:00
|
|
|
{
|
2011-11-22 04:41:49 +04:00
|
|
|
cache->bitmap->bitmap = Bitmap_Alloc(context);
|
2012-10-09 10:31:28 +04:00
|
|
|
cache->bitmap->bitmap->ephemeral = TRUE;
|
|
|
|
reused = FALSE;
|
2011-10-21 05:34:55 +04:00
|
|
|
}
|
2011-10-21 01:28:59 +04:00
|
|
|
|
|
|
|
bitmap = cache->bitmap->bitmap;
|
|
|
|
|
2011-12-04 02:24:18 +04:00
|
|
|
for (i = 0; i < (int) bitmap_update->number; i++)
|
2011-10-21 01:28:59 +04:00
|
|
|
{
|
2011-10-21 05:34:55 +04:00
|
|
|
bitmap_data = &bitmap_update->rectangles[i];
|
|
|
|
|
|
|
|
bitmap->bpp = bitmap_data->bitsPerPixel;
|
|
|
|
bitmap->length = bitmap_data->bitmapLength;
|
2011-10-26 23:38:50 +04:00
|
|
|
bitmap->compressed = bitmap_data->compressed;
|
2011-10-21 05:34:55 +04:00
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
Bitmap_SetRectangle(context, bitmap,
|
2011-10-21 05:34:55 +04:00
|
|
|
bitmap_data->destLeft, bitmap_data->destTop,
|
|
|
|
bitmap_data->destRight, bitmap_data->destBottom);
|
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
Bitmap_SetDimensions(context, bitmap, bitmap_data->width, bitmap_data->height);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
bitmap->Decompress(context, bitmap,
|
2011-10-21 01:28:59 +04:00
|
|
|
bitmap_data->bitmapDataStream, bitmap_data->width, bitmap_data->height,
|
2012-07-25 03:54:29 +04:00
|
|
|
bitmap_data->bitsPerPixel, bitmap_data->bitmapLength,
|
2013-01-12 17:49:01 +04:00
|
|
|
bitmap_data->compressed, RDP_CODEC_ID_NONE);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2011-10-26 20:34:18 +04:00
|
|
|
if (reused)
|
2011-11-22 04:41:49 +04:00
|
|
|
bitmap->Free(context, bitmap);
|
2011-10-26 20:34:18 +04:00
|
|
|
else
|
2012-10-09 10:31:28 +04:00
|
|
|
reused = TRUE;
|
2011-10-26 20:34:18 +04:00
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
bitmap->New(context, bitmap);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2011-11-22 04:41:49 +04:00
|
|
|
bitmap->Paint(context, bitmap);
|
2011-10-21 01:28:59 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-09 11:26:39 +04:00
|
|
|
rdpBitmap* bitmap_cache_get(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 index)
|
2011-10-13 23:51:07 +04:00
|
|
|
{
|
|
|
|
rdpBitmap* bitmap;
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2011-10-12 02:51:45 +04:00
|
|
|
if (id > bitmap_cache->maxCells)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "get invalid bitmap cell id: %d\n", id);
|
2011-08-06 00:56:40 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-01-04 03:22:42 +04:00
|
|
|
if (index == BITMAP_CACHE_WAITING_LIST_INDEX)
|
2012-03-27 23:44:03 +04:00
|
|
|
{
|
|
|
|
index = bitmap_cache->cells[id].number;
|
|
|
|
}
|
|
|
|
else if (index > bitmap_cache->cells[id].number)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "get invalid bitmap index %d in cell id: %d\n", index, id);
|
2011-08-06 00:56:40 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-10-13 23:51:07 +04:00
|
|
|
bitmap = bitmap_cache->cells[id].entries[index];
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2011-10-13 23:51:07 +04:00
|
|
|
return bitmap;
|
2011-08-06 00:56:40 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 11:26:39 +04:00
|
|
|
void bitmap_cache_put(rdpBitmapCache* bitmap_cache, UINT32 id, UINT32 index, rdpBitmap* bitmap)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2011-10-12 02:51:45 +04:00
|
|
|
if (id > bitmap_cache->maxCells)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "put invalid bitmap cell id: %d\n", id);
|
2011-08-06 00:56:40 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-01-04 03:22:42 +04:00
|
|
|
if (index == BITMAP_CACHE_WAITING_LIST_INDEX)
|
2012-03-27 23:44:03 +04:00
|
|
|
{
|
|
|
|
index = bitmap_cache->cells[id].number;
|
|
|
|
}
|
|
|
|
else if (index > bitmap_cache->cells[id].number)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2013-03-29 02:06:34 +04:00
|
|
|
fprintf(stderr, "put invalid bitmap index %d in cell id: %d\n", index, id);
|
2011-08-06 00:56:40 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-10-13 23:51:07 +04:00
|
|
|
bitmap_cache->cells[id].entries[index] = bitmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
void bitmap_cache_register_callbacks(rdpUpdate* update)
|
|
|
|
{
|
2011-10-16 08:50:10 +04:00
|
|
|
rdpCache* cache = update->context->cache;
|
2011-10-13 23:51:07 +04:00
|
|
|
|
2011-11-22 03:11:43 +04:00
|
|
|
cache->bitmap->MemBlt = update->primary->MemBlt;
|
|
|
|
cache->bitmap->Mem3Blt = update->primary->Mem3Blt;
|
2011-10-13 23:51:07 +04:00
|
|
|
|
2011-11-22 03:11:43 +04:00
|
|
|
update->primary->MemBlt = update_gdi_memblt;
|
|
|
|
update->primary->Mem3Blt = update_gdi_mem3blt;
|
2011-11-22 04:41:49 +04:00
|
|
|
|
|
|
|
update->secondary->CacheBitmap = update_gdi_cache_bitmap;
|
|
|
|
update->secondary->CacheBitmapV2 = update_gdi_cache_bitmap_v2;
|
2012-07-24 23:05:22 +04:00
|
|
|
update->secondary->CacheBitmapV3 = update_gdi_cache_bitmap_v3;
|
2011-11-22 04:41:49 +04:00
|
|
|
|
2011-10-21 01:28:59 +04:00
|
|
|
update->BitmapUpdate = update_gdi_bitmap_update;
|
2011-08-06 00:56:40 +04:00
|
|
|
}
|
|
|
|
|
2011-10-12 02:51:45 +04:00
|
|
|
rdpBitmapCache* bitmap_cache_new(rdpSettings* settings)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
|
|
|
int i;
|
2011-10-12 02:51:45 +04:00
|
|
|
rdpBitmapCache* bitmap_cache;
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2012-11-20 08:49:08 +04:00
|
|
|
bitmap_cache = (rdpBitmapCache*) malloc(sizeof(rdpBitmapCache));
|
|
|
|
ZeroMemory(bitmap_cache, sizeof(rdpBitmapCache));
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2011-10-12 02:51:45 +04:00
|
|
|
if (bitmap_cache != NULL)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2011-10-12 02:51:45 +04:00
|
|
|
bitmap_cache->settings = settings;
|
2011-10-13 23:51:07 +04:00
|
|
|
bitmap_cache->update = ((freerdp*) settings->instance)->update;
|
2011-10-21 01:28:59 +04:00
|
|
|
bitmap_cache->context = bitmap_cache->update->context;
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2012-11-08 00:13:14 +04:00
|
|
|
bitmap_cache->maxCells = settings->BitmapCacheV2NumCells;
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2012-11-20 08:49:08 +04:00
|
|
|
bitmap_cache->cells = (BITMAP_V2_CELL*) malloc(sizeof(BITMAP_V2_CELL) * bitmap_cache->maxCells);
|
|
|
|
ZeroMemory(bitmap_cache->cells, sizeof(BITMAP_V2_CELL) * bitmap_cache->maxCells);
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2011-12-04 02:24:18 +04:00
|
|
|
for (i = 0; i < (int) bitmap_cache->maxCells; i++)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2012-11-08 00:13:14 +04:00
|
|
|
bitmap_cache->cells[i].number = settings->BitmapCacheV2CellInfo[i].numEntries;
|
2012-03-27 23:44:03 +04:00
|
|
|
/* allocate an extra entry for BITMAP_CACHE_WAITING_LIST_INDEX */
|
2012-11-20 08:49:08 +04:00
|
|
|
bitmap_cache->cells[i].entries = (rdpBitmap**) malloc(sizeof(rdpBitmap*) * (bitmap_cache->cells[i].number + 1));
|
|
|
|
ZeroMemory(bitmap_cache->cells[i].entries, sizeof(rdpBitmap*) * (bitmap_cache->cells[i].number + 1));
|
2011-08-06 00:56:40 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-10-12 02:51:45 +04:00
|
|
|
return bitmap_cache;
|
2011-08-06 00:56:40 +04:00
|
|
|
}
|
|
|
|
|
2011-10-12 02:51:45 +04:00
|
|
|
void bitmap_cache_free(rdpBitmapCache* bitmap_cache)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
|
|
|
int i, j;
|
2011-10-13 23:51:07 +04:00
|
|
|
rdpBitmap* bitmap;
|
2011-08-06 00:56:40 +04:00
|
|
|
|
2011-10-12 02:51:45 +04:00
|
|
|
if (bitmap_cache != NULL)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2011-12-04 02:24:18 +04:00
|
|
|
for (i = 0; i < (int) bitmap_cache->maxCells; i++)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2012-03-27 23:44:03 +04:00
|
|
|
for (j = 0; j < (int) bitmap_cache->cells[i].number + 1; j++)
|
2011-08-06 00:56:40 +04:00
|
|
|
{
|
2011-10-13 23:51:07 +04:00
|
|
|
bitmap = bitmap_cache->cells[i].entries[j];
|
|
|
|
|
|
|
|
if (bitmap != NULL)
|
|
|
|
{
|
2011-10-21 01:28:59 +04:00
|
|
|
Bitmap_Free(bitmap_cache->context, bitmap);
|
2011-10-13 23:51:07 +04:00
|
|
|
}
|
2011-08-06 00:56:40 +04:00
|
|
|
}
|
|
|
|
|
2012-10-09 07:21:26 +04:00
|
|
|
free(bitmap_cache->cells[i].entries);
|
2011-08-06 00:56:40 +04:00
|
|
|
}
|
|
|
|
|
2011-11-17 06:15:28 +04:00
|
|
|
if (bitmap_cache->bitmap != NULL)
|
2012-02-02 03:42:20 +04:00
|
|
|
Bitmap_Free(bitmap_cache->context, bitmap_cache->bitmap);
|
2011-10-21 01:28:59 +04:00
|
|
|
|
2012-10-09 07:21:26 +04:00
|
|
|
free(bitmap_cache->cells);
|
|
|
|
free(bitmap_cache);
|
2011-08-06 00:56:40 +04:00
|
|
|
}
|
|
|
|
}
|