wfreerdp: improve rendering to a usable level

This commit is contained in:
Marc-André Moreau 2011-11-12 01:41:28 -05:00
parent 150ff56f5f
commit 0f622844c3
2 changed files with 21 additions and 51 deletions

View File

@ -96,32 +96,6 @@ void wf_toggle_fullscreen(wfInfo* wfi)
SetForegroundWindow(wfi->hwnd);
}
#if 0
void wf_gdi_bitmap_update(rdpUpdate* update, BITMAP_UPDATE* bitmap)
{
int i;
rdpBitmap* bmp;
wfBitmap* wf_bmp;
wfInfo* wfi = ((wfContext*) update->context)->wfi;
for (i = 0; i < bitmap->number; i++)
{
bmp = &bitmap->rectangles[i];
wf_bmp = wf_image_new(wfi, bmp->width, bmp->height, wfi->srcBpp, bmp->dstData);
BitBlt(wfi->primary->hdc,
bmp->left, bmp->top, bmp->right - bmp->left + 1,
bmp->bottom - bmp->top + 1, wf_bmp->hdc, 0, 0, GDI_SRCCOPY);
wf_invalidate_region(wfi, bmp->left, bmp->top, bmp->right - bmp->left + 1, bmp->bottom - bmp->top + 1);
wf_image_free(wf_bmp);
}
}
#endif
void wf_gdi_palette_update(rdpUpdate* update, PALETTE_UPDATE* palette)
{
@ -134,7 +108,7 @@ void wf_gdi_set_bounds(rdpUpdate* update, BOUNDS* bounds)
if (bounds != NULL)
{
hrgn = CreateRectRgn(bounds->left, bounds->top, bounds->right, bounds->bottom);
hrgn = CreateRectRgn(bounds->left, bounds->top, bounds->right + 1, bounds->bottom + 1);
SelectClipRgn(wfi->drawing->hdc, hrgn);
DeleteObject(hrgn);
}
@ -262,11 +236,6 @@ void wf_gdi_memblt(rdpUpdate* update, MEMBLT_ORDER* memblt)
wf_invalidate_region(wfi, memblt->nLeftRect, memblt->nTopRect, memblt->nWidth, memblt->nHeight);
}
void wf_gdi_mem3blt(rdpUpdate* update, MEM3BLT_ORDER* mem3blt)
{
}
void wf_gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_command)
{
@ -289,7 +258,7 @@ void wf_gdi_register_update_callbacks(rdpUpdate* update)
update->LineTo = wf_gdi_line_to;
update->Polyline = NULL;
update->MemBlt = wf_gdi_memblt;
update->Mem3Blt = wf_gdi_mem3blt;
update->Mem3Blt = NULL;
update->SaveBitmap = NULL;
update->GlyphIndex = NULL;
update->FastIndex = NULL;

View File

@ -149,13 +149,13 @@ boolean wf_pre_connect(freerdp* instance)
settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = True;
settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = False;
settings->order_support[NEG_LINETO_INDEX] = True;
settings->order_support[NEG_POLYLINE_INDEX] = True;
settings->order_support[NEG_MEMBLT_INDEX] = False;
settings->order_support[NEG_POLYLINE_INDEX] = False;
settings->order_support[NEG_MEMBLT_INDEX] = True;
settings->order_support[NEG_MEM3BLT_INDEX] = False;
settings->order_support[NEG_SAVEBITMAP_INDEX] = True;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_INDEX_INDEX] = True;
settings->order_support[NEG_FAST_GLYPH_INDEX] = True;
settings->order_support[NEG_SAVEBITMAP_INDEX] = False;
settings->order_support[NEG_GLYPH_INDEX_INDEX] = False;
settings->order_support[NEG_FAST_INDEX_INDEX] = False;
settings->order_support[NEG_FAST_GLYPH_INDEX] = False;
settings->order_support[NEG_POLYGON_SC_INDEX] = False;
settings->order_support[NEG_POLYGON_CB_INDEX] = False;
settings->order_support[NEG_ELLIPSE_SC_INDEX] = False;
@ -371,10 +371,10 @@ int wfreerdp_run(freerdp* instance)
{
MSG msg;
int index;
int gmcode;
int alldone;
int rcount;
int wcount;
BOOL msg_ret;
int quit_msg;
void* rfds[32];
void* wfds[32];
int fds_count;
@ -389,7 +389,6 @@ int wfreerdp_run(freerdp* instance)
channels = instance->context->channels;
/* program main loop */
while (1)
{
rcount = 0;
@ -428,8 +427,9 @@ int wfreerdp_run(freerdp* instance)
printf("wfreerdp_run: fds_count is zero\n");
break;
}
/* do the wait */
if (MsgWaitForMultipleObjects(fds_count, fds, FALSE, INFINITE, QS_ALLINPUT) == WAIT_FAILED)
if (MsgWaitForMultipleObjects(fds_count, fds, FALSE, 1, QS_ALLINPUT) == WAIT_FAILED)
{
printf("wfreerdp_run: WaitForMultipleObjects failed: 0x%04X\n", GetLastError());
break;
@ -452,22 +452,23 @@ int wfreerdp_run(freerdp* instance)
}
wf_process_channel_event(channels, instance);
alldone = FALSE;
while (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE))
quit_msg = FALSE;
while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
{
gmcode = GetMessage(&msg, 0, 0, 0);
if (gmcode == 0 || gmcode == -1)
msg_ret = GetMessage(&msg, NULL, 0, 0);
if (msg_ret == 0 || msg_ret == -1)
{
alldone = TRUE;
quit_msg = TRUE;
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
if (alldone)
{
if (quit_msg)
break;
}
}
/* cleanup */