xfreerdp: improve X11 GDI software rendering performance
This commit is contained in:
parent
cdbc233e9f
commit
c4895ca1ac
@ -66,6 +66,8 @@ void xf_end_paint(rdpUpdate* update)
|
|||||||
{
|
{
|
||||||
GDI* gdi;
|
GDI* gdi;
|
||||||
xfInfo* xfi;
|
xfInfo* xfi;
|
||||||
|
sint32 x, y;
|
||||||
|
uint32 w, h;
|
||||||
XImage* image;
|
XImage* image;
|
||||||
|
|
||||||
gdi = GET_GDI(update);
|
gdi = GET_GDI(update);
|
||||||
@ -74,22 +76,14 @@ void xf_end_paint(rdpUpdate* update)
|
|||||||
if (gdi->primary->hdc->hwnd->invalid->null)
|
if (gdi->primary->hdc->hwnd->invalid->null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
image = XCreateImage(xfi->display, xfi->visual, xfi->depth, ZPixmap, 0,
|
x = gdi->primary->hdc->hwnd->invalid->x;
|
||||||
(char*) gdi->primary_buffer, gdi->width, gdi->height, xfi->scanline_pad, 0);
|
y = gdi->primary->hdc->hwnd->invalid->y;
|
||||||
|
w = gdi->primary->hdc->hwnd->invalid->w;
|
||||||
XPutImage(xfi->display, xfi->primary, xfi->gc_default, image, 0, 0, 0, 0, gdi->width, gdi->height);
|
h = gdi->primary->hdc->hwnd->invalid->h;
|
||||||
|
|
||||||
XCopyArea(xfi->display, xfi->primary, xfi->window, xfi->gc_default,
|
|
||||||
gdi->primary->hdc->hwnd->invalid->x,
|
|
||||||
gdi->primary->hdc->hwnd->invalid->y,
|
|
||||||
gdi->primary->hdc->hwnd->invalid->w,
|
|
||||||
gdi->primary->hdc->hwnd->invalid->h,
|
|
||||||
gdi->primary->hdc->hwnd->invalid->x,
|
|
||||||
gdi->primary->hdc->hwnd->invalid->y);
|
|
||||||
|
|
||||||
|
XPutImage(xfi->display, xfi->primary, xfi->gc_default, xfi->image, x, y, x, y, w, h);
|
||||||
|
XCopyArea(xfi->display, xfi->primary, xfi->window, xfi->gc_default, x, y, w, h, x, y);
|
||||||
XFlush(xfi->display);
|
XFlush(xfi->display);
|
||||||
|
|
||||||
XFree(image);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean xf_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount)
|
boolean xf_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount)
|
||||||
@ -380,6 +374,9 @@ boolean xf_post_connect(freerdp* instance)
|
|||||||
XFillRectangle(xfi->display, xfi->primary, xfi->gc, 0, 0, xfi->width, xfi->height);
|
XFillRectangle(xfi->display, xfi->primary, xfi->gc, 0, 0, xfi->width, xfi->height);
|
||||||
xfi->modifier_map = XGetModifierMapping(xfi->display);
|
xfi->modifier_map = XGetModifierMapping(xfi->display);
|
||||||
|
|
||||||
|
xfi->image = XCreateImage(xfi->display, xfi->visual, xfi->depth, ZPixmap, 0,
|
||||||
|
(char*) gdi->primary_buffer, gdi->width, gdi->height, xfi->scanline_pad, 0);
|
||||||
|
|
||||||
instance->update->BeginPaint = xf_begin_paint;
|
instance->update->BeginPaint = xf_begin_paint;
|
||||||
instance->update->EndPaint = xf_end_paint;
|
instance->update->EndPaint = xf_end_paint;
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ struct xf_info
|
|||||||
int height;
|
int height;
|
||||||
Window window;
|
Window window;
|
||||||
Screen* screen;
|
Screen* screen;
|
||||||
|
XImage* image;
|
||||||
Pixmap primary;
|
Pixmap primary;
|
||||||
Drawable drawing;
|
Drawable drawing;
|
||||||
Visual* visual;
|
Visual* visual;
|
||||||
|
Loading…
Reference in New Issue
Block a user