Merge pull request #2091 from ptsekov/software-gdi-improvements

Fix #2090
This commit is contained in:
Marc-André Moreau 2014-09-11 13:52:16 -04:00
commit 7e4b3b13b1
2 changed files with 21 additions and 11 deletions

View File

@ -281,16 +281,25 @@ void wf_Pointer_SetDefault(wfContext* wfc)
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);
@ -300,6 +309,5 @@ void wf_register_graphics(rdpGraphics* graphics)
pointer.SetNull = (pPointer_SetNull) wf_Pointer_SetNull;
pointer.SetDefault = (pPointer_SetDefault) wf_Pointer_SetDefault;
graphics_register_bitmap(graphics, &bitmap);
graphics_register_pointer(graphics, &pointer);
}

View File

@ -347,10 +347,12 @@ BOOL wf_post_connect(freerdp* instance)
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
{