X11rdp: fix drawing issues, turn on screen delay remoting

ulab-next
Jay Sorg 11 years ago
parent 25ee064340
commit 9357addde5

@ -258,7 +258,7 @@ struct _rdpPixmapRec
int rdpindex;
int con_number;
int is_dirty;
int pad0;
int is_scratch;
int kind_width;
struct rdp_draw_item* draw_item_head;
struct rdp_draw_item* draw_item_tail;

@ -375,7 +375,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
WindowPtr pDstWnd;
WindowPtr pSrcWnd;
LLOGLN(10, ("rdpCopyArea:"));
LLOGLN(10, ("rdpCopyArea: x %d y %d w %d h %d", dstx, dsty, w, h));
if (pSrc->type == DRAWABLE_WINDOW)
{
@ -416,6 +416,10 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
srcx, srcy, w, h, dstx, dsty);
}
}
else
{
LLOGLN(10, ("rdpCopyArea: 1"));
}
}
}
}
@ -456,8 +460,16 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
dstx, dsty);
}
}
else
{
LLOGLN(10, ("rdpCopyArea: 4"));
}
}
}
else
{
LLOGLN(10, ("rdpCopyArea: 2"));
}
}
/* do original call */
@ -493,6 +505,10 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
got_id = 1;
}
}
else
{
LLOGLN(10, ("rdpCopyArea: 3"));
}
}
else
{
@ -506,7 +522,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
if (g_do_dirty_ons)
{
LLOGLN(0, ("rdpCopyArea: gettig dirty"));
LLOGLN(10, ("rdpCopyArea: gettig dirty"));
g_screenPriv.is_dirty = 1;
pDirtyPriv = &g_screenPriv;
dirty_type = RDI_IMGLL;

@ -132,7 +132,7 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
if (g_do_dirty_ons)
{
LLOGLN(0, ("rdpImageText16: gettig dirty"));
LLOGLN(10, ("rdpImageText16: gettig dirty"));
g_screenPriv.is_dirty = 1;
pDirtyPriv = &g_screenPriv;
dirty_type = RDI_IMGLL;

@ -98,8 +98,25 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
{
pDstPixmap = (PixmapPtr)pDrawable;
pDstPriv = GETPIXPRIV(pDstPixmap);
if (pDstPixmap->devPrivate.ptr == g_rdpScreen.pfbMemory)
{
/* treat like root window */
post_process = 1;
if (xrdp_is_os(pDstPixmap, pDstPriv))
if (g_do_dirty_ons)
{
LLOGLN(10, ("rdpPolyFillRect: gettig dirty"));
g_screenPriv.is_dirty = 1;
pDirtyPriv = &g_screenPriv;
dirty_type = RDI_IMGLL;
}
else
{
rdpup_get_screen_image_rect(&id);
got_id = 1;
}
}
else if (xrdp_is_os(pDstPixmap, pDstPriv))
{
post_process = 1;
@ -131,7 +148,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
if (g_do_dirty_ons)
{
LLOGLN(0, ("rdpPolyFillRect: gettig dirty"));
LLOGLN(10, ("rdpPolyFillRect: gettig dirty"));
g_screenPriv.is_dirty = 1;
pDirtyPriv = &g_screenPriv;
dirty_type = RDI_IMGLL;
@ -148,12 +165,14 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
if (!post_process)
{
RegionDestroy(fill_reg);
LLOGLN(10, ("rdpPolyFillRect: out, post_process not set"));
return;
}
RegionTranslate(fill_reg, pDrawable->x, pDrawable->y);
RegionInit(&clip_reg, NullBox, 0);
cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
LLOGLN(10, ("rdpPolyFillRect: cd %d", cd));
if (cd == 1) /* no clip */
{
@ -166,7 +185,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
pGC->alu == GXnoop ||
pGC->alu == GXand ||
pGC->alu == GXcopy /*||
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
{
draw_item_add_fill_region(pDirtyPriv, fill_reg, pGC->fgPixel,
pGC->alu);
@ -187,7 +206,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
pGC->alu == GXnoop ||
pGC->alu == GXand ||
pGC->alu == GXcopy /*||
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
{
rdpup_set_fgcolor(pGC->fgPixel);
rdpup_set_opcode(pGC->alu);
@ -229,13 +248,15 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
pGC->alu == GXnoop ||
pGC->alu == GXand ||
pGC->alu == GXcopy /*||
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
{
LLOGLN(10, ("rdpPolyFillRect: 3"));
draw_item_add_fill_region(pDirtyPriv, &clip_reg, pGC->fgPixel,
pGC->alu);
}
else
{
LLOGLN(10, ("rdpPolyFillRect: 4"));
draw_item_add_img_region(pDirtyPriv, &clip_reg, GXcopy, RDI_IMGLL, 2);
}
}
@ -243,6 +264,8 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
{
rdpup_begin_update();
LLOGLN(10, ("2 %x", pGC->fgPixel));
if (pGC->fillStyle == 0 && /* solid fill */
(pGC->alu == GXclear ||
pGC->alu == GXset ||
@ -250,7 +273,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
pGC->alu == GXnoop ||
pGC->alu == GXand ||
pGC->alu == GXcopy /*||
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
{
rdpup_set_fgcolor(pGC->fgPixel);
rdpup_set_opcode(pGC->alu);

@ -144,7 +144,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
if (g_do_dirty_ons)
{
LLOGLN(0, ("rdpPolyRectangle: gettig dirty"));
LLOGLN(10, ("rdpPolyRectangle: gettig dirty"));
g_screenPriv.is_dirty = 1;
pDirtyPriv = &g_screenPriv;
dirty_type = RDI_IMGLL;

@ -141,7 +141,7 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs)
if (g_do_dirty_ons)
{
LLOGLN(0, ("rdpPolySegment: gettig dirty"));
LLOGLN(10, ("rdpPolySegment: gettig dirty"));
g_screenPriv.is_dirty = 1;
pDirtyPriv = &g_screenPriv;
dirty_type = RDI_IMGLL;

@ -192,7 +192,7 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
if (g_do_dirty_ons)
{
LLOGLN(0, ("rdpPolylines: gettig dirty"));
LLOGLN(10, ("rdpPolylines: gettig dirty"));
g_screenPriv.is_dirty = 1;
pDirtyPriv = &g_screenPriv;
dirty_type = RDI_IMGLL;

@ -83,6 +83,8 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
LLOGLN(10, ("rdpPutImage:"));
LLOGLN(10, ("rdpPutImage: drawable id 0x%x", (int)(pDst->id)));
LLOGLN(10, ("rdpPutImage: x %d y %d w %d h %d is_window %d", x, y, w, h,
pDst->type == DRAWABLE_WINDOW));
/* do original call */
rdpPutImageOrg(pDst, pGC, depth, x, y, w, h, leftPad, format, pBits);
@ -130,7 +132,7 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
if (g_do_dirty_ons)
{
LLOGLN(0, ("rdpPutImage: gettig dirty"));
LLOGLN(10, ("rdpPutImage: gettig dirty"));
g_screenPriv.is_dirty = 1;
pDirtyPriv = &g_screenPriv;
dirty_type = RDI_IMGLL;

@ -714,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;
}
@ -764,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);
@ -1018,6 +1023,7 @@ void
rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
{
RegionRec reg;
RegionRec reg1;
RegionRec clip;
int dx;
int dy;
@ -1032,8 +1038,6 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
LLOGLN(10, ("in rdpCopyWindow"));
RegionInit(&reg, NullBox, 0);
RegionCopy(&reg, 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;
@ -1041,78 +1045,76 @@ 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(&reg);
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(&reg);
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(&reg);
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(&reg);
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
to right we are ok */
if (dy < 0 || (dy == 0 && dx < 0))
/* 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))
{
for (j = 0; j < num_clip_rects; j++)
{
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);
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);
}
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
}
else
{
for (j = num_clip_rects - 1; j >= 0; j--)
{
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);
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);
}
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);
}
}
}
rdpup_reset_clip();
rdpup_end_update();
}
rdpup_reset_clip();
rdpup_end_update();
RegionUninit(&reg);
RegionUninit(&clip);
g_pScreen->CopyWindow = g_rdpScreen.CopyWindow;
g_pScreen->CopyWindow(pWin, ptOldOrg, pOldRegion);
g_pScreen->CopyWindow = rdpCopyWindow;
}
@ -1351,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;

@ -46,7 +46,7 @@ DeviceIntPtr g_keyboard = 0;
int g_can_do_pix_to_pix = 0;
int g_do_dirty_os = 1; /* delay remoting off screen bitmaps */
int g_do_dirty_ons = 0; /* delay remoting screen */
int g_do_dirty_ons = 1; /* delay remoting screen */
Bool g_wrapWindow = 1;
Bool g_wrapPixmap = 1;

@ -970,7 +970,7 @@ rdpup_check(void)
int
rdpup_begin_update(void)
{
LLOGLN(10, ("rdpup_begin_update"));
LLOGLN(10, ("rdpup_begin_update:"));
if (g_connected)
{
@ -978,7 +978,6 @@ rdpup_begin_update(void)
{
return 0;
}
init_stream(g_out_s, 0);
s_push_layer(g_out_s, iso_hdr, 8);
out_uint16_le(g_out_s, 1); /* begin update */
@ -1001,6 +1000,7 @@ rdpup_end_update(void)
{
if (g_do_dirty_ons)
{
/* in this mode, end update is only called in check dirty */
rdpup_send_pending();
}
else
@ -1869,7 +1869,7 @@ rdpup_check_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec *pDirtyPriv)
g_os_bitmaps[pDirtyPriv->rdpindex].stamp = g_os_bitmap_stamp;
g_os_bitmap_stamp++;
LLOGLN(10, ("-----------------got dirty"));
LLOGLN(10, ("rdpup_check_dirty: got dirty"));
rdpup_switch_os_surface(pDirtyPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDirtyPixmap, &id);
rdpup_begin_update();
@ -1995,7 +1995,7 @@ rdpup_check_dirty_screen(rdpPixmapRec *pDirtyPriv)
return 0;
}
LLOGLN(10, ("-----------------got dirty"));
LLOGLN(10, ("rdpup_check_dirty_screen: got dirty"));
rdpup_get_screen_image_rect(&id);
rdpup_begin_update();
draw_item_pack(0, pDirtyPriv);

Loading…
Cancel
Save