|
|
@ -62,6 +62,8 @@ extern Bool g_wrapPixmap; /* from rdpmain.c */
|
|
|
|
extern WindowPtr g_invalidate_window; /* in rdpmain.c */
|
|
|
|
extern WindowPtr g_invalidate_window; /* in rdpmain.c */
|
|
|
|
extern int g_use_rail; /* in rdpmain.c */
|
|
|
|
extern int g_use_rail; /* in rdpmain.c */
|
|
|
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
|
|
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
|
|
|
|
|
|
|
extern int g_do_dirty_ons; /* in rdpmain.c */
|
|
|
|
|
|
|
|
extern rdpPixmapRec g_screenPriv; /* in rdpmain.c */
|
|
|
|
|
|
|
|
|
|
|
|
ColormapPtr g_rdpInstalledColormap;
|
|
|
|
ColormapPtr g_rdpInstalledColormap;
|
|
|
|
|
|
|
|
|
|
|
@ -397,6 +399,10 @@ draw_item_add(rdpPixmapRec* priv, struct rdp_draw_item* di)
|
|
|
|
priv->draw_item_tail->next = di;
|
|
|
|
priv->draw_item_tail->next = di;
|
|
|
|
priv->draw_item_tail = di;
|
|
|
|
priv->draw_item_tail = di;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (priv == &g_screenPriv)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rdpScheduleDeferredUpdate();
|
|
|
|
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -599,6 +605,29 @@ draw_item_add_line_region(rdpPixmapRec* priv, RegionPtr reg, int color,
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
int
|
|
|
|
|
|
|
|
draw_item_add_srcblt_region(rdpPixmapRec* priv, RegionPtr reg,
|
|
|
|
|
|
|
|
int srcx, int srcy, int dstx, int dsty,
|
|
|
|
|
|
|
|
int cx, int cy)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
struct rdp_draw_item* di;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LLOGLN(10, ("draw_item_add_srcblt_region:"));
|
|
|
|
|
|
|
|
di = (struct rdp_draw_item*)g_malloc(sizeof(struct rdp_draw_item), 1);
|
|
|
|
|
|
|
|
di->type = RDI_SCRBLT;
|
|
|
|
|
|
|
|
di->u.scrblt.srcx = srcx;
|
|
|
|
|
|
|
|
di->u.scrblt.srcy = srcy;
|
|
|
|
|
|
|
|
di->u.scrblt.dstx = dstx;
|
|
|
|
|
|
|
|
di->u.scrblt.dsty = dsty;
|
|
|
|
|
|
|
|
di->u.scrblt.cx = cx;
|
|
|
|
|
|
|
|
di->u.scrblt.cy = cy;
|
|
|
|
|
|
|
|
di->reg = RegionCreate(NullBox, 0);
|
|
|
|
|
|
|
|
RegionCopy(di->reg, reg);
|
|
|
|
|
|
|
|
draw_item_add(priv, di);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
PixmapPtr
|
|
|
|
PixmapPtr
|
|
|
|
rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
|
|
|
rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
|
|
@ -876,42 +905,50 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
|
|
|
|
RegionCopy(&clip, &pWin->borderClip);
|
|
|
|
RegionCopy(&clip, &pWin->borderClip);
|
|
|
|
dx = pWin->drawable.x - ptOldOrg.x;
|
|
|
|
dx = pWin->drawable.x - ptOldOrg.x;
|
|
|
|
dy = pWin->drawable.y - ptOldOrg.y;
|
|
|
|
dy = pWin->drawable.y - ptOldOrg.y;
|
|
|
|
rdpup_begin_update();
|
|
|
|
if (g_do_dirty_ons)
|
|
|
|
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 */
|
|
|
|
|
|
|
|
if (dy < 0 || (dy == 0 && dx < 0))
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (j = 0; j < num_clip_rects; j++)
|
|
|
|
LLOGLN(0, ("rdpCopyWindow: gettig dirty TODO"));
|
|
|
|
|
|
|
|
//draw_item_add_srcblt_region
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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 */
|
|
|
|
|
|
|
|
if (dy < 0 || (dy == 0 && dx < 0))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
box1 = REGION_RECTS(&clip)[j];
|
|
|
|
for (j = 0; j < num_clip_rects; 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(®)[i];
|
|
|
|
box1 = REGION_RECTS(&clip)[j];
|
|
|
|
rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy, box2.x2 - box2.x1,
|
|
|
|
rdpup_set_clip(box1.x1, box1.y1, box1.x2 - box1.x1, box1.y2 - box1.y1);
|
|
|
|
box2.y2 - box2.y1, box2.x1, box2.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);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
for (j = num_clip_rects - 1; j >= 0; j--)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
box1 = REGION_RECTS(&clip)[j];
|
|
|
|
for (j = num_clip_rects - 1; j >= 0; 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(®)[i];
|
|
|
|
box1 = REGION_RECTS(&clip)[j];
|
|
|
|
rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy, box2.x2 - box2.x1,
|
|
|
|
rdpup_set_clip(box1.x1, box1.y1, box1.x2 - box1.x1, box1.y2 - box1.y1);
|
|
|
|
box2.y2 - box2.y1, box2.x1, box2.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_reset_clip();
|
|
|
|
|
|
|
|
rdpup_end_update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rdpup_reset_clip();
|
|
|
|
|
|
|
|
rdpup_end_update();
|
|
|
|
|
|
|
|
RegionUninit(®);
|
|
|
|
RegionUninit(®);
|
|
|
|
RegionUninit(&clip);
|
|
|
|
RegionUninit(&clip);
|
|
|
|
g_pScreen->CopyWindow = rdpCopyWindow;
|
|
|
|
g_pScreen->CopyWindow = rdpCopyWindow;
|
|
|
@ -947,13 +984,20 @@ rdpClearToBackground(WindowPtr pWin, int x, int y, int w, int h,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
RegionInit(®, &box, 0);
|
|
|
|
RegionInit(®, &box, 0);
|
|
|
|
RegionIntersect(®, ®, &pWin->clipList);
|
|
|
|
RegionIntersect(®, ®, &pWin->clipList);
|
|
|
|
rdpup_begin_update();
|
|
|
|
if (g_do_dirty_ons)
|
|
|
|
for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
box = REGION_RECTS(®)[j];
|
|
|
|
draw_item_add_img_region(&g_screenPriv, ®, GXcopy, RDI_IMGLL);
|
|
|
|
rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rdpup_begin_update();
|
|
|
|
|
|
|
|
for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
box = REGION_RECTS(®)[j];
|
|
|
|
|
|
|
|
rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
rdpup_end_update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rdpup_end_update();
|
|
|
|
|
|
|
|
RegionUninit(®);
|
|
|
|
RegionUninit(®);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_pScreen->ClearToBackground = rdpClearToBackground;
|
|
|
|
g_pScreen->ClearToBackground = rdpClearToBackground;
|
|
|
@ -968,18 +1012,25 @@ rdpRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed)
|
|
|
|
int j;
|
|
|
|
int j;
|
|
|
|
BoxRec box;
|
|
|
|
BoxRec box;
|
|
|
|
|
|
|
|
|
|
|
|
LLOGLN(10, ("in rdpRestoreAreas"));
|
|
|
|
LLOGLN(0, ("in rdpRestoreAreas"));
|
|
|
|
RegionInit(®, NullBox, 0);
|
|
|
|
RegionInit(®, NullBox, 0);
|
|
|
|
RegionCopy(®, prgnExposed);
|
|
|
|
RegionCopy(®, prgnExposed);
|
|
|
|
g_pScreen->RestoreAreas = g_rdpScreen.RestoreAreas;
|
|
|
|
g_pScreen->RestoreAreas = g_rdpScreen.RestoreAreas;
|
|
|
|
rv = g_pScreen->RestoreAreas(pWin, prgnExposed);
|
|
|
|
rv = g_pScreen->RestoreAreas(pWin, prgnExposed);
|
|
|
|
rdpup_begin_update();
|
|
|
|
if (g_do_dirty_ons)
|
|
|
|
for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
box = REGION_RECTS(®)[j];
|
|
|
|
draw_item_add_img_region(&g_screenPriv, ®, GXcopy, RDI_IMGLL);
|
|
|
|
rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rdpup_begin_update();
|
|
|
|
|
|
|
|
for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
box = REGION_RECTS(®)[j];
|
|
|
|
|
|
|
|
rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
rdpup_end_update();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rdpup_end_update();
|
|
|
|
|
|
|
|
RegionUninit(®);
|
|
|
|
RegionUninit(®);
|
|
|
|
g_pScreen->RestoreAreas = rdpRestoreAreas;
|
|
|
|
g_pScreen->RestoreAreas = rdpRestoreAreas;
|
|
|
|
return rv;
|
|
|
|
return rv;
|
|
|
@ -1118,9 +1169,19 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|
|
|
if (pDstWnd->viewable)
|
|
|
|
if (pDstWnd->viewable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
post_process = 1;
|
|
|
|
post_process = 1;
|
|
|
|
rdpup_get_screen_image_rect(&id);
|
|
|
|
if (g_do_dirty_ons)
|
|
|
|
got_id = 1;
|
|
|
|
{
|
|
|
|
LLOGLN(10, ("rdpComposite: screen"));
|
|
|
|
LLOGLN(0, ("rdpComposite: gettig dirty"));
|
|
|
|
|
|
|
|
g_screenPriv.is_dirty = 1;
|
|
|
|
|
|
|
|
pDirtyPriv = &g_screenPriv;
|
|
|
|
|
|
|
|
dirty_type = RDI_IMGLL;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
rdpup_get_screen_image_rect(&id);
|
|
|
|
|
|
|
|
got_id = 1;
|
|
|
|
|
|
|
|
LLOGLN(10, ("rdpComposite: screen"));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|