Exemplo n.º 1
0
BOOL update_gdi_create_offscreen_bitmap(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* createOffscreenBitmap)
{
	int i;
	UINT16 index;
	rdpBitmap* bitmap;
	rdpCache* cache = context->cache;

	bitmap = Bitmap_Alloc(context);
	if (!bitmap)
		return FALSE;

	bitmap->width = createOffscreenBitmap->cx;
	bitmap->height = createOffscreenBitmap->cy;

	if (!bitmap->New(context, bitmap))
	{
		free(bitmap);
		return FALSE;
	}

	offscreen_cache_delete(cache->offscreen, createOffscreenBitmap->id);
	offscreen_cache_put(cache->offscreen, createOffscreenBitmap->id, bitmap);

	if(cache->offscreen->currentSurface == createOffscreenBitmap->id)
		Bitmap_SetSurface(context, bitmap, FALSE);

	for (i = 0; i < (int) createOffscreenBitmap->deleteList.cIndices; i++)
	{
		index = createOffscreenBitmap->deleteList.indices[i];
		offscreen_cache_delete(cache->offscreen, index);
	}
	return TRUE;
}
Exemplo n.º 2
0
void update_gdi_create_offscreen_bitmap(rdpContext* context, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap)
{
	int i;
	uint16 index;
	rdpBitmap* bitmap;
	rdpCache* cache = context->cache;

	bitmap = Bitmap_Alloc(context);

	bitmap->width = create_offscreen_bitmap->cx;
	bitmap->height = create_offscreen_bitmap->cy;

	bitmap->New(context, bitmap);

	offscreen_cache_delete(cache->offscreen, create_offscreen_bitmap->id);
	offscreen_cache_put(cache->offscreen, create_offscreen_bitmap->id, bitmap);

	if(cache->offscreen->currentSurface == create_offscreen_bitmap->id)
		Bitmap_SetSurface(context, bitmap, false);

	for (i = 0; i < (int) create_offscreen_bitmap->deleteList.cIndices; i++)
	{
		index = create_offscreen_bitmap->deleteList.indices[i];
		offscreen_cache_delete(cache->offscreen, index);
	}
}
Exemplo n.º 3
0
void offscreen_cache_put(rdpOffscreenCache* offscreen, uint32 index, rdpBitmap* bitmap)
{
	if (index >= offscreen->maxEntries)
	{
		printf("invalid offscreen bitmap index: 0x%04X\n", index);
		return;
	}

	offscreen_cache_delete(offscreen, index);
	offscreen->entries[index] = bitmap;
}
Exemplo n.º 4
0
void offscreen_cache_put(rdpOffscreenCache* offscreenCache, UINT32 index, rdpBitmap* bitmap)
{
	if (index >= offscreenCache->maxEntries)
	{
		WLog_ERR(TAG,  "invalid offscreen bitmap index: 0x%04X", index);
		return;
	}

	offscreen_cache_delete(offscreenCache, index);
	offscreenCache->entries[index] = bitmap;
}