diff options
Diffstat (limited to 'xorg/X11R7.6/rdp/rdpdraw.c')
-rw-r--r-- | xorg/X11R7.6/rdp/rdpdraw.c | 99 |
1 files changed, 74 insertions, 25 deletions
diff --git a/xorg/X11R7.6/rdp/rdpdraw.c b/xorg/X11R7.6/rdp/rdpdraw.c index 839854af..4b900f4e 100644 --- a/xorg/X11R7.6/rdp/rdpdraw.c +++ b/xorg/X11R7.6/rdp/rdpdraw.c @@ -583,13 +583,35 @@ draw_item_pack(PixmapPtr pix, rdpPixmapRec *priv) return 0; } +static char g_strings[][32] = +{ + "Composite", /* 0 */ + "CopyArea", /* 1 */ + "PolyFillRect", /* 2 */ + "PutImage", /* 3 */ + "PolyRectangle", /* 4 */ + "CopyPlane", /* 5 */ + "PolyArc", /* 6 */ + "FillPolygon", /* 7 */ + "PolyFillArc", /* 8 */ + "ImageText8", /* 9 */ + "PolyText8", /* 10 */ + "PolyText16", /* 11 */ + "ImageText16", /* 12 */ + "ImageGlyphBlt", /* 13 */ + "PolyGlyphBlt", /* 14 */ + "PushPixels", /* 15 */ + "Other" +}; + /******************************************************************************/ int draw_item_add_img_region(rdpPixmapRec *priv, RegionPtr reg, int opcode, - int type) + int type, int code) { struct rdp_draw_item *di; + LLOGLN(10, ("draw_item_add_img_region: %s", g_strings[code])); di = (struct rdp_draw_item *)g_malloc(sizeof(struct rdp_draw_item), 1); di->type = type; di->reg = RegionCreate(NullBox, 0); @@ -606,6 +628,7 @@ draw_item_add_fill_region(rdpPixmapRec *priv, RegionPtr reg, int color, { struct rdp_draw_item *di; + LLOGLN(10, ("draw_item_add_fill_region:")); di = (struct rdp_draw_item *)g_malloc(sizeof(struct rdp_draw_item), 1); di->type = RDI_FILL; di->u.fill.fg_color = color; @@ -691,6 +714,10 @@ rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, priv->kind_width = width; pScreen->ModifyPixmapHeader(rv, org_width, 0, 0, 0, 0, 0); pScreen->CreatePixmap = rdpCreatePixmap; + if (org_width == 0 && height == 0) + { + priv->is_scratch = 1; + } return rv; } @@ -741,7 +768,8 @@ xrdp_is_os(PixmapPtr pix, rdpPixmapPtr priv) height = pix->drawable.height; if ((pix->usage_hint == 0) && (pix->drawable.depth >= g_rdpScreen.depth) && - (width > 1) && (height > 1) && (priv->kind_width > 0)) + (width > 0) && (height > 0) && (priv->kind_width > 0) && + (priv->is_scratch == 0)) { LLOGLN(10, ("%d %d", priv->kind_width, pix->drawable.width)); priv->rdpindex = rdpup_add_os_bitmap(pix, priv); @@ -760,7 +788,7 @@ xrdp_is_os(PixmapPtr pix, rdpPixmapPtr priv) { draw_item_remove_all(priv); RegionInit(®1, &box, 0); - draw_item_add_img_region(priv, ®1, GXcopy, RDI_IMGLL); + draw_item_add_img_region(priv, ®1, GXcopy, RDI_IMGLL, 16); RegionUninit(®1); priv->is_dirty = 1; priv->con_number = g_con_number; @@ -995,6 +1023,7 @@ void rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) { RegionRec reg; + RegionRec reg1; RegionRec clip; int dx; int dy; @@ -1004,12 +1033,11 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) int num_reg_rects; BoxRec box1; BoxRec box2; + BoxPtr box3; LLOGLN(10, ("in rdpCopyWindow")); RegionInit(®, NullBox, 0); RegionCopy(®, pOldRegion); - g_pScreen->CopyWindow = g_rdpScreen.CopyWindow; - g_pScreen->CopyWindow(pWin, ptOldOrg, pOldRegion); RegionInit(&clip, NullBox, 0); RegionCopy(&clip, &pWin->borderClip); dx = pWin->drawable.x - ptOldOrg.x; @@ -1017,30 +1045,45 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) if (g_do_dirty_ons) { - LLOGLN(0, ("rdpCopyWindow: gettig dirty TODO")); - //draw_item_add_srcblt_region + rdpup_check_dirty_screen(&g_screenPriv); + } + rdpup_begin_update(); + num_clip_rects = REGION_NUM_RECTS(&clip); + num_reg_rects = REGION_NUM_RECTS(®); + LLOGLN(10, ("rdpCopyWindow: num_clip_rects %d num_reg_rects %d", + num_clip_rects, num_reg_rects)); + + /* when there is a huge list of screen copies, just send as bitmap + firefox dragging test does this */ + if ((num_clip_rects > 16) && (num_reg_rects > 16)) + { + box3 = RegionExtents(®); + rdpup_send_area(0, box3->x1, box3->y1, + box3->x2 - box3->x1, + box3->y2 - box3->y1); } else { - rdpup_begin_update(); - num_clip_rects = REGION_NUM_RECTS(&clip); - num_reg_rects = REGION_NUM_RECTS(®); /* should maybe sort the rects instead of checking dy < 0 */ /* If we can depend on the rects going from top to bottom, left - to right we are ok */ + to right we are ok */ if (dy < 0 || (dy == 0 && dx < 0)) { for (j = 0; j < num_clip_rects; j++) { box1 = REGION_RECTS(&clip)[j]; - rdpup_set_clip(box1.x1, box1.y1, box1.x2 - box1.x1, box1.y2 - box1.y1); + rdpup_set_clip(box1.x1, box1.y1, + box1.x2 - box1.x1, + box1.y2 - box1.y1); for (i = 0; i < num_reg_rects; i++) { box2 = REGION_RECTS(®)[i]; - rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy, box2.x2 - box2.x1, - box2.y2 - box2.y1, box2.x1, box2.y1); + rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy, + box2.x2 - box2.x1, + box2.y2 - box2.y1, + box2.x1, box2.y1); } } } @@ -1049,23 +1092,29 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion) for (j = num_clip_rects - 1; j >= 0; j--) { box1 = REGION_RECTS(&clip)[j]; - rdpup_set_clip(box1.x1, box1.y1, box1.x2 - box1.x1, box1.y2 - box1.y1); + rdpup_set_clip(box1.x1, box1.y1, + box1.x2 - box1.x1, + box1.y2 - box1.y1); for (i = num_reg_rects - 1; i >= 0; i--) { box2 = REGION_RECTS(®)[i]; - rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy, box2.x2 - box2.x1, - box2.y2 - box2.y1, box2.x1, box2.y1); + rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy, + box2.x2 - box2.x1, + box2.y2 - box2.y1, + box2.x1, box2.y1); } } } - - rdpup_reset_clip(); - rdpup_end_update(); } + rdpup_reset_clip(); + rdpup_end_update(); + RegionUninit(®); RegionUninit(&clip); + g_pScreen->CopyWindow = g_rdpScreen.CopyWindow; + g_pScreen->CopyWindow(pWin, ptOldOrg, pOldRegion); g_pScreen->CopyWindow = rdpCopyWindow; } @@ -1104,7 +1153,7 @@ rdpClearToBackground(WindowPtr pWin, int x, int y, int w, int h, if (g_do_dirty_ons) { - draw_item_add_img_region(&g_screenPriv, ®, GXcopy, RDI_IMGLL); + draw_item_add_img_region(&g_screenPriv, ®, GXcopy, RDI_IMGLL, 16); } else { @@ -1142,7 +1191,7 @@ rdpRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed) if (g_do_dirty_ons) { - draw_item_add_img_region(&g_screenPriv, ®, GXcopy, RDI_IMGLL); + draw_item_add_img_region(&g_screenPriv, ®, GXcopy, RDI_IMGLL, 16); } else { @@ -1304,7 +1353,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, if (g_do_dirty_ons) { - LLOGLN(0, ("rdpComposite: gettig dirty")); + LLOGLN(10, ("rdpComposite: gettig dirty")); g_screenPriv.is_dirty = 1; pDirtyPriv = &g_screenPriv; dirty_type = RDI_IMGLL; @@ -1337,7 +1386,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, if (dirty_type != 0) { - draw_item_add_img_region(pDirtyPriv, ®1, GXcopy, dirty_type); + draw_item_add_img_region(pDirtyPriv, ®1, GXcopy, dirty_type, 0); } else if (got_id) { @@ -1370,7 +1419,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, if (dirty_type != 0) { RegionInit(®1, &box, 0); - draw_item_add_img_region(pDirtyPriv, ®1, GXcopy, dirty_type); + draw_item_add_img_region(pDirtyPriv, ®1, GXcopy, dirty_type, 0); RegionUninit(®1); } else if (got_id) |