xfreerdp: make use of --gdi hw by default
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 10 Oct 2011 01:43:31 +0000 (21:43 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 10 Oct 2011 01:43:31 +0000 (21:43 -0400)
client/X11/xf_gdi.c
client/X11/xfreerdp.c
client/X11/xfreerdp.h

index 03fe1c8..9ee5d9e 100644 (file)
@@ -548,8 +548,10 @@ void xf_gdi_line_to(rdpUpdate* update, LINE_TO_ORDER* line_to)
 void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
 {
        int i;
+       int x, y;
        uint32 color;
        XPoint* points;
+       int width, height;
        xfInfo* xfi = GET_XFI(update);
 
        xf_set_rop2(xfi, polyline->bRop2);
@@ -564,6 +566,34 @@ void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
        {
                points[i].x = polyline->points[i].x;
                points[i].y = polyline->points[i].y;
+
+               if (i > 0)
+               {
+                       width = points[i].x - points[i - 1].x;
+                       height = points[i].y - points[i - 1].y;
+
+                       if (width < 0)
+                       {
+                               width *= (-1);
+                               x = points[i].x;
+                       }
+                       else
+                       {
+                               x = points[i - 1].x;
+                       }
+
+                       if (height < 0)
+                       {
+                               height *= (-1);
+                               y = points[i].y;
+                       }
+                       else
+                       {
+                               y = points[i - 1].y;
+                       }
+
+                       gdi_InvalidateRegion(xfi->hdc, x, y, width, height);
+               }
        }
 
        XDrawLines(xfi->display, xfi->drawing, xfi->gc, points, polyline->numPoints, CoordModePrevious);
@@ -988,7 +1018,7 @@ void xf_gdi_register_update_callbacks(rdpUpdate* update)
        update->MultiOpaqueRect = xf_gdi_multi_opaque_rect;
        update->MultiDrawNineGrid = NULL;
        update->LineTo = xf_gdi_line_to;
-       update->Polyline = NULL;
+       update->Polyline = xf_gdi_polyline;
        update->MemBlt = xf_gdi_memblt;
        update->Mem3Blt = xf_gdi_mem3blt;
        update->SaveBitmap = NULL;
index d0d09a5..5e44f5f 100644 (file)
@@ -629,7 +629,6 @@ boolean xf_post_connect(freerdp* instance)
 
        xfi->bitmap_mono = XCreatePixmap(xfi->display, xfi->drawable, 8, 8, 1);
        xfi->gc_mono = XCreateGC(xfi->display, xfi->bitmap_mono, GCGraphicsExposures, &gcv);
-       xfi->gc_default = XCreateGC(xfi->display, xfi->drawable, GCGraphicsExposures, &gcv);
 
        XSetForeground(xfi->display, xfi->gc, BlackPixelOfScreen(xfi->screen));
        XFillRectangle(xfi->display, xfi->primary, xfi->gc, 0, 0, xfi->width, xfi->height);
@@ -958,7 +957,7 @@ int main(int argc, char* argv[])
        chanman = freerdp_chanman_new();
        SET_CHANMAN(instance, chanman);
 
-       instance->settings->sw_gdi = True;
+       instance->settings->sw_gdi = False;
 
        if (freerdp_parse_args(instance->settings, argc, argv,
                        xf_process_plugin_args, chanman, xf_process_ui_args, NULL) < 0)
index 8da53b3..149a081 100644 (file)
@@ -60,7 +60,6 @@ struct xf_info
        int height;
        int srcBpp;
        GC gc_mono;
-       GC gc_default;
        Screen* screen;
        XImage* image;
        Pixmap primary;
@@ -142,5 +141,4 @@ boolean xf_post_connect(freerdp* instance);
 #define DEBUG_X11_LMS(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
 #endif
 
-
 #endif /* __XFREERDP_H */