summaryrefslogtreecommitdiffstats
path: root/xorg/X11R7.6/rdp/rdpdraw.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg/X11R7.6/rdp/rdpdraw.c')
-rw-r--r--xorg/X11R7.6/rdp/rdpdraw.c105
1 files changed, 76 insertions, 29 deletions
diff --git a/xorg/X11R7.6/rdp/rdpdraw.c b/xorg/X11R7.6/rdp/rdpdraw.c
index 839854af..1d071a8a 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;
@@ -760,7 +783,7 @@ xrdp_is_os(PixmapPtr pix, rdpPixmapPtr priv)
{
draw_item_remove_all(priv);
RegionInit(&reg1, &box, 0);
- draw_item_add_img_region(priv, &reg1, GXcopy, RDI_IMGLL);
+ draw_item_add_img_region(priv, &reg1, GXcopy, RDI_IMGLL, 16);
RegionUninit(&reg1);
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(&reg, NullBox, 0);
@@ -1025,37 +1049,60 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
rdpup_begin_update();
num_clip_rects = REGION_NUM_RECTS(&clip);
num_reg_rects = REGION_NUM_RECTS(&reg);
+ LLOGLN(10, ("rdpCopyWindow: num_clip_rects %d num_reg_rects %d",
+ num_clip_rects, num_reg_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 */
- if (dy < 0 || (dy == 0 && dx < 0))
+ /* 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))
{
- 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);
-
- for (i = 0; i < num_reg_rects; i++)
- {
- box2 = REGION_RECTS(&reg)[i];
- rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy, box2.x2 - box2.x1,
- box2.y2 - box2.y1, box2.x1, box2.y1);
- }
- }
+ box3 = RegionExtents(&reg);
+ rdpup_send_area(0, box3->x1, box3->y1,
+ box3->x2 - box3->x1,
+ box3->y2 - box3->y1);
}
else
{
- for (j = num_clip_rects - 1; j >= 0; j--)
+
+ /* 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 */
+ if (dy < 0 || (dy == 0 && dx < 0))
{
- box1 = REGION_RECTS(&clip)[j];
- rdpup_set_clip(box1.x1, box1.y1, box1.x2 - box1.x1, box1.y2 - box1.y1);
+ 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);
- for (i = num_reg_rects - 1; i >= 0; i--)
+ for (i = 0; i < num_reg_rects; i++)
+ {
+ box2 = REGION_RECTS(&reg)[i];
+ rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy,
+ box2.x2 - box2.x1,
+ box2.y2 - box2.y1,
+ box2.x1, box2.y1);
+ }
+ }
+ }
+ else
+ {
+ for (j = num_clip_rects - 1; j >= 0; j--)
{
- box2 = REGION_RECTS(&reg)[i];
- rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy, box2.x2 - box2.x1,
- box2.y2 - box2.y1, box2.x1, box2.y1);
+ box1 = REGION_RECTS(&clip)[j];
+ 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(&reg)[i];
+ 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, &reg, GXcopy, RDI_IMGLL);
+ draw_item_add_img_region(&g_screenPriv, &reg, 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, &reg, GXcopy, RDI_IMGLL);
+ draw_item_add_img_region(&g_screenPriv, &reg, 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, &reg1, GXcopy, dirty_type);
+ draw_item_add_img_region(pDirtyPriv, &reg1, 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(&reg1, &box, 0);
- draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type);
+ draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type, 0);
RegionUninit(&reg1);
}
else if (got_id)