summaryrefslogtreecommitdiffstats
path: root/xorg/X11R7.6/rdp/rdpdraw.c
diff options
context:
space:
mode:
authorLawrenceK <github@lklyne.co.uk>2012-10-18 10:45:35 +0100
committerLawrenceK <github@lklyne.co.uk>2012-10-18 10:45:35 +0100
commit9530caa4ffec46bdc7d24c873272d2ba4e85e32b (patch)
treeb4d17c4f1fe0f50ce6d56f4b69e4a901f79136a2 /xorg/X11R7.6/rdp/rdpdraw.c
parent69389e4a63e955151c14110f54bf6c8aa9496f33 (diff)
parent6504737b11ae763f9aa06fa55856440b1c86ef44 (diff)
downloadxrdp-proprietary-9530caa4ffec46bdc7d24c873272d2ba4e85e32b.tar.gz
xrdp-proprietary-9530caa4ffec46bdc7d24c873272d2ba4e85e32b.zip
Merge branch 'master' of git://github.com/FreeRDP/xrdp
Diffstat (limited to 'xorg/X11R7.6/rdp/rdpdraw.c')
-rw-r--r--xorg/X11R7.6/rdp/rdpdraw.c141
1 files changed, 101 insertions, 40 deletions
diff --git a/xorg/X11R7.6/rdp/rdpdraw.c b/xorg/X11R7.6/rdp/rdpdraw.c
index 78b2aa3d..95cdd487 100644
--- a/xorg/X11R7.6/rdp/rdpdraw.c
+++ b/xorg/X11R7.6/rdp/rdpdraw.c
@@ -62,6 +62,8 @@ extern Bool g_wrapPixmap; /* from rdpmain.c */
extern WindowPtr g_invalidate_window; /* 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_ons; /* in rdpmain.c */
+extern rdpPixmapRec g_screenPriv; /* in rdpmain.c */
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 = di;
}
+ if (priv == &g_screenPriv)
+ {
+ rdpScheduleDeferredUpdate();
+ }
return 0;
}
@@ -600,6 +606,29 @@ draw_item_add_line_region(rdpPixmapRec* priv, RegionPtr reg, int color,
}
/******************************************************************************/
+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
rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint)
@@ -876,42 +905,50 @@ rdpCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr pOldRegion)
RegionCopy(&clip, &pWin->borderClip);
dx = pWin->drawable.x - ptOldOrg.x;
dy = pWin->drawable.y - ptOldOrg.y;
- rdpup_begin_update();
- num_clip_rects = REGION_NUM_RECTS(&clip);
- num_reg_rects = REGION_NUM_RECTS(&reg);
- /* 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))
+ if (g_do_dirty_ons)
{
- 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(&reg);
+ /* 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 (i = 0; i < num_reg_rects; i++)
+ for (j = 0; j < num_clip_rects; 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 = 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--)
+ else
{
- 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 (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);
+ }
}
}
+ rdpup_reset_clip();
+ rdpup_end_update();
}
- rdpup_reset_clip();
- rdpup_end_update();
RegionUninit(&reg);
RegionUninit(&clip);
g_pScreen->CopyWindow = rdpCopyWindow;
@@ -947,13 +984,20 @@ rdpClearToBackground(WindowPtr pWin, int x, int y, int w, int h,
}
RegionInit(&reg, &box, 0);
RegionIntersect(&reg, &reg, &pWin->clipList);
- rdpup_begin_update();
- for (j = REGION_NUM_RECTS(&reg) - 1; j >= 0; j--)
+ if (g_do_dirty_ons)
{
- box = REGION_RECTS(&reg)[j];
- rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
+ draw_item_add_img_region(&g_screenPriv, &reg, GXcopy, RDI_IMGLL);
+ }
+ else
+ {
+ rdpup_begin_update();
+ for (j = REGION_NUM_RECTS(&reg) - 1; j >= 0; j--)
+ {
+ box = REGION_RECTS(&reg)[j];
+ rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
+ }
+ rdpup_end_update();
}
- rdpup_end_update();
RegionUninit(&reg);
}
g_pScreen->ClearToBackground = rdpClearToBackground;
@@ -968,18 +1012,25 @@ rdpRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed)
int j;
BoxRec box;
- LLOGLN(10, ("in rdpRestoreAreas"));
+ LLOGLN(0, ("in rdpRestoreAreas"));
RegionInit(&reg, NullBox, 0);
RegionCopy(&reg, prgnExposed);
g_pScreen->RestoreAreas = g_rdpScreen.RestoreAreas;
rv = g_pScreen->RestoreAreas(pWin, prgnExposed);
- rdpup_begin_update();
- for (j = REGION_NUM_RECTS(&reg) - 1; j >= 0; j--)
+ if (g_do_dirty_ons)
{
- box = REGION_RECTS(&reg)[j];
- rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
+ draw_item_add_img_region(&g_screenPriv, &reg, GXcopy, RDI_IMGLL);
+ }
+ else
+ {
+ rdpup_begin_update();
+ for (j = REGION_NUM_RECTS(&reg) - 1; j >= 0; j--)
+ {
+ box = REGION_RECTS(&reg)[j];
+ rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
+ }
+ rdpup_end_update();
}
- rdpup_end_update();
RegionUninit(&reg);
g_pScreen->RestoreAreas = rdpRestoreAreas;
return rv;
@@ -1118,9 +1169,19 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
if (pDstWnd->viewable)
{
post_process = 1;
- rdpup_get_screen_image_rect(&id);
- got_id = 1;
- LLOGLN(10, ("rdpComposite: screen"));
+ if (g_do_dirty_ons)
+ {
+ 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"));
+ }
}
}
}