void update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) { BYTE style; rdpBitmap* bitmap; rdpCache* cache = context->cache; rdpBrush* brush = &mem3blt->brush; if (mem3blt->cacheId == 0xFF) bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex); else bitmap = bitmap_cache_get(cache->bitmap, (BYTE) mem3blt->cacheId, mem3blt->cacheIndex); /* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */ if (bitmap == NULL) return; style = brush->style; if (brush->style & CACHED_BRUSH) { brush->data = brush_cache_get(cache->brush, brush->index, &brush->bpp); brush->style = 0x03; } mem3blt->bitmap = bitmap; IFCALL(cache->bitmap->Mem3Blt, context, mem3blt); brush->style = style; }
void update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) { rdpBitmap* bitmap; rdpCache* cache = context->cache; if (mem3blt->cacheId == 0xFF) bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex); else bitmap = bitmap_cache_get(cache->bitmap, (uint8) mem3blt->cacheId, mem3blt->cacheIndex); mem3blt->bitmap = bitmap; IFCALL(cache->bitmap->Mem3Blt, context, mem3blt); }
void update_gdi_switch_surface(rdpUpdate* update, SWITCH_SURFACE_ORDER* switch_surface) { rdpCache* cache = (rdpCache*) update->cache; if (switch_surface->bitmapId == SCREEN_BITMAP_SURFACE) { IFCALL(cache->offscreen->SetSurface, update, NULL, True); } else { rdpBitmap* bitmap; bitmap = offscreen_cache_get(cache->offscreen, switch_surface->bitmapId); IFCALL(cache->offscreen->SetSurface, update, bitmap, False); } }
void update_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) { rdpBitmap* bitmap; rdpCache* cache = context->cache; if (memblt->cacheId == 0xFF) bitmap = offscreen_cache_get(cache->offscreen, memblt->cacheIndex); else bitmap = bitmap_cache_get(cache->bitmap, (BYTE) memblt->cacheId, memblt->cacheIndex); /* XP-SP2 servers sometimes ask for cached bitmaps they've never defined. */ if (bitmap == NULL) return; memblt->bitmap = bitmap; IFCALL(cache->bitmap->MemBlt, context, memblt); }
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); }
void update_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) { uint8 style; rdpBitmap* bitmap; rdpCache* cache = context->cache; rdpBrush* brush = &mem3blt->brush; if (mem3blt->cacheId == 0xFF) bitmap = offscreen_cache_get(cache->offscreen, mem3blt->cacheIndex); else bitmap = bitmap_cache_get(cache->bitmap, (uint8) mem3blt->cacheId, mem3blt->cacheIndex); style = brush->style; if (brush->style & CACHED_BRUSH) { brush->data = brush_cache_get(cache->brush, brush->index, &brush->bpp); brush->style = 0x03; } mem3blt->bitmap = bitmap; IFCALL(cache->bitmap->Mem3Blt, context, mem3blt); brush->style = style; }
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); }