|
|
|
@ -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;
|
|
|
|
@ -760,7 +783,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;
|
|
|
|
@ -1004,6 +1027,7 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
|
|
|
|
|
int num_reg_rects;
|
|
|
|
|
BoxRec box1;
|
|
|
|
|
BoxRec box2;
|
|
|
|
|
BoxPtr box3;
|
|
|
|
|
|
|
|
|
|
LLOGLN(10, ("in rdpCopyWindow"));
|
|
|
|
|
RegionInit(®, NullBox, 0);
|
|
|
|
@ -1025,6 +1049,20 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
|
|
|
|
|
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
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/* should maybe sort the rects instead of checking dy < 0 */
|
|
|
|
|
/* If we can depend on the rects going from top to bottom, left
|
|
|
|
@ -1034,13 +1072,17 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
|
|
|
|
|
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,13 +1091,18 @@ 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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1104,7 +1151,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 +1189,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
|
|
|
|
|
{
|
|
|
|
@ -1337,7 +1384,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 +1417,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)
|
|
|
|
|