diff options
author | Laxmikant Rashinkar <LK.Rashinkar@gmail.com> | 2012-09-19 21:18:03 -0700 |
---|---|---|
committer | Laxmikant Rashinkar <LK.Rashinkar@gmail.com> | 2012-09-19 21:18:03 -0700 |
commit | 03f47098e4989a37a4099497db8d98bdf692f371 (patch) | |
tree | 7c32a67faa27b4bea968d3f7b23540ee63df8ceb /xorg/X11R7.6/rdp | |
parent | 1123323fda6d128fb98b0427e0ea5f6a2dc9e632 (diff) | |
parent | 6504737b11ae763f9aa06fa55856440b1c86ef44 (diff) | |
download | xrdp-proprietary-03f47098e4989a37a4099497db8d98bdf692f371.tar.gz xrdp-proprietary-03f47098e4989a37a4099497db8d98bdf692f371.zip |
o fixed merge conflicts
Diffstat (limited to 'xorg/X11R7.6/rdp')
24 files changed, 885 insertions, 516 deletions
diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h index 695a2bde..572bc6f4 100644 --- a/xorg/X11R7.6/rdp/rdp.h +++ b/xorg/X11R7.6/rdp/rdp.h @@ -197,6 +197,7 @@ typedef rdpWindowRec* rdpWindowPtr; #define RDI_IMGLL 2 /* lossless */ #define RDI_IMGLY 3 /* lossy */ #define RDI_LINE 4 +#define RDI_SCRBLT 5 struct urdp_draw_item_fill { @@ -223,11 +224,22 @@ struct urdp_draw_item_line int flags; }; +struct urdp_draw_item_scrblt +{ + int srcx; + int srcy; + int dstx; + int dsty; + int cx; + int cy; +}; + union urdp_draw_item { struct urdp_draw_item_fill fill; struct urdp_draw_item_img img; struct urdp_draw_item_line line; + struct urdp_draw_item_scrblt scrblt; }; struct rdp_draw_item @@ -337,7 +349,10 @@ int draw_item_add_line_region(rdpPixmapRec* priv, RegionPtr reg, int color, int opcode, int width, xSegment* segs, int nsegs, int is_segment); - +int +draw_item_add_srcblt_region(rdpPixmapRec* priv, RegionPtr reg, + int srcx, int srcy, int dstx, int dsty, + int cx, int cy); PixmapPtr rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth, @@ -502,6 +517,11 @@ void rdpup_delete_window(WindowPtr pWindow, rdpWindowRec* priv); int rdpup_check_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec* pDirtyPriv); +int +rdpup_check_dirty_screen(rdpPixmapRec* pDirtyPriv); + +void +rdpScheduleDeferredUpdate(void); #if defined(X_BYTE_ORDER) # if X_BYTE_ORDER == X_LITTLE_ENDIAN diff --git a/xorg/X11R7.6/rdp/rdpCopyArea.c b/xorg/X11R7.6/rdp/rdpCopyArea.c index cc4d0fe4..e7657396 100644 --- a/xorg/X11R7.6/rdp/rdpCopyArea.c +++ b/xorg/X11R7.6/rdp/rdpCopyArea.c @@ -39,6 +39,8 @@ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from rdpmain.c */ extern int g_can_do_pix_to_pix; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -375,99 +377,114 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, if (pSrc->type == DRAWABLE_WINDOW) { - pSrcWnd = (WindowPtr)pSrc; + rdpup_check_dirty_screen(&g_screenPriv); - if (pSrcWnd->viewable) + if (pDst->type == DRAWABLE_WINDOW) { - if (pDst->type == DRAWABLE_WINDOW) + pDstWnd = (WindowPtr)pDst; + + if (pDstWnd->viewable) { - pDstWnd = (WindowPtr)pDst; + can_do_screen_blt = pGC->alu == GXcopy; - if (pDstWnd->viewable) + if (can_do_screen_blt) { - can_do_screen_blt = pGC->alu == GXcopy; - - if (can_do_screen_blt) - { - return rdpCopyAreaWndToWnd(pSrcWnd, pDstWnd, pGC, - srcx, srcy, w, h, dstx, dsty); - } + return rdpCopyAreaWndToWnd(pSrcWnd, pDstWnd, pGC, + srcx, srcy, w, h, dstx, dsty); } } - else if (pDst->type == DRAWABLE_PIXMAP) + } + else if (pDst->type == DRAWABLE_PIXMAP) + { + pDstPixmap = (PixmapPtr)pDst; + pDstPriv = GETPIXPRIV(pDstPixmap); + + if (XRDP_IS_OS(pDstPriv)) { - pDstPixmap = (PixmapPtr)pDst; - pDstPriv = GETPIXPRIV(pDstPixmap); + if (pDst->type == DRAWABLE_WINDOW) + { + pDstWnd = (WindowPtr)pDst; + + if (pDstWnd->viewable) + { + can_do_screen_blt = pGC->alu == GXcopy; - if (XRDP_IS_OS(pDstPriv)) + if (can_do_screen_blt) + { + return rdpCopyAreaWndToWnd(pSrcWnd, pDstWnd, pGC, + srcx, srcy, w, h, dstx, dsty); + } + } + } + else if (pDst->type == DRAWABLE_PIXMAP) { - can_do_screen_blt = pGC->alu == GXcopy; + pDstPixmap = (PixmapPtr)pDst; + pDstPriv = GETPIXPRIV(pDstPixmap); - if (can_do_screen_blt) + if (XRDP_IS_OS(pDstPriv)) { - rdpup_check_dirty(pDstPixmap, pDstPriv); - return rdpCopyAreaWndToPixmap(pSrcWnd, pDstPixmap, pDstPriv, pGC, - srcx, srcy, w, h, dstx, dsty); + can_do_screen_blt = pGC->alu == GXcopy; + + if (can_do_screen_blt) + { + rdpup_check_dirty(pDstPixmap, pDstPriv); + return rdpCopyAreaWndToPixmap(pSrcWnd, pDstPixmap, pDstPriv, pGC, + srcx, srcy, w, h, dstx, dsty); + } } } } } - } - if (pSrc->type == DRAWABLE_PIXMAP) - { - pSrcPixmap = (PixmapPtr)pSrc; - pSrcPriv = GETPIXPRIV(pSrcPixmap); + if (pSrc->type == DRAWABLE_PIXMAP) + { + pSrcPixmap = (PixmapPtr)pSrc; + pSrcPriv = GETPIXPRIV(pSrcPixmap); + + if (XRDP_IS_OS(pSrcPriv)) + { + rdpup_check_dirty_screen(&g_screenPriv); + rdpup_check_dirty(pSrcPixmap, pSrcPriv); + return rdpCopyAreaPixmapToWnd(pSrcPixmap, pSrcPriv, pDstWnd, pGC, + srcx, srcy, w, h, dstx, dsty); + } + } + + /* do original call */ + rv = rdpCopyAreaOrg(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); + + dirty_type = 0; + pDirtyPriv = 0; + post_process = 0; + reset_surface = 0; + got_id = 0; - if (XRDP_IS_OS(pSrcPriv)) + if (pDst->type == DRAWABLE_PIXMAP) { - if (pDst->type == DRAWABLE_WINDOW) + pDstPixmap = (PixmapPtr)pDst; + pDstPriv = GETPIXPRIV(pDstPixmap); + + if (XRDP_IS_OS(pDstPriv)) { - pDstWnd = (WindowPtr)pDst; + post_process = 1; - if (pDstWnd->viewable) + if (g_do_dirty_os) { - rdpup_check_dirty(pSrcPixmap, pSrcPriv); - return rdpCopyAreaPixmapToWnd(pSrcPixmap, pSrcPriv, pDstWnd, pGC, - srcx, srcy, w, h, dstx, dsty); + LLOGLN(10, ("rdpCopyArea: gettig dirty")); + pDstPriv->is_dirty = 1; + pDirtyPriv = pDstPriv; + dirty_type = RDI_IMGLL; } - } - else if (pDst->type == DRAWABLE_PIXMAP) - { - pDstPixmap = (PixmapPtr)pDst; - pDstPriv = GETPIXPRIV(pDstPixmap); - - if (XRDP_IS_OS(pDstPriv)) + else { - if (g_can_do_pix_to_pix) - { - rdpup_check_dirty(pSrcPixmap, pSrcPriv); - rdpup_check_dirty(pDstPixmap, pDstPriv); - return rdpCopyAreaPixmapToPixmap(pSrcPixmap, pSrcPriv, - pDstPixmap, pDstPriv, - pGC, srcx, srcy, w, h, - dstx, dsty); - } + rdpup_switch_os_surface(pDstPriv->rdpindex); + reset_surface = 1; + rdpup_get_pixmap_image_rect(pDstPixmap, &id); + got_id = 1; } } } - } - - /* do original call */ - rv = rdpCopyAreaOrg(pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); - - dirty_type = 0; - pDirtyPriv = 0; - post_process = 0; - reset_surface = 0; - got_id = 0; - - if (pDst->type == DRAWABLE_PIXMAP) - { - pDstPixmap = (PixmapPtr)pDst; - pDstPriv = GETPIXPRIV(pDstPixmap); - - if (XRDP_IS_OS(pDstPriv)) + else { post_process = 1; @@ -496,44 +513,31 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, if (pDstWnd->viewable) { post_process = 1; - rdpup_get_screen_image_rect(&id); - got_id = 1; + + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpCopyArea: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else + { + rdpup_get_screen_image_rect(&id); + got_id = 1; + } } } - } - if (!post_process) - { - return rv; - } - - RegionInit(&clip_reg, NullBox, 0); - cd = rdp_get_clip(&clip_reg, pDst, pGC); - - if (cd == 1) - { - if (dirty_type != 0) + if (!post_process) { - box.x1 = pDst->x + dstx; - box.y1 = pDst->y + dsty; - box.x2 = box.x1 + w; - box.y2 = box.y1 + h; - RegionInit(®1, &box, 0); - draw_item_add_img_region(pDirtyPriv, ®1, GXcopy, dirty_type); - RegionUninit(®1); + return rv; } - else if (got_id) - { - rdpup_begin_update(); - rdpup_send_area(&id, pDst->x + dstx, pDst->y + dsty, w, h); - rdpup_end_update(); - } - } - else if (cd == 2) - { - num_clips = REGION_NUM_RECTS(&clip_reg); - if (num_clips > 0) + RegionInit(&clip_reg, NullBox, 0); + cd = rdp_get_clip(&clip_reg, pDst, pGC); + + if (cd == 1) { if (dirty_type != 0) { @@ -541,50 +545,73 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, box.y1 = pDst->y + dsty; box.x2 = box.x1 + w; 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); - RegionUninit(&box_reg); + RegionInit(®1, &box, 0); + draw_item_add_img_region(pDirtyPriv, ®1, GXcopy, dirty_type); + RegionUninit(®1); } else if (got_id) { rdpup_begin_update(); - box.x1 = pDst->x + dstx; - box.y1 = pDst->y + dsty; - box.x2 = box.x1 + w; - box.y2 = box.y1 + h; - RegionInit(&box_reg, &box, 0); - RegionIntersect(&clip_reg, &clip_reg, &box_reg); - num_clips = REGION_NUM_RECTS(&clip_reg); + rdpup_send_area(&id, pDst->x + dstx, pDst->y + dsty, w, h); + rdpup_end_update(); + } + } + else if (cd == 2) + { + num_clips = REGION_NUM_RECTS(&clip_reg); - if (num_clips < 10) + if (num_clips > 0) + { + if (dirty_type != 0) { - for (j = num_clips - 1; j >= 0; j--) - { - box = REGION_RECTS(&clip_reg)[j]; - rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, - box.y2 - box.y1); - } + box.x1 = pDst->x + dstx; + box.y1 = pDst->y + dsty; + box.x2 = box.x1 + w; + 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); + RegionUninit(&box_reg); } - else + else if (got_id) { - pbox = RegionExtents(&clip_reg); - rdpup_send_area(&id, pbox->x1, pbox->y1, pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - } + rdpup_begin_update(); + box.x1 = pDst->x + dstx; + box.y1 = pDst->y + dsty; + box.x2 = box.x1 + w; + box.y2 = box.y1 + h; + RegionInit(&box_reg, &box, 0); + RegionIntersect(&clip_reg, &clip_reg, &box_reg); + num_clips = REGION_NUM_RECTS(&clip_reg); + + if (num_clips < 10) + { + for (j = num_clips - 1; j >= 0; j--) + { + box = REGION_RECTS(&clip_reg)[j]; + rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, + box.y2 - box.y1); + } + } + else + { + pbox = RegionExtents(&clip_reg); + rdpup_send_area(&id, pbox->x1, pbox->y1, pbox->x2 - pbox->x1, + pbox->y2 - pbox->y1); + } - RegionUninit(&box_reg); - rdpup_end_update(); + RegionUninit(&box_reg); + rdpup_end_update(); + } } } - } - RegionUninit(&clip_reg); + RegionUninit(&clip_reg); - if (reset_surface) - { - rdpup_switch_os_surface(-1); - } + if (reset_surface) + { + rdpup_switch_os_surface(-1); + } - return rv; -} + return rv; + } diff --git a/xorg/X11R7.6/rdp/rdpCopyPlane.c b/xorg/X11R7.6/rdp/rdpCopyPlane.c index aa0e2c29..6c871720 100644 --- a/xorg/X11R7.6/rdp/rdpCopyPlane.c +++ b/xorg/X11R7.6/rdp/rdpCopyPlane.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -125,13 +127,21 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, } else { - if (pDst->type == DRAWABLE_WINDOW) + pDstWnd = (WindowPtr)pDst; + + if (pDstWnd->viewable) { - pDstWnd = (WindowPtr)pDst; + post_process = 1; - if (pDstWnd->viewable) + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpCopyPlane: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else { - post_process = 1; rdpup_get_screen_image_rect(&id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpFillPolygon.c b/xorg/X11R7.6/rdp/rdpFillPolygon.c index d1ea89ea..6ecba893 100644 --- a/xorg/X11R7.6/rdp/rdpFillPolygon.c +++ b/xorg/X11R7.6/rdp/rdpFillPolygon.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -164,13 +166,21 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC, } else { - if (pDrawable->type == DRAWABLE_WINDOW) + pDstWnd = (WindowPtr)pDrawable; + + if (pDstWnd->viewable) { - pDstWnd = (WindowPtr)pDrawable; + post_process = 1; - if (pDstWnd->viewable) + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpFillPolygon: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else { - post_process = 1; rdpup_get_screen_image_rect(&id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpFillSpans.c b/xorg/X11R7.6/rdp/rdpFillSpans.c index b647dabc..7e006c88 100644 --- a/xorg/X11R7.6/rdp/rdpFillSpans.c +++ b/xorg/X11R7.6/rdp/rdpFillSpans.c @@ -68,7 +68,7 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit, PixmapPtr pDstPixmap; rdpPixmapRec *pDstPriv; - LLOGLN(10, ("rdpFillSpans: todo")); + LLOGLN(0, ("rdpFillSpans: todo")); /* do original call */ rdpFillSpansOrg(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted); @@ -82,40 +82,19 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit, if (XRDP_IS_OS(pDstPriv)) { - rdpup_switch_os_surface(pDstPriv->rdpindex); - rdpup_get_pixmap_image_rect(pDstPixmap, &id); - got_id = 1; + return; } - } - else - { - if (pDrawable->type == DRAWABLE_WINDOW) - { - pDstWnd = (WindowPtr)pDrawable; - if (pDstWnd->viewable) - { - rdpup_get_screen_image_rect(&id); - got_id = 1; - } - } - } + RegionInit(&clip_reg, NullBox, 0); + cd = rdp_get_clip(&clip_reg, pDrawable, pGC); - if (!got_id) - { - return; - } - - RegionInit(&clip_reg, NullBox, 0); - cd = rdp_get_clip(&clip_reg, pDrawable, pGC); + if (cd == 1) + { + } + else if (cd == 2) + { + } - if (cd == 1) - { + RegionUninit(&clip_reg); + rdpup_switch_os_surface(-1); } - else if (cd == 2) - { - } - - RegionUninit(&clip_reg); - rdpup_switch_os_surface(-1); -} diff --git a/xorg/X11R7.6/rdp/rdpImageGlyphBlt.c b/xorg/X11R7.6/rdp/rdpImageGlyphBlt.c index 8de4af22..af1095af 100644 --- a/xorg/X11R7.6/rdp/rdpImageGlyphBlt.c +++ b/xorg/X11R7.6/rdp/rdpImageGlyphBlt.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -97,25 +99,22 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, if (pDrawable->type == DRAWABLE_PIXMAP) { - pDstPixmap = (PixmapPtr)pDrawable; - pDstPriv = GETPIXPRIV(pDstPixmap); + pDstWnd = (WindowPtr)pDrawable; - if (XRDP_IS_OS(pDstPriv)) + if (pDstWnd->viewable) { post_process = 1; - if (g_do_dirty_os) + if (g_do_dirty_ons) { - LLOGLN(10, ("rdpImageGlyphBlt: gettig dirty")); - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; + LLOGLN(0, ("rdpImageGlyphBlt: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; dirty_type = RDI_IMGLL; } else { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); + rdpup_get_screen_image_rect(&id); got_id = 1; } } diff --git a/xorg/X11R7.6/rdp/rdpImageText16.c b/xorg/X11R7.6/rdp/rdpImageText16.c index 0ba18564..6e3b5262 100644 --- a/xorg/X11R7.6/rdp/rdpImageText16.c +++ b/xorg/X11R7.6/rdp/rdpImageText16.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -95,25 +97,22 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC, if (pDrawable->type == DRAWABLE_PIXMAP) { - pDstPixmap = (PixmapPtr)pDrawable; - pDstPriv = GETPIXPRIV(pDstPixmap); + pDstWnd = (WindowPtr)pDrawable; - if (XRDP_IS_OS(pDstPriv)) + if (pDstWnd->viewable) { post_process = 1; - if (g_do_dirty_os) + if (g_do_dirty_ons) { - LLOGLN(10, ("rdpImageText16: gettig dirty")); - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; - dirty_type = RDI_IMGLY; + LLOGLN(0, ("rdpImageText16: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; } else { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); + rdpup_get_screen_image_rect(&id); got_id = 1; } } diff --git a/xorg/X11R7.6/rdp/rdpImageText8.c b/xorg/X11R7.6/rdp/rdpImageText8.c index 3d27731a..f97d05a9 100644 --- a/xorg/X11R7.6/rdp/rdpImageText8.c +++ b/xorg/X11R7.6/rdp/rdpImageText8.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -95,25 +97,22 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC, if (pDrawable->type == DRAWABLE_PIXMAP) { - pDstPixmap = (PixmapPtr)pDrawable; - pDstPriv = GETPIXPRIV(pDstPixmap); + pDstWnd = (WindowPtr)pDrawable; - if (XRDP_IS_OS(pDstPriv)) + if (pDstWnd->viewable) { post_process = 1; - if (g_do_dirty_os) + if (g_do_dirty_ons) { - LLOGLN(10, ("rdpImageText8: gettig dirty")); - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; + LLOGLN(0, ("rdpImageText8: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; dirty_type = RDI_IMGLL; } else { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); + rdpup_get_screen_image_rect(&id); got_id = 1; } } diff --git a/xorg/X11R7.6/rdp/rdpPolyArc.c b/xorg/X11R7.6/rdp/rdpPolyArc.c index 4b5212a6..c23a78fb 100644 --- a/xorg/X11R7.6/rdp/rdpPolyArc.c +++ b/xorg/X11R7.6/rdp/rdpPolyArc.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -154,8 +156,25 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) if (!post_process) { - g_free(rects); - return; + pDstWnd = (WindowPtr)pDrawable; + + if (pDstWnd->viewable) + { + post_process = 1; + + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpPolyArc: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else + { + rdpup_get_screen_image_rect(&id); + got_id = 1; + } + } } RegionInit(&clip_reg, NullBox, 0); diff --git a/xorg/X11R7.6/rdp/rdpPolyFillArc.c b/xorg/X11R7.6/rdp/rdpPolyFillArc.c index 5fd568ad..f3fd27ef 100644 --- a/xorg/X11R7.6/rdp/rdpPolyFillArc.c +++ b/xorg/X11R7.6/rdp/rdpPolyFillArc.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -154,8 +156,25 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc *parcs) if (!post_process) { - g_free(rects); - return; + pDstWnd = (WindowPtr)pDrawable; + + if (pDstWnd->viewable) + { + post_process = 1; + + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpPolyFillArc: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else + { + rdpup_get_screen_image_rect(&id); + got_id = 1; + } + } } RegionInit(&clip_reg, NullBox, 0); diff --git a/xorg/X11R7.6/rdp/rdpPolyFillRect.c b/xorg/X11R7.6/rdp/rdpPolyFillRect.c index 7a860623..778c8620 100644 --- a/xorg/X11R7.6/rdp/rdpPolyFillRect.c +++ b/xorg/X11R7.6/rdp/rdpPolyFillRect.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -94,37 +96,40 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, if (pDrawable->type == DRAWABLE_PIXMAP) { - pDstPixmap = (PixmapPtr)pDrawable; - pDstPriv = GETPIXPRIV(pDstPixmap); + post_process = 1; - if (XRDP_IS_OS(pDstPriv)) + if (g_do_dirty_os) { - post_process = 1; - - if (g_do_dirty_os) - { - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; - dirty_type = RDI_FILL; - } - else - { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); - got_id = 1; - } + LLOGLN(10, ("rdpPolyFillRect: gettig dirty")); + pDstPriv->is_dirty = 1; + pDirtyPriv = pDstPriv; + dirty_type = RDI_FILL; + } + else + { + rdpup_switch_os_surface(pDstPriv->rdpindex); + reset_surface = 1; + rdpup_get_pixmap_image_rect(pDstPixmap, &id); + got_id = 1; } } else { - if (pDrawable->type == DRAWABLE_WINDOW) + pDstWnd = (WindowPtr)pDrawable; + + if (pDstWnd->viewable) { - pDstWnd = (WindowPtr)pDrawable; + post_process = 1; - if (pDstWnd->viewable) + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpPolyFillRect: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else { - post_process = 1; rdpup_get_screen_image_rect(&id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPolyGlyphBlt.c b/xorg/X11R7.6/rdp/rdpPolyGlyphBlt.c index 62fc6e8e..9a9aa22a 100644 --- a/xorg/X11R7.6/rdp/rdpPolyGlyphBlt.c +++ b/xorg/X11R7.6/rdp/rdpPolyGlyphBlt.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -97,25 +99,22 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, if (pDrawable->type == DRAWABLE_PIXMAP) { - pDstPixmap = (PixmapPtr)pDrawable; - pDstPriv = GETPIXPRIV(pDstPixmap); + pDstWnd = (WindowPtr)pDrawable; - if (XRDP_IS_OS(pDstPriv)) + if (pDstWnd->viewable) { post_process = 1; - if (g_do_dirty_os) + if (g_do_dirty_ons) { - LLOGLN(10, ("rdpPolyGlyphBlt: gettig dirty")); - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; - dirty_type = RDI_IMGLY; + LLOGLN(0, ("rdpPolyGlyphBlt: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; } else { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); + rdpup_get_screen_image_rect(&id); got_id = 1; } } diff --git a/xorg/X11R7.6/rdp/rdpPolyPoint.c b/xorg/X11R7.6/rdp/rdpPolyPoint.c index ff112782..7ab89106 100644 --- a/xorg/X11R7.6/rdp/rdpPolyPoint.c +++ b/xorg/X11R7.6/rdp/rdpPolyPoint.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -98,40 +100,25 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode, for (i = 0; i < npt; i++) { - pts[i].x = pDrawable->x + in_pts[i].x; - pts[i].y = pDrawable->y + in_pts[i].y; + pDstWnd = (WindowPtr)pDrawable; - if (i == 0) + if (pDstWnd->viewable) { - total_box.x1 = pts[0].x; - total_box.y1 = pts[0].y; - total_box.x2 = pts[0].x; - total_box.y2 = pts[0].y; - } - else - { - if (pts[i].x < total_box.x1) - { - total_box.x1 = pts[i].x; - } - - if (pts[i].y < total_box.y1) - { - total_box.y1 = pts[i].y; - } + post_process = 1; - if (pts[i].x > total_box.x2) + if (g_do_dirty_ons) { - total_box.x2 = pts[i].x; + LLOGLN(0, ("rdpPolyPoint: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; } - - if (pts[i].y > total_box.y2) + else { - total_box.y2 = pts[i].y; + rdpup_get_screen_image_rect(&id); + got_id = 1; } } - - /* todo, use this total_box */ } /* do original call */ diff --git a/xorg/X11R7.6/rdp/rdpPolyRectangle.c b/xorg/X11R7.6/rdp/rdpPolyRectangle.c index 9f8a32fb..3512bf58 100644 --- a/xorg/X11R7.6/rdp/rdpPolyRectangle.c +++ b/xorg/X11R7.6/rdp/rdpPolyRectangle.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -107,25 +109,22 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects, if (pDrawable->type == DRAWABLE_PIXMAP) { - pDstPixmap = (PixmapPtr)pDrawable; - pDstPriv = GETPIXPRIV(pDstPixmap); + pDstWnd = (WindowPtr)pDrawable; - if (XRDP_IS_OS(pDstPriv)) + if (pDstWnd->viewable) { post_process = 1; - if (g_do_dirty_os) + if (g_do_dirty_ons) { - LLOGLN(10, ("rdpPolyRectangle: gettig dirty")); - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; + LLOGLN(0, ("rdpPolyRectangle: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; dirty_type = RDI_IMGLL; } else { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); + rdpup_get_screen_image_rect(&id); got_id = 1; } } diff --git a/xorg/X11R7.6/rdp/rdpPolySegment.c b/xorg/X11R7.6/rdp/rdpPolySegment.c index c748c892..e723095c 100644 --- a/xorg/X11R7.6/rdp/rdpPolySegment.c +++ b/xorg/X11R7.6/rdp/rdpPolySegment.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -144,8 +146,25 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment *pSegs) if (!post_process) { - g_free(segs); - return; + pDstWnd = (WindowPtr)pDrawable; + + if (pDstWnd->viewable) + { + post_process = 1; + + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpPolySegment: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else + { + rdpup_get_screen_image_rect(&id); + got_id = 1; + } + } } RegionInit(&clip_reg, NullBox, 0); diff --git a/xorg/X11R7.6/rdp/rdpPolyText16.c b/xorg/X11R7.6/rdp/rdpPolyText16.c index 34f8aa82..0ae340f7 100644 --- a/xorg/X11R7.6/rdp/rdpPolyText16.c +++ b/xorg/X11R7.6/rdp/rdpPolyText16.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -98,25 +100,22 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC, if (pDrawable->type == DRAWABLE_PIXMAP) { - pDstPixmap = (PixmapPtr)pDrawable; - pDstPriv = GETPIXPRIV(pDstPixmap); + pDstWnd = (WindowPtr)pDrawable; - if (XRDP_IS_OS(pDstPriv)) + if (pDstWnd->viewable) { post_process = 1; - if (g_do_dirty_os) + if (g_do_dirty_ons) { - LLOGLN(10, ("rdpPolyText16: gettig dirty")); - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; - dirty_type = RDI_IMGLY; + LLOGLN(0, ("rdpPolyText16: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; } else { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); + rdpup_get_screen_image_rect(&id); got_id = 1; } } diff --git a/xorg/X11R7.6/rdp/rdpPolyText8.c b/xorg/X11R7.6/rdp/rdpPolyText8.c index 39245ce1..8ca7d695 100644 --- a/xorg/X11R7.6/rdp/rdpPolyText8.c +++ b/xorg/X11R7.6/rdp/rdpPolyText8.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -98,25 +100,22 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC, if (pDrawable->type == DRAWABLE_PIXMAP) { - pDstPixmap = (PixmapPtr)pDrawable; - pDstPriv = GETPIXPRIV(pDstPixmap); + pDstWnd = (WindowPtr)pDrawable; - if (XRDP_IS_OS(pDstPriv)) + if (pDstWnd->viewable) { post_process = 1; - if (g_do_dirty_os) + if (g_do_dirty_ons) { - LLOGLN(10, ("rdpPolyText8: gettig dirty")); - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; - dirty_type = RDI_IMGLY; + LLOGLN(0, ("rdpPolyText8: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; } else { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); + rdpup_get_screen_image_rect(&id); got_id = 1; } } diff --git a/xorg/X11R7.6/rdp/rdpPolylines.c b/xorg/X11R7.6/rdp/rdpPolylines.c index d5208e42..977de9fd 100644 --- a/xorg/X11R7.6/rdp/rdpPolylines.c +++ b/xorg/X11R7.6/rdp/rdpPolylines.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -180,13 +182,21 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode, } else { - if (pDrawable->type == DRAWABLE_WINDOW) + pDstWnd = (WindowPtr)pDrawable; + + if (pDstWnd->viewable) { - pDstWnd = (WindowPtr)pDrawable; + post_process = 1; - if (pDstWnd->viewable) + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpPolylines: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else { - post_process = 1; rdpup_get_screen_image_rect(&id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPushPixels.c b/xorg/X11R7.6/rdp/rdpPushPixels.c index d990d6cb..be55d25a 100644 --- a/xorg/X11R7.6/rdp/rdpPushPixels.c +++ b/xorg/X11R7.6/rdp/rdpPushPixels.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -91,38 +93,40 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, if (pDst->type == DRAWABLE_PIXMAP) { - pDstPixmap = (PixmapPtr)pDst; - pDstPriv = GETPIXPRIV(pDstPixmap); + post_process = 1; - if (XRDP_IS_OS(pDstPriv)) + if (g_do_dirty_os) { - post_process = 1; - - if (g_do_dirty_os) - { - LLOGLN(10, ("rdpPutImage: gettig dirty")); - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; - dirty_type = RDI_IMGLY; - } - else - { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); - got_id = 1; - } + LLOGLN(10, ("rdpPushPixels: gettig dirty")); + pDstPriv->is_dirty = 1; + pDirtyPriv = pDstPriv; + dirty_type = RDI_IMGLY; + } + else + { + rdpup_switch_os_surface(pDstPriv->rdpindex); + reset_surface = 1; + rdpup_get_pixmap_image_rect(pDstPixmap, &id); + got_id = 1; } } else { - if (pDst->type == DRAWABLE_WINDOW) + pDstWnd = (WindowPtr)pDst; + + if (pDstWnd->viewable) { - pDstWnd = (WindowPtr)pDst; + post_process = 1; - if (pDstWnd->viewable) + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpPushPixels: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else { - post_process = 1; rdpup_get_screen_image_rect(&id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpPutImage.c b/xorg/X11R7.6/rdp/rdpPutImage.c index 5fb28516..fde2c0eb 100644 --- a/xorg/X11R7.6/rdp/rdpPutImage.c +++ b/xorg/X11R7.6/rdp/rdpPutImage.c @@ -38,6 +38,8 @@ extern int g_Bpp; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern Bool g_wrapPixmap; /* from 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 */ extern GCOps g_rdpGCOps; /* from rdpdraw.c */ @@ -118,13 +120,21 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, } else { - if (pDst->type == DRAWABLE_WINDOW) + pDstWnd = (WindowPtr)pDst; + + if (pDstWnd->viewable) { - pDstWnd = (WindowPtr)pDst; + post_process = 1; - if (pDstWnd->viewable) + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpPutImage: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else { - post_process = 1; rdpup_get_screen_image_rect(&id); got_id = 1; } diff --git a/xorg/X11R7.6/rdp/rdpSetSpans.c b/xorg/X11R7.6/rdp/rdpSetSpans.c index 734d67ac..34d3ec84 100644 --- a/xorg/X11R7.6/rdp/rdpSetSpans.c +++ b/xorg/X11R7.6/rdp/rdpSetSpans.c @@ -73,7 +73,7 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc, rdpPixmapRec *pDstPriv; rdpPixmapRec *pDirtyPriv; - LLOGLN(10, ("rdpSetSpans: todo")); + LLOGLN(0, ("rdpSetSpans: todo")); /* do original call */ rdpSetSpansOrg(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted); @@ -91,70 +91,75 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char *psrc, if (XRDP_IS_OS(pDstPriv)) { - post_process = 1; + pDstPixmap = (PixmapPtr)pDrawable; + pDstPriv = GETPIXPRIV(pDstPixmap); - if (g_do_dirty_os) + if (XRDP_IS_OS(pDstPriv)) { - LLOGLN(10, ("rdpSetSpans: gettig dirty")); - pDstPriv->is_dirty = 1; - pDirtyPriv = pDstPriv; - dirty_type = RDI_IMGLY; - } - else - { - rdpup_switch_os_surface(pDstPriv->rdpindex); - reset_surface = 1; - rdpup_get_pixmap_image_rect(pDstPixmap, &id); - got_id = 1; + post_process = 1; + + if (g_do_dirty_os) + { + LLOGLN(10, ("rdpSetSpans: gettig dirty")); + pDstPriv->is_dirty = 1; + pDirtyPriv = pDstPriv; + dirty_type = RDI_IMGLY; + } + else + { + rdpup_switch_os_surface(pDstPriv->rdpindex); + reset_surface = 1; + rdpup_get_pixmap_image_rect(pDstPixmap, &id); + got_id = 1; + } } } - } - else - { - if (pDrawable->type == DRAWABLE_WINDOW) + else { - pDstWnd = (WindowPtr)pDrawable; - - if (pDstWnd->viewable) + if (pDrawable->type == DRAWABLE_WINDOW) { - post_process = 1; - rdpup_get_screen_image_rect(&id); - got_id = 1; + pDstWnd = (WindowPtr)pDrawable; + + if (pDstWnd->viewable) + { + post_process = 1; + rdpup_get_screen_image_rect(&id); + got_id = 1; + } } } - } - if (!post_process) - { - return; - } - - RegionInit(&clip_reg, NullBox, 0); - cd = rdp_get_clip(&clip_reg, pDrawable, pGC); - - if (cd == 1) - { - if (dirty_type != 0) - { - } - else if (got_id) + if (!post_process) { + return; } - } - else if (cd == 2) - { - if (dirty_type != 0) + + RegionInit(&clip_reg, NullBox, 0); + cd = rdp_get_clip(&clip_reg, pDrawable, pGC); + + if (cd == 1) { + if (dirty_type != 0) + { + } + else if (got_id) + { + } } - else if (got_id) + else if (cd == 2) { + if (dirty_type != 0) + { + } + else if (got_id) + { + } } - } - RegionUninit(&clip_reg); + RegionUninit(&clip_reg); - if (reset_surface) - { - rdpup_switch_os_surface(-1); + if (reset_surface) + { + rdpup_switch_os_surface(-1); + } } -} diff --git a/xorg/X11R7.6/rdp/rdpdraw.c b/xorg/X11R7.6/rdp/rdpdraw.c index 20876048..f279bdb2 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; @@ -416,6 +418,11 @@ draw_item_add(rdpPixmapRec *priv, struct rdp_draw_item *di) priv->draw_item_tail = di; } + if (priv == &g_screenPriv) + { + rdpScheduleDeferredUpdate(); + } + return 0; } @@ -638,6 +645,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) @@ -935,46 +965,56 @@ 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(®); - - /* 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++) - { - 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(®)[i]; - rdpup_screen_blt(box2.x1 + dx, box2.y1 + dy, box2.x2 - box2.x1, - box2.y2 - box2.y1, box2.x1, box2.y1); - } - } + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpCopyWindow: gettig dirty TODO")); + //draw_item_add_srcblt_region } else { - for (j = num_clip_rects - 1; j >= 0; j--) + 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]; - 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(®)[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(®)[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(®)[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(&clip); g_pScreen->CopyWindow = rdpCopyWindow; @@ -1012,15 +1052,24 @@ rdpClearToBackground(WindowPtr pWin, int x, int y, int w, int h, RegionInit(®, &box, 0); RegionIntersect(®, ®, &pWin->clipList); - rdpup_begin_update(); - for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--) + if (g_do_dirty_ons) { - box = REGION_RECTS(®)[j]; - rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); + draw_item_add_img_region(&g_screenPriv, ®, GXcopy, RDI_IMGLL); + } + 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(®); } @@ -1036,20 +1085,29 @@ rdpRestoreAreas(WindowPtr pWin, RegionPtr prgnExposed) int j; BoxRec box; - LLOGLN(10, ("in rdpRestoreAreas")); + LLOGLN(0, ("in rdpRestoreAreas")); RegionInit(®, NullBox, 0); RegionCopy(®, prgnExposed); g_pScreen->RestoreAreas = g_rdpScreen.RestoreAreas; rv = g_pScreen->RestoreAreas(pWin, prgnExposed); - rdpup_begin_update(); - for (j = REGION_NUM_RECTS(®) - 1; j >= 0; j--) + if (g_do_dirty_ons) { - box = REGION_RECTS(®)[j]; - rdpup_send_area(0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); + draw_item_add_img_region(&g_screenPriv, ®, GXcopy, RDI_IMGLL); + } + 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(®); g_pScreen->RestoreAreas = rdpRestoreAreas; return rv; @@ -1189,13 +1247,21 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, } else { - if (p->type == DRAWABLE_WINDOW) + pDstWnd = (WindowPtr)p; + + if (pDstWnd->viewable) { - pDstWnd = (WindowPtr)p; + post_process = 1; - if (pDstWnd->viewable) + if (g_do_dirty_ons) + { + LLOGLN(0, ("rdpComposite: gettig dirty")); + g_screenPriv.is_dirty = 1; + pDirtyPriv = &g_screenPriv; + dirty_type = RDI_IMGLL; + } + else { - post_process = 1; rdpup_get_screen_image_rect(&id); got_id = 1; LLOGLN(10, ("rdpComposite: screen")); diff --git a/xorg/X11R7.6/rdp/rdpmain.c b/xorg/X11R7.6/rdp/rdpmain.c index 6a88b0e0..bb0c34b4 100644 --- a/xorg/X11R7.6/rdp/rdpmain.c +++ b/xorg/X11R7.6/rdp/rdpmain.c @@ -44,9 +44,12 @@ DeviceIntPtr g_keyboard = 0; int g_can_do_pix_to_pix = 1; int g_do_dirty_os = 1; /* delay remoting off screen bitmaps */ +int g_do_dirty_ons = 0; /* delay remoting screen */ Bool g_wrapWindow = 1; Bool g_wrapPixmap = 1; +rdpPixmapRec g_screenPriv; + /* if true, running in RemoteApp / RAIL mode */ int g_use_rail = 0; @@ -227,6 +230,7 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) rrScrPrivPtr pRRScrPriv; g_pScreen = pScreen; + memset(&g_screenPriv, 0, sizeof(g_screenPriv)); /*dpix = 75; dpiy = 75;*/ diff --git a/xorg/X11R7.6/rdp/rdpup.c b/xorg/X11R7.6/rdp/rdpup.c index ac46060e..508b7618 100644 --- a/xorg/X11R7.6/rdp/rdpup.c +++ b/xorg/X11R7.6/rdp/rdpup.c @@ -50,6 +50,7 @@ static int g_scheduled = 0; static int g_count = 0; static int g_rdpindex = -1; +extern DevPrivateKeyRec g_rdpWindowIndex; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern int g_Bpp; /* from rdpmain.c */ extern int g_Bpp_mask; /* from rdpmain.c */ @@ -59,6 +60,8 @@ extern int g_use_rail; /* from rdpmain.c */ /* true is to use unix domain socket */ extern int g_use_uds; /* in rdpmain.c */ extern char g_uds_data[]; /* in rdpmain.c */ +extern int g_do_dirty_ons; /* in rdpmain.c */ +extern rdpPixmapRec g_screenPriv; /* in rdpmain.c */ struct rdpup_os_bitmap { @@ -75,6 +78,12 @@ static int g_os_bitmap_stamp = 0; static int g_pixmap_byte_total = 0; static int g_pixmap_num_used = 0; +struct rdpup_top_window +{ + WindowPtr wnd; + struct rdpup_top_window *next; +}; + /* 0 GXclear, 0 1 GXnor, DPon @@ -352,13 +361,23 @@ rdpup_send_pending(void) static CARD32 rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg) { - rdpup_send_pending(); + LLOGLN(10, ("rdpDeferredUpdateCallback")); + + if (g_do_dirty_ons) + { + rdpup_check_dirty_screen(&g_screenPriv); + } + else + { + rdpup_send_pending(); + } + g_scheduled = 0; return 0; } /******************************************************************************/ -static void +void rdpScheduleDeferredUpdate(void) { if (!g_scheduled) @@ -583,6 +602,35 @@ process_version_msg(int param1, int param2, int param3, int param4) /******************************************************************************/ static int +rdpup_send_rail(void) +{ + WindowPtr wnd; + rdpWindowRec *priv; + + wnd = g_pScreen->root; + + if (wnd != 0) + { + wnd = wnd->lastChild; + + while (wnd != 0) + { + if (wnd->realized) + { + priv = GETWINPRIV(wnd); + priv->status = 1; + rdpup_create_window(wnd, priv); + } + + wnd = wnd->prevSib; + } + } + + return 0; +} + +/******************************************************************************/ +static int rdpup_process_msg(struct stream *s) { int msg_type; @@ -710,6 +758,7 @@ rdpup_process_msg(struct stream *s) if (g_rdpScreen.client_info.rail_support_level > 0) { g_use_rail = 1; + rdpup_send_rail(); } } else @@ -901,6 +950,8 @@ rdpup_check(void) int rdpup_begin_update(void) { + LLOGLN(10, ("rdpup_begin_update")); + if (g_connected) { if (g_begin) @@ -924,9 +975,18 @@ rdpup_begin_update(void) int rdpup_end_update(void) { + LLOGLN(10, ("rdpup_end_update")); + if (g_connected && g_begin) { - rdpScheduleDeferredUpdate(); + if (g_do_dirty_ons) + { + rdpup_send_pending(); + } + else + { + rdpScheduleDeferredUpdate(); + } } return 0; @@ -1625,92 +1685,83 @@ rdpup_create_window(WindowPtr pWindow, rdpWindowRec *priv) if (g_connected) { - root_id = pWindow->drawable.pScreen->root->drawable.id; - - if (pWindow->overrideRedirect) - { - style = XR_STYLE_TOOLTIP; - ext_style = XR_EXT_STYLE_TOOLTIP; - } - else - { - style = XR_STYLE_NORMAL; - ext_style = XR_EXT_STYLE_NORMAL; - } - - flags = WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_STATE_NEW; - strcpy(title, "title"); - title_bytes = strlen(title); - - num_window_rects = 1; - num_visibility_rects = 1; - - /* calculate bytes */ - bytes = (2 + 2) + (5 * 4) + (2 + title_bytes) + (12 * 4) + - (2 + num_window_rects * 8) + (4 + 4) + - (2 + num_visibility_rects * 8) + 4; - - rdpup_pre_check(bytes); - out_uint16_le(g_out_s, 25); - out_uint16_le(g_out_s, bytes); - g_count++; - out_uint32_le(g_out_s, pWindow->drawable.id); /* window_id */ - out_uint32_le(g_out_s, pWindow->parent->drawable.id); /* owner_window_id */ - flags |= WINDOW_ORDER_FIELD_OWNER; - out_uint32_le(g_out_s, style); /* style */ - out_uint32_le(g_out_s, ext_style); /* extended_style */ - flags |= WINDOW_ORDER_FIELD_STYLE; - out_uint32_le(g_out_s, 0); /* show_state */ - flags |= WINDOW_ORDER_FIELD_SHOW; - out_uint16_le(g_out_s, title_bytes); /* title_info */ - out_uint8a(g_out_s, title, title_bytes); - flags |= WINDOW_ORDER_FIELD_TITLE; - out_uint32_le(g_out_s, 0); /* client_offset_x */ - out_uint32_le(g_out_s, 0); /* client_offset_y */ - flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET; - out_uint32_le(g_out_s, pWindow->drawable.width); /* client_area_width */ - out_uint32_le(g_out_s, pWindow->drawable.height); /* client_area_height */ - flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE; - out_uint32_le(g_out_s, 0); /* rp_content */ - out_uint32_le(g_out_s, root_id); /* root_parent_handle */ - flags |= WINDOW_ORDER_FIELD_ROOT_PARENT; - out_uint32_le(g_out_s, pWindow->drawable.x); /* window_offset_x */ - out_uint32_le(g_out_s, pWindow->drawable.y); /* window_offset_y */ - flags |= WINDOW_ORDER_FIELD_WND_OFFSET; - out_uint32_le(g_out_s, 0); /* window_client_delta_x */ - out_uint32_le(g_out_s, 0); /* window_client_delta_y */ - flags |= WINDOW_ORDER_FIELD_WND_CLIENT_DELTA; - out_uint32_le(g_out_s, pWindow->drawable.width); /* window_width */ - out_uint32_le(g_out_s, pWindow->drawable.height); /* window_height */ - flags |= WINDOW_ORDER_FIELD_WND_SIZE; - out_uint16_le(g_out_s, num_window_rects); /* num_window_rects */ - - for (index = 0; index < num_window_rects; index++) - { - out_uint16_le(g_out_s, 0); /* left */ - out_uint16_le(g_out_s, 0); /* top */ - out_uint16_le(g_out_s, pWindow->drawable.width); /* right */ - out_uint16_le(g_out_s, pWindow->drawable.height); /* bottom */ - } - - flags |= WINDOW_ORDER_FIELD_WND_RECTS; - out_uint32_le(g_out_s, 0); /* visible_offset_x */ - out_uint32_le(g_out_s, 0); /* visible_offset_y */ - flags |= WINDOW_ORDER_FIELD_VIS_OFFSET; - out_uint16_le(g_out_s, num_visibility_rects); /* num_visibility_rects */ - - for (index = 0; index < num_visibility_rects; index++) - { - out_uint16_le(g_out_s, 0); /* left */ - out_uint16_le(g_out_s, 0); /* top */ - out_uint16_le(g_out_s, pWindow->drawable.width); /* right */ - out_uint16_le(g_out_s, pWindow->drawable.height); /* bottom */ - } - - flags |= WINDOW_ORDER_FIELD_VISIBILITY; - - out_uint32_le(g_out_s, flags); /* flags */ - } + style = XR_STYLE_NORMAL; + ext_style = XR_EXT_STYLE_NORMAL; + } + + flags = WINDOW_ORDER_TYPE_WINDOW | WINDOW_ORDER_STATE_NEW; + strcpy(title, "title"); + title_bytes = strlen(title); + + num_window_rects = 1; + num_visibility_rects = 1; + + /* calculate bytes */ + bytes = (2 + 2) + (5 * 4) + (2 + title_bytes) + (12 * 4) + + (2 + num_window_rects * 8) + (4 + 4) + + (2 + num_visibility_rects * 8) + 4; + + rdpup_pre_check(bytes); + out_uint16_le(g_out_s, 25); + out_uint16_le(g_out_s, bytes); + g_count++; + out_uint32_le(g_out_s, pWindow->drawable.id); /* window_id */ + out_uint32_le(g_out_s, pWindow->parent->drawable.id); /* owner_window_id */ + flags |= WINDOW_ORDER_FIELD_OWNER; + out_uint32_le(g_out_s, style); /* style */ + out_uint32_le(g_out_s, ext_style); /* extended_style */ + flags |= WINDOW_ORDER_FIELD_STYLE; + out_uint32_le(g_out_s, 0); /* show_state */ + flags |= WINDOW_ORDER_FIELD_SHOW; + out_uint16_le(g_out_s, title_bytes); /* title_info */ + out_uint8a(g_out_s, title, title_bytes); + flags |= WINDOW_ORDER_FIELD_TITLE; + out_uint32_le(g_out_s, 0); /* client_offset_x */ + out_uint32_le(g_out_s, 0); /* client_offset_y */ + flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_OFFSET; + out_uint32_le(g_out_s, pWindow->drawable.width); /* client_area_width */ + out_uint32_le(g_out_s, pWindow->drawable.height); /* client_area_height */ + flags |= WINDOW_ORDER_FIELD_CLIENT_AREA_SIZE; + out_uint32_le(g_out_s, 0); /* rp_content */ + out_uint32_le(g_out_s, root_id); /* root_parent_handle */ + flags |= WINDOW_ORDER_FIELD_ROOT_PARENT; + out_uint32_le(g_out_s, pWindow->drawable.x); /* window_offset_x */ + out_uint32_le(g_out_s, pWindow->drawable.y); /* window_offset_y */ + flags |= WINDOW_ORDER_FIELD_WND_OFFSET; + out_uint32_le(g_out_s, 0); /* window_client_delta_x */ + out_uint32_le(g_out_s, 0); /* window_client_delta_y */ + flags |= WINDOW_ORDER_FIELD_WND_CLIENT_DELTA; + out_uint32_le(g_out_s, pWindow->drawable.width); /* window_width */ + out_uint32_le(g_out_s, pWindow->drawable.height); /* window_height */ + flags |= WINDOW_ORDER_FIELD_WND_SIZE; + out_uint16_le(g_out_s, num_window_rects); /* num_window_rects */ + + for (index = 0; index < num_window_rects; index++) + { + out_uint16_le(g_out_s, 0); /* left */ + out_uint16_le(g_out_s, 0); /* top */ + out_uint16_le(g_out_s, pWindow->drawable.width); /* right */ + out_uint16_le(g_out_s, pWindow->drawable.height); /* bottom */ + } + + flags |= WINDOW_ORDER_FIELD_WND_RECTS; + out_uint32_le(g_out_s, pWindow->drawable.x); /* visible_offset_x */ + out_uint32_le(g_out_s, pWindow->drawable.y); /* visible_offset_y */ + flags |= WINDOW_ORDER_FIELD_VIS_OFFSET; + out_uint16_le(g_out_s, num_visibility_rects); /* num_visibility_rects */ + + for (index = 0; index < num_visibility_rects; index++) + { + out_uint16_le(g_out_s, 0); /* left */ + out_uint16_le(g_out_s, 0); /* top */ + out_uint16_le(g_out_s, pWindow->drawable.width); /* right */ + out_uint16_le(g_out_s, pWindow->drawable.height); /* bottom */ + } + + flags |= WINDOW_ORDER_FIELD_VISIBILITY; + + out_uint32_le(g_out_s, flags); /* flags */ +} } /******************************************************************************/ @@ -1846,12 +1897,143 @@ rdpup_check_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec *pDirtyPriv) break; } + rdpup_reset_clip(); + rdpup_set_opcode(GXcopy); + break; + case RDI_SCRBLT: + LLOGLN(10, (" RDI_SCRBLT")); + break; + } + + di = di->next; +} +draw_item_remove_all(pDirtyPriv); +rdpup_end_update(); +pDirtyPriv->is_dirty = 0; + rdpup_switch_os_surface(-1); + return 0; +} + + /******************************************************************************/ + int + rdpup_check_dirty_screen(rdpPixmapRec *pDirtyPriv) +{ + int index; + int clip_index; + int count; + int num_clips; + BoxRec box; + xSegment *seg; + struct image_data id; + struct rdp_draw_item *di; + + if (pDirtyPriv == 0) + { + return 0; + } + + if (pDirtyPriv->is_dirty == 0) + { + return 0; + } + + LLOGLN(10, ("-----------------got dirty")); + rdpup_get_screen_image_rect(&id); + rdpup_begin_update(); + draw_item_pack(pDirtyPriv); + di = pDirtyPriv->draw_item_head; + + while (di != 0) + { + LLOGLN(10, ("rdpup_check_dirty_screen: type %d", di->type)); + + switch (di->type) + { + case RDI_FILL: + rdpup_set_fgcolor(di->u.fill.fg_color); + rdpup_set_opcode(di->u.fill.opcode); + count = REGION_NUM_RECTS(di->reg); + + for (index = 0; index < count; index++) + { + box = REGION_RECTS(di->reg)[index]; + LLOGLN(10, (" RDI_FILL %d %d %d %d", box.x1, box.y1, + box.x2, box.y2)); + rdpup_fill_rect(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); + } + + rdpup_set_opcode(GXcopy); + break; + case RDI_IMGLL: + rdpup_set_hints(1, 1); + rdpup_set_opcode(di->u.img.opcode); + count = REGION_NUM_RECTS(di->reg); + + for (index = 0; index < count; index++) + { + box = REGION_RECTS(di->reg)[index]; + LLOGLN(10, (" RDI_IMGLL %d %d %d %d", box.x1, box.y1, + box.x2, box.y2)); + rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, + box.y2 - box.y1); + } + + rdpup_set_opcode(GXcopy); + rdpup_set_hints(0, 1); + break; + case RDI_IMGLY: + rdpup_set_opcode(di->u.img.opcode); + count = REGION_NUM_RECTS(di->reg); + + for (index = 0; index < count; index++) + { + box = REGION_RECTS(di->reg)[index]; + LLOGLN(10, (" RDI_IMGLY %d %d %d %d", box.x1, box.y1, + box.x2, box.y2)); + rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, + box.y2 - box.y1); + } + + rdpup_set_opcode(GXcopy); + break; + case RDI_LINE: + LLOGLN(10, (" RDI_LINE")); + num_clips = REGION_NUM_RECTS(di->reg); + + if (num_clips > 0) + { + rdpup_set_fgcolor(di->u.line.fg_color); + rdpup_set_opcode(di->u.line.opcode); + rdpup_set_pen(0, di->u.line.width); + + for (clip_index = num_clips - 1; clip_index >= 0; clip_index--) + { + box = REGION_RECTS(di->reg)[clip_index]; + rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); + + for (index = 0; index < di->u.line.nseg; index++) + { + seg = di->u.line.segs + index; + LLOGLN(10, (" RDI_LINE %d %d %d %d", seg->x1, seg->y1, + seg->x2, seg->y2)); + rdpup_draw_line(seg->x1, seg->y1, seg->x2, seg->y2); + } + } + } + + rdpup_reset_clip(); + rdpup_set_opcode(GXcopy); + break; + case RDI_SCRBLT: + LLOGLN(10, (" RDI_SCRBLT")); + break; + } + di = di->next; } draw_item_remove_all(pDirtyPriv); rdpup_end_update(); pDirtyPriv->is_dirty = 0; - rdpup_switch_os_surface(-1); return 0; } |