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); } }
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; }
void update_gdi_switch_surface(rdpUpdate* update, SWITCH_SURFACE_ORDER* switch_surface) { rdpCache* cache = update->context->cache; if (switch_surface->bitmapId == SCREEN_BITMAP_SURFACE) { Bitmap_SetSurface(update->context, NULL, True); } else { rdpBitmap* bitmap; bitmap = offscreen_cache_get(cache->offscreen, switch_surface->bitmapId); Bitmap_SetSurface(update->context, bitmap, False); } cache->offscreen->currentSurface = switch_surface->bitmapId; }
BOOL update_gdi_switch_surface(rdpContext* context, SWITCH_SURFACE_ORDER* switchSurface) { rdpCache* cache = context->cache; if (switchSurface->bitmapId == SCREEN_BITMAP_SURFACE) { Bitmap_SetSurface(context, NULL, TRUE); } else { rdpBitmap* bitmap; bitmap = offscreen_cache_get(cache->offscreen, switchSurface->bitmapId); Bitmap_SetSurface(context, bitmap, FALSE); } cache->offscreen->currentSurface = switchSurface->bitmapId; return TRUE; }
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); }