diff options
Diffstat (limited to 'xorg/X11R7.6/rdp/rdpPolyFillArc.c')
-rw-r--r-- | xorg/X11R7.6/rdp/rdpPolyFillArc.c | 69 |
1 files changed, 54 insertions, 15 deletions
diff --git a/xorg/X11R7.6/rdp/rdpPolyFillArc.c b/xorg/X11R7.6/rdp/rdpPolyFillArc.c index 91ab7899..3f956a11 100644 --- a/xorg/X11R7.6/rdp/rdpPolyFillArc.c +++ b/xorg/X11R7.6/rdp/rdpPolyFillArc.c @@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from rdpmain.c */ +extern int g_do_dirty_os; /* in rdpmain.c */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -66,12 +67,16 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) int i; int num_clips; int got_id; + int dirty_type; + int post_process; + int reset_surface; xRectangle* rects; BoxRec box; struct image_data id; WindowPtr pDstWnd; PixmapPtr pDstPixmap; rdpPixmapRec* pDstPriv; + rdpPixmapRec* pDirtyPriv; LLOGLN(10, ("rdpPolyFillArc:")); @@ -97,6 +102,10 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) /* do original call */ rdpPolyFillArcOrg(pDrawable, pGC, narcs, parcs); + dirty_type = 0; + pDirtyPriv = 0; + post_process = 0; + reset_surface = 0; got_id = 0; if (pDrawable->type == DRAWABLE_PIXMAP) { @@ -104,9 +113,21 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) pDstPriv = GETPIXPRIV(pDstPixmap); if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpindex); - rdpup_get_pixmap_image_rect(pDstPixmap, &id); - got_id = 1; + post_process = 1; + if (g_do_dirty_os) + { + LLOGLN(10, ("rdpPolyFillArc: gettig dirty")); + pDstPriv->is_dirty = 1; + pDirtyPriv = pDstPriv; + dirty_type = RDI_IMGLY; + } + else + { + rdpup_switch_os_surface(pDstPriv->rdpindex); + reset_surface = 1; + rdpup_get_pixmap_image_rect(pDstPixmap, &id); + got_id = 1; + } } } else @@ -116,12 +137,13 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) pDstWnd = (WindowPtr)pDrawable; if (pDstWnd->viewable) { + post_process = 1; rdpup_get_screen_image_rect(&id); got_id = 1; } } } - if (!got_id) + if (!post_process) { g_free(rects); return; @@ -137,13 +159,20 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) num_clips = REGION_NUM_RECTS(tmpRegion); if (num_clips > 0) { - rdpup_begin_update(); - for (i = num_clips - 1; i >= 0; i--) + if (dirty_type != 0) { - box = REGION_RECTS(tmpRegion)[i]; - rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); + draw_item_add_img_region(pDirtyPriv, tmpRegion, dirty_type); + } + else if (got_id) + { + rdpup_begin_update(); + for (i = num_clips - 1; i >= 0; i--) + { + box = REGION_RECTS(tmpRegion)[i]; + rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); + } + rdpup_end_update(); } - rdpup_end_update(); } RegionDestroy(tmpRegion); } @@ -157,18 +186,28 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs) num_clips = REGION_NUM_RECTS(tmpRegion); if (num_clips > 0) { - rdpup_begin_update(); - for (i = num_clips - 1; i >= 0; i--) + if (dirty_type != 0) + { + draw_item_add_img_region(pDirtyPriv, tmpRegion, dirty_type); + } + else if (got_id) { - box = REGION_RECTS(tmpRegion)[i]; - rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); + rdpup_begin_update(); + for (i = num_clips - 1; i >= 0; i--) + { + box = REGION_RECTS(tmpRegion)[i]; + rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); + } + rdpup_end_update(); } - rdpup_end_update(); } RegionDestroy(tmpRegion); } } RegionUninit(&clip_reg); g_free(rects); - rdpup_switch_os_surface(-1); + if (reset_surface) + { + rdpup_switch_os_surface(-1); + } } |