Exemplo n.º 1
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.º 2
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.º 3
0
void update_gdi_create_offscreen_bitmap(rdpUpdate* update, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap)
{
	rdpBitmap* bitmap;
	rdpBitmap* prevBitmap;
	rdpCache* cache = update->context->cache;

	bitmap = Bitmap_Alloc(update->context);

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

	bitmap->New(update->context, bitmap);

	prevBitmap = offscreen_cache_get(cache->offscreen, create_offscreen_bitmap->id);

	if (prevBitmap != NULL)
		Bitmap_Free(update->context, prevBitmap);

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

	if(cache->offscreen->currentSurface == create_offscreen_bitmap->id)
		Bitmap_SetSurface(update->context, bitmap, False);
}
Exemplo n.º 4
0
void update_gdi_create_offscreen_bitmap(rdpUpdate* update, CREATE_OFFSCREEN_BITMAP_ORDER* create_offscreen_bitmap)
{
	rdpBitmap* bitmap;
	rdpBitmap* prevBitmap;
	uint32 size = sizeof(rdpBitmap);
	rdpCache* cache = (rdpCache*) update->cache;

	IFCALL(cache->offscreen->OffscreenBitmapSize, update, &size);
	bitmap = (rdpBitmap*) xzalloc(size);

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

	IFCALL(cache->offscreen->OffscreenBitmapNew, update, bitmap);
	prevBitmap = offscreen_cache_get(cache->offscreen, create_offscreen_bitmap->id);

	if (prevBitmap != NULL)
	{
		IFCALL(cache->offscreen->OffscreenBitmapFree, update, prevBitmap);
		bitmap_free(prevBitmap);
	}

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