void wf_register_graphics(rdpGraphics* graphics)
{
- rdpBitmap bitmap;
+ wfContext* wfc;
rdpPointer pointer;
- ZeroMemory(&bitmap, sizeof(rdpBitmap));
- bitmap.size = sizeof(wfBitmap);
- bitmap.New = (pBitmap_New) wf_Bitmap_New;
- bitmap.Free = (pBitmap_Free) wf_Bitmap_Free;
- bitmap.Paint = (pBitmap_Paint) wf_Bitmap_Paint;
- bitmap.Decompress = (pBitmap_Decompress) wf_Bitmap_Decompress;
- bitmap.SetSurface = (pBitmap_SetSurface) wf_Bitmap_SetSurface;
+ wfc = (wfContext*) graphics->context;
+
+ if (wfc->sw_gdi == FALSE)
+ {
+ rdpBitmap bitmap;
+
+ ZeroMemory(&bitmap, sizeof(rdpBitmap));
+ bitmap.size = sizeof(wfBitmap);
+ bitmap.New = (pBitmap_New) wf_Bitmap_New;
+ bitmap.Free = (pBitmap_Free) wf_Bitmap_Free;
+ bitmap.Paint = (pBitmap_Paint) wf_Bitmap_Paint;
+ bitmap.Decompress = (pBitmap_Decompress) wf_Bitmap_Decompress;
+ bitmap.SetSurface = (pBitmap_SetSurface) wf_Bitmap_SetSurface;
+
+ graphics_register_bitmap(graphics, &bitmap);
+ }
ZeroMemory(&pointer, sizeof(rdpPointer));
pointer.size = sizeof(wfPointer);
pointer.SetNull = (pPointer_SetNull) wf_Pointer_SetNull;
pointer.SetDefault = (pPointer_SetDefault) wf_Pointer_SetDefault;
- graphics_register_bitmap(graphics, &bitmap);
graphics_register_pointer(graphics, &pointer);
}
if (wfc->sw_gdi)
{
- gdi_init(instance, CLRCONV_ALPHA | CLRCONV_INVERT | CLRBUF_32BPP, NULL);
+ wfc->primary = wf_image_new(wfc, wfc->width, wfc->height, wfc->dstBpp, NULL);
+
+ gdi_init(instance, CLRCONV_ALPHA | CLRBUF_32BPP, wfc->primary->pdata);
+
gdi = instance->context->gdi;
wfc->hdc = gdi->primary->hdc;
- wfc->primary = wf_image_new(wfc, wfc->width, wfc->height, wfc->dstBpp, gdi->primary_buffer);
}
else
{