X11rdp: fix for dragging text in Firefox, more logging

ulab-next
Jay Sorg 11 years ago
parent 48aa165729
commit af4dbdc75a

@ -341,7 +341,7 @@ int
draw_item_pack(PixmapPtr pix, rdpPixmapRec* priv);
int
draw_item_add_img_region(rdpPixmapRec* priv, RegionPtr reg, int opcode,
int type);
int type, int code);
int
draw_item_add_fill_region(rdpPixmapRec* priv, RegionPtr reg, int color,
int opcode);

@ -537,7 +537,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
RegionInit(&reg1, &box, 0);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type, 1);
RegionUninit(&reg1);
}
else if (got_id)
@ -561,7 +561,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
box.y2 = box.y1 + h;
RegionInit(&box_reg, &box, 0);
RegionIntersect(&clip_reg, &clip_reg, &box_reg);
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, dirty_type, 1);
RegionUninit(&box_reg);
}
else if (got_id)

@ -168,7 +168,7 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
RegionInit(&reg1, &box, 0);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type, 5);
RegionUninit(&reg1);
}
else if (got_id)
@ -194,7 +194,7 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
RegionInit(&reg2, NullBox, 0);
RegionCopy(&reg2, &clip_reg);
RegionIntersect(&reg1, &reg1, &reg2);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type, 5);
RegionUninit(&reg1);
RegionUninit(&reg2);
}

@ -203,7 +203,7 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
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, 7);
RegionUninit(&reg1);
}
else if (got_id)
@ -223,7 +223,7 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, dirty_type, 7);
}
else if (got_id)
{

@ -169,7 +169,7 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
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, 13);
RegionUninit(&reg1);
}
else if (got_id)
@ -189,7 +189,7 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type, 13);
}
else if (got_id)
{

@ -167,7 +167,7 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
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, 12);
RegionUninit(&reg1);
}
else if (got_id)
@ -187,7 +187,7 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type, 12);
}
else if (got_id)
{

@ -167,7 +167,7 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
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, 9);
RegionUninit(&reg1);
}
else if (got_id)
@ -187,7 +187,7 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type, 9);
}
else if (got_id)
{

@ -185,7 +185,7 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, tmpRegion, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, tmpRegion, GXcopy, dirty_type, 6);
}
else if (got_id)
{
@ -217,7 +217,7 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, tmpRegion, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, tmpRegion, GXcopy, dirty_type, 6);
}
else if (got_id)
{

@ -185,7 +185,7 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, tmpRegion, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, tmpRegion, GXcopy, dirty_type, 8);
}
else if (got_id)
{
@ -217,7 +217,7 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs)
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, tmpRegion, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, tmpRegion, GXcopy, dirty_type, 8);
}
else if (got_id)
{

@ -173,7 +173,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
}
else
{
draw_item_add_img_region(pDirtyPriv, fill_reg, GXcopy, RDI_IMGLL);
draw_item_add_img_region(pDirtyPriv, fill_reg, GXcopy, RDI_IMGLL, 2);
}
}
else if (got_id)
@ -236,7 +236,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
}
else
{
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, RDI_IMGLL);
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, RDI_IMGLL, 2);
}
}
else if (got_id)

@ -169,7 +169,7 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
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, 14);
RegionUninit(&reg1);
}
else if (got_id)
@ -189,7 +189,7 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type, 14);
}
else if (got_id)
{

@ -221,7 +221,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
}
else
{
draw_item_add_img_region(pDirtyPriv, fill_reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, fill_reg, GXcopy, dirty_type, 4);
}
RegionDestroy(fill_reg);
@ -275,7 +275,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
}
else
{
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, dirty_type, 4);
}
}
else if (got_id)

@ -170,7 +170,7 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
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, 11);
RegionUninit(&reg1);
}
else if (got_id)
@ -190,7 +190,7 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type, 11);
}
else if (got_id)
{

@ -170,7 +170,7 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
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, 10);
RegionUninit(&reg1);
}
else if (got_id)
@ -190,7 +190,7 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
{
if (dirty_type != 0)
{
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg, GXcopy, dirty_type, 10);
}
else if (got_id)
{

@ -160,7 +160,7 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
RegionInit(&reg1, &box, 0);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type, 15);
RegionUninit(&reg1);
}
else if (got_id)
@ -185,7 +185,7 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
if (dirty_type != 0)
{
RegionInit(&reg1, &box, 0);
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, dirty_type, 15);
RegionUninit(&reg1);
}
else if (got_id)

@ -161,7 +161,7 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
box.x2 = box.x1 + w;
box.y2 = box.y1 + h;
RegionInit(&reg1, &box, 0);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type, 3);
RegionUninit(&reg1);
}
else if (got_id)
@ -183,7 +183,7 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
RegionInit(&reg2, NullBox, 0);
RegionCopy(&reg2, &clip_reg);
RegionIntersect(&reg1, &reg1, &reg2);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type);
draw_item_add_img_region(pDirtyPriv, &reg1, GXcopy, dirty_type, 3);
RegionUninit(&reg1);
RegionUninit(&reg2);
}

@ -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)

@ -1059,7 +1059,8 @@ rdpup_screen_blt(short x, short y, int cx, int cy, short srcx, short srcy)
{
if (g_connected)
{
LLOGLN(10, (" rdpup_screen_blt"));
LLOGLN(10, (" rdpup_screen_blt x %d y %d cx %d cy %d srcx %d srcy %d",
x, y, cx, cy, srcx, srcy));
rdpup_pre_check(16);
out_uint16_le(g_out_s, 4); /* screen blt */
out_uint16_le(g_out_s, 16); /* size */

Loading…
Cancel
Save