xorg: offscreen bitmaps, don't remote until used
This commit is contained in:
parent
7539d7271e
commit
da9d55f180
@ -193,12 +193,31 @@ typedef rdpWindowRec* rdpWindowPtr;
|
|||||||
#define XR_STYLE_DIALOG (0x80000000)
|
#define XR_STYLE_DIALOG (0x80000000)
|
||||||
#define XR_EXT_STYLE_DIALOG (0x00040000)
|
#define XR_EXT_STYLE_DIALOG (0x00040000)
|
||||||
|
|
||||||
|
#define RDI_FILL 1
|
||||||
|
#define RDI_IMGLL 2
|
||||||
|
#define RDI_IMGLY 3
|
||||||
|
|
||||||
|
struct rdp_draw_item
|
||||||
|
{
|
||||||
|
int type;
|
||||||
|
int fg_color;
|
||||||
|
int bg_color;
|
||||||
|
int opcode;
|
||||||
|
RegionPtr reg;
|
||||||
|
struct rdp_draw_item* prev;
|
||||||
|
struct rdp_draw_item* next;
|
||||||
|
};
|
||||||
|
|
||||||
struct _rdpPixmapRec
|
struct _rdpPixmapRec
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
int rdpindex;
|
int rdpindex;
|
||||||
int allocBytes;
|
int allocBytes;
|
||||||
int con_number;
|
int con_number;
|
||||||
|
int is_dirty;
|
||||||
|
int pad;
|
||||||
|
struct rdp_draw_item* draw_item_head;
|
||||||
|
struct rdp_draw_item* draw_item_tail;
|
||||||
};
|
};
|
||||||
typedef struct _rdpPixmapRec rdpPixmapRec;
|
typedef struct _rdpPixmapRec rdpPixmapRec;
|
||||||
typedef rdpPixmapRec* rdpPixmapPtr;
|
typedef rdpPixmapRec* rdpPixmapPtr;
|
||||||
@ -265,6 +284,22 @@ hexdump(unsigned char *p, unsigned int len);
|
|||||||
Bool
|
Bool
|
||||||
rdpCloseScreen(int i, ScreenPtr pScreen);
|
rdpCloseScreen(int i, ScreenPtr pScreen);
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
draw_item_add(rdpPixmapRec* priv, struct rdp_draw_item* di);
|
||||||
|
int
|
||||||
|
draw_item_remove(rdpPixmapRec* priv, struct rdp_draw_item* di);
|
||||||
|
int
|
||||||
|
draw_item_remove_all(rdpPixmapRec* priv);
|
||||||
|
int
|
||||||
|
draw_item_pack(rdpPixmapRec* priv);
|
||||||
|
int
|
||||||
|
draw_item_add_img_region(rdpPixmapRec* priv, RegionPtr reg, int type);
|
||||||
|
int
|
||||||
|
draw_item_add_fill_region(rdpPixmapRec* priv, RegionPtr reg, int color,
|
||||||
|
int opcode);
|
||||||
|
|
||||||
|
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
||||||
unsigned usage_hint);
|
unsigned usage_hint);
|
||||||
@ -426,6 +461,8 @@ void
|
|||||||
rdpup_create_window(WindowPtr pWindow, rdpWindowRec* priv);
|
rdpup_create_window(WindowPtr pWindow, rdpWindowRec* priv);
|
||||||
void
|
void
|
||||||
rdpup_delete_window(WindowPtr pWindow, rdpWindowRec* priv);
|
rdpup_delete_window(WindowPtr pWindow, rdpWindowRec* priv);
|
||||||
|
int
|
||||||
|
rdpup_check_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec* pDirtyPriv);
|
||||||
|
|
||||||
#if defined(X_BYTE_ORDER)
|
#if defined(X_BYTE_ORDER)
|
||||||
# if X_BYTE_ORDER == X_LITTLE_ENDIAN
|
# if X_BYTE_ORDER == X_LITTLE_ENDIAN
|
||||||
|
@ -367,6 +367,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
|||||||
can_do_screen_blt = pGC->alu == GXcopy;
|
can_do_screen_blt = pGC->alu == GXcopy;
|
||||||
if (can_do_screen_blt)
|
if (can_do_screen_blt)
|
||||||
{
|
{
|
||||||
|
rdpup_check_dirty(pDstPixmap, pDstPriv);
|
||||||
return rdpCopyAreaWndToPixmap(pSrcWnd, pDstPixmap, pDstPriv, pGC,
|
return rdpCopyAreaWndToPixmap(pSrcWnd, pDstPixmap, pDstPriv, pGC,
|
||||||
srcx, srcy, w, h, dstx, dsty);
|
srcx, srcy, w, h, dstx, dsty);
|
||||||
}
|
}
|
||||||
@ -380,6 +381,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
|||||||
pSrcPriv = GETPIXPRIV(pSrcPixmap);
|
pSrcPriv = GETPIXPRIV(pSrcPixmap);
|
||||||
if (XRDP_IS_OS(pSrcPriv))
|
if (XRDP_IS_OS(pSrcPriv))
|
||||||
{
|
{
|
||||||
|
rdpup_check_dirty(pSrcPixmap, pSrcPriv);
|
||||||
if (pDst->type == DRAWABLE_WINDOW)
|
if (pDst->type == DRAWABLE_WINDOW)
|
||||||
{
|
{
|
||||||
pDstWnd = (WindowPtr)pDst;
|
pDstWnd = (WindowPtr)pDst;
|
||||||
@ -395,6 +397,7 @@ rdpCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
|||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
{
|
{
|
||||||
|
rdpup_check_dirty(pDstPixmap, pDstPriv);
|
||||||
return rdpCopyAreaPixmapToPixmap(pSrcPixmap, pSrcPriv,
|
return rdpCopyAreaPixmapToPixmap(pSrcPixmap, pSrcPriv,
|
||||||
pDstPixmap, pDstPriv,
|
pDstPixmap, pDstPriv,
|
||||||
pGC, srcx, srcy, w, h,
|
pGC, srcx, srcy, w, h,
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -68,34 +69,56 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
|
|||||||
RegionPtr rv;
|
RegionPtr rv;
|
||||||
RegionRec clip_reg;
|
RegionRec clip_reg;
|
||||||
RegionRec box_reg;
|
RegionRec box_reg;
|
||||||
|
RegionRec reg1;
|
||||||
|
RegionRec reg2;
|
||||||
int cd;
|
int cd;
|
||||||
int num_clips;
|
int num_clips;
|
||||||
int j;
|
int j;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
BoxPtr pbox;
|
BoxPtr pbox;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpCopyPlane:"));
|
LLOGLN(10, ("rdpCopyPlane:"));
|
||||||
|
|
||||||
/* do original call */
|
/* do original call */
|
||||||
rv = rdpCopyPlaneOrg(pSrc, pDst, pGC, srcx, srcy, w, h,
|
rv = rdpCopyPlaneOrg(pSrc, pDst, pGC, srcx, srcy, w, h,
|
||||||
dstx, dsty, bitPlane);
|
dstx, dsty, bitPlane);
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDst->type == DRAWABLE_PIXMAP)
|
if (pDst->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDst;
|
pDstPixmap = (PixmapPtr)pDst;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpCopyPlane: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLY;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDst->type == DRAWABLE_WINDOW)
|
if (pDst->type == DRAWABLE_WINDOW)
|
||||||
@ -103,12 +126,13 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
|
|||||||
pDstWnd = (WindowPtr)pDst;
|
pDstWnd = (WindowPtr)pDst;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -116,15 +140,44 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
|
|||||||
RegionInit(&clip_reg, NullBox, 0);
|
RegionInit(&clip_reg, NullBox, 0);
|
||||||
cd = rdp_get_clip(&clip_reg, pDst, pGC);
|
cd = rdp_get_clip(&clip_reg, pDst, pGC);
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
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, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, pDst->x + dstx, pDst->y + dsty, w, h);
|
rdpup_send_area(&id, pDst->x + dstx, pDst->y + dsty, w, h);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
box.x1 = pDst->x + dstx;
|
||||||
|
box.y1 = pDst->y + dsty;
|
||||||
|
box.x2 = box.x1 + w;
|
||||||
|
box.y2 = box.y1 + h;
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
RegionInit(®2, NullBox, 0);
|
||||||
|
RegionCopy(®2, &clip_reg);
|
||||||
|
RegionIntersect(®1, ®1, ®2);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
RegionUninit(®2);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
box.x1 = pDst->x + dstx;
|
box.x1 = pDst->x + dstx;
|
||||||
@ -152,6 +205,11 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
|
|||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -64,6 +65,7 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
{
|
{
|
||||||
RegionRec clip_reg;
|
RegionRec clip_reg;
|
||||||
RegionRec box_reg;
|
RegionRec box_reg;
|
||||||
|
RegionRec reg1;
|
||||||
int num_clips;
|
int num_clips;
|
||||||
int cd;
|
int cd;
|
||||||
int maxx;
|
int maxx;
|
||||||
@ -73,29 +75,49 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpFillPolygon:"));
|
LLOGLN(10, ("rdpFillPolygon:"));
|
||||||
|
|
||||||
/* do original call */
|
/* do original call */
|
||||||
rdpFillPolygonOrg(pDrawable, pGC, shape, mode, count, pPts);
|
rdpFillPolygonOrg(pDrawable, pGC, shape, mode, count, pPts);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpFillPolygon: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLY;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -103,12 +125,13 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -153,17 +176,32 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
RegionInit(&box_reg, &box, 0);
|
RegionInit(&box_reg, &box, 0);
|
||||||
RegionIntersect(&clip_reg, &clip_reg, &box_reg);
|
RegionIntersect(&clip_reg, &clip_reg, &box_reg);
|
||||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, &clip_reg, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (j = num_clips - 1; j >= 0; j--)
|
for (j = num_clips - 1; j >= 0; j--)
|
||||||
@ -173,8 +211,12 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(&box_reg);
|
RegionUninit(&box_reg);
|
||||||
}
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -68,11 +69,15 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
int cd;
|
int cd;
|
||||||
int j;
|
int j;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpImageGlyphBlt:"));
|
LLOGLN(10, ("rdpImageGlyphBlt:"));
|
||||||
|
|
||||||
@ -84,18 +89,34 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpImageGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
rdpImageGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpImageGlyphBlt: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLL;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -103,12 +124,13 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -123,17 +145,32 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||||
}
|
}
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
RegionInit(®1, &box, 0);
|
RegionInit(®1, &box, 0);
|
||||||
RegionIntersect(®, ®, ®1);
|
RegionIntersect(®, ®, ®1);
|
||||||
num_clips = REGION_NUM_RECTS(®);
|
num_clips = REGION_NUM_RECTS(®);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (j = num_clips - 1; j >= 0; j--)
|
for (j = num_clips - 1; j >= 0; j--)
|
||||||
@ -143,9 +180,13 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(®1);
|
RegionUninit(®1);
|
||||||
}
|
}
|
||||||
RegionUninit(®);
|
RegionUninit(®);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -66,11 +67,15 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
int cd;
|
int cd;
|
||||||
int j;
|
int j;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpImageText16:"));
|
LLOGLN(10, ("rdpImageText16:"));
|
||||||
|
|
||||||
@ -82,18 +87,34 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpImageText16Org(pDrawable, pGC, x, y, count, chars);
|
rdpImageText16Org(pDrawable, pGC, x, y, count, chars);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpImageText16: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLY;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -101,12 +122,13 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -121,17 +143,32 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||||
}
|
}
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
RegionInit(®1, &box, 0);
|
RegionInit(®1, &box, 0);
|
||||||
RegionIntersect(®, ®, ®1);
|
RegionIntersect(®, ®, ®1);
|
||||||
num_clips = REGION_NUM_RECTS(®);
|
num_clips = REGION_NUM_RECTS(®);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (j = num_clips - 1; j >= 0; j--)
|
for (j = num_clips - 1; j >= 0; j--)
|
||||||
@ -141,9 +178,13 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(®1);
|
RegionUninit(®1);
|
||||||
}
|
}
|
||||||
RegionUninit(®);
|
RegionUninit(®);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -66,11 +67,15 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
int cd;
|
int cd;
|
||||||
int j;
|
int j;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpImageText8:"));
|
LLOGLN(10, ("rdpImageText8:"));
|
||||||
|
|
||||||
@ -82,18 +87,34 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpImageText8Org(pDrawable, pGC, x, y, count, chars);
|
rdpImageText8Org(pDrawable, pGC, x, y, count, chars);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpImageText8: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLL;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -101,12 +122,13 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -121,17 +143,32 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||||
}
|
}
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
RegionInit(®1, &box, 0);
|
RegionInit(®1, &box, 0);
|
||||||
RegionIntersect(®, ®, ®1);
|
RegionIntersect(®, ®, ®1);
|
||||||
num_clips = REGION_NUM_RECTS(®);
|
num_clips = REGION_NUM_RECTS(®);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (j = num_clips - 1; j >= 0; j--)
|
for (j = num_clips - 1; j >= 0; j--)
|
||||||
@ -141,9 +178,13 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(®1);
|
RegionUninit(®1);
|
||||||
}
|
}
|
||||||
RegionUninit(®);
|
RegionUninit(®);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -66,12 +67,16 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
int i;
|
int i;
|
||||||
int num_clips;
|
int num_clips;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
xRectangle* rects;
|
xRectangle* rects;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolyArc:"));
|
LLOGLN(10, ("rdpPolyArc:"));
|
||||||
|
|
||||||
@ -97,18 +102,34 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPolyArcOrg(pDrawable, pGC, narcs, parcs);
|
rdpPolyArcOrg(pDrawable, pGC, narcs, parcs);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpPolyArc: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLL;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -116,12 +137,13 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
g_free(rects);
|
g_free(rects);
|
||||||
return;
|
return;
|
||||||
@ -136,6 +158,12 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
|
tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
|
||||||
num_clips = REGION_NUM_RECTS(tmpRegion);
|
num_clips = REGION_NUM_RECTS(tmpRegion);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, tmpRegion, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (i = num_clips - 1; i >= 0; i--)
|
for (i = num_clips - 1; i >= 0; i--)
|
||||||
@ -145,6 +173,7 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionDestroy(tmpRegion);
|
RegionDestroy(tmpRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -156,6 +185,12 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
RegionIntersect(tmpRegion, tmpRegion, &clip_reg);
|
RegionIntersect(tmpRegion, tmpRegion, &clip_reg);
|
||||||
num_clips = REGION_NUM_RECTS(tmpRegion);
|
num_clips = REGION_NUM_RECTS(tmpRegion);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, tmpRegion, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (i = num_clips - 1; i >= 0; i--)
|
for (i = num_clips - 1; i >= 0; i--)
|
||||||
@ -165,10 +200,14 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionDestroy(tmpRegion);
|
RegionDestroy(tmpRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
g_free(rects);
|
g_free(rects);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -66,12 +67,16 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
int i;
|
int i;
|
||||||
int num_clips;
|
int num_clips;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
xRectangle* rects;
|
xRectangle* rects;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolyFillArc:"));
|
LLOGLN(10, ("rdpPolyFillArc:"));
|
||||||
|
|
||||||
@ -97,18 +102,34 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPolyFillArcOrg(pDrawable, pGC, narcs, parcs);
|
rdpPolyFillArcOrg(pDrawable, pGC, narcs, parcs);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpPolyFillArc: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLY;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -116,12 +137,13 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
g_free(rects);
|
g_free(rects);
|
||||||
return;
|
return;
|
||||||
@ -136,6 +158,12 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
|
tmpRegion = RegionFromRects(narcs, rects, CT_NONE);
|
||||||
num_clips = REGION_NUM_RECTS(tmpRegion);
|
num_clips = REGION_NUM_RECTS(tmpRegion);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, tmpRegion, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (i = num_clips - 1; i >= 0; i--)
|
for (i = num_clips - 1; i >= 0; i--)
|
||||||
@ -145,6 +173,7 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionDestroy(tmpRegion);
|
RegionDestroy(tmpRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -156,6 +185,12 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
RegionIntersect(tmpRegion, tmpRegion, &clip_reg);
|
RegionIntersect(tmpRegion, tmpRegion, &clip_reg);
|
||||||
num_clips = REGION_NUM_RECTS(tmpRegion);
|
num_clips = REGION_NUM_RECTS(tmpRegion);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, tmpRegion, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (i = num_clips - 1; i >= 0; i--)
|
for (i = num_clips - 1; i >= 0; i--)
|
||||||
@ -165,10 +200,14 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionDestroy(tmpRegion);
|
RegionDestroy(tmpRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
g_free(rects);
|
g_free(rects);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -68,10 +69,15 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
|
|||||||
BoxRec box;
|
BoxRec box;
|
||||||
|
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
|
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolyFillRect:"));
|
LLOGLN(10, ("rdpPolyFillRect:"));
|
||||||
|
|
||||||
@ -81,18 +87,32 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPolyFillRectOrg(pDrawable, pGC, nrectFill, prectInit);
|
rdpPolyFillRectOrg(pDrawable, pGC, nrectFill, prectInit);
|
||||||
|
|
||||||
got_id = 0;
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
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);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -100,12 +120,13 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
RegionDestroy(fill_reg);
|
RegionDestroy(fill_reg);
|
||||||
return;
|
return;
|
||||||
@ -114,6 +135,27 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
|
|||||||
RegionInit(&clip_reg, NullBox, 0);
|
RegionInit(&clip_reg, NullBox, 0);
|
||||||
cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
|
cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
|
||||||
if (cd == 1) /* no clip */
|
if (cd == 1) /* no clip */
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
if (pGC->fillStyle == 0 && /* solid fill */
|
||||||
|
(pGC->alu == GXclear ||
|
||||||
|
pGC->alu == GXset ||
|
||||||
|
pGC->alu == GXinvert ||
|
||||||
|
pGC->alu == GXnoop ||
|
||||||
|
pGC->alu == GXand ||
|
||||||
|
pGC->alu == GXcopy /*||
|
||||||
|
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
|
||||||
|
{
|
||||||
|
draw_item_add_fill_region(pDirtyPriv, fill_reg, pGC->fgPixel,
|
||||||
|
pGC->alu);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, fill_reg, RDI_IMGLL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
if (pGC->fillStyle == 0 && /* solid fill */
|
if (pGC->fillStyle == 0 && /* solid fill */
|
||||||
@ -139,16 +181,39 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
|
|||||||
for (j = REGION_NUM_RECTS(fill_reg) - 1; j >= 0; j--)
|
for (j = REGION_NUM_RECTS(fill_reg) - 1; j >= 0; j--)
|
||||||
{
|
{
|
||||||
box = REGION_RECTS(fill_reg)[j];
|
box = REGION_RECTS(fill_reg)[j];
|
||||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1,
|
||||||
|
box.y2 - box.y1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2) /* clip */
|
else if (cd == 2) /* clip */
|
||||||
{
|
{
|
||||||
RegionIntersect(&clip_reg, &clip_reg, fill_reg);
|
RegionIntersect(&clip_reg, &clip_reg, fill_reg);
|
||||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
if (pGC->fillStyle == 0 && /* solid fill */
|
||||||
|
(pGC->alu == GXclear ||
|
||||||
|
pGC->alu == GXset ||
|
||||||
|
pGC->alu == GXinvert ||
|
||||||
|
pGC->alu == GXnoop ||
|
||||||
|
pGC->alu == GXand ||
|
||||||
|
pGC->alu == GXcopy /*||
|
||||||
|
pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
|
||||||
|
{
|
||||||
|
draw_item_add_fill_region(pDirtyPriv, &clip_reg, pGC->fgPixel,
|
||||||
|
pGC->alu);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, &clip_reg, RDI_IMGLL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
if (pGC->fillStyle == 0 && /* solid fill */
|
if (pGC->fillStyle == 0 && /* solid fill */
|
||||||
@ -180,7 +245,11 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
|
|||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
RegionDestroy(fill_reg);
|
RegionDestroy(fill_reg);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -68,11 +69,15 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
int cd;
|
int cd;
|
||||||
int j;
|
int j;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolyGlyphBlt:"));
|
LLOGLN(10, ("rdpPolyGlyphBlt:"));
|
||||||
|
|
||||||
@ -84,18 +89,34 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPolyGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
rdpPolyGlyphBltOrg(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpPolyGlyphBlt: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLY;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -103,12 +124,13 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -123,17 +145,32 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||||
}
|
}
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
RegionInit(®1, &box, 0);
|
RegionInit(®1, &box, 0);
|
||||||
RegionIntersect(®, ®, ®1);
|
RegionIntersect(®, ®, ®1);
|
||||||
num_clips = REGION_NUM_RECTS(®);
|
num_clips = REGION_NUM_RECTS(®);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (j = num_clips - 1; j >= 0; j--)
|
for (j = num_clips - 1; j >= 0; j--)
|
||||||
@ -143,9 +180,13 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(®1);
|
RegionUninit(®1);
|
||||||
}
|
}
|
||||||
RegionUninit(®);
|
RegionUninit(®);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -68,6 +69,9 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
BoxRec total_box;
|
BoxRec total_box;
|
||||||
DDXPointPtr pts;
|
DDXPointPtr pts;
|
||||||
@ -76,6 +80,7 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolyPoint:"));
|
LLOGLN(10, ("rdpPolyPoint:"));
|
||||||
|
|
||||||
@ -123,18 +128,34 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPolyPointOrg(pDrawable, pGC, mode, npt, in_pts);
|
rdpPolyPointOrg(pDrawable, pGC, mode, npt, in_pts);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpPolyPoint: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLY;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -142,12 +163,13 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -157,6 +179,12 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
{
|
{
|
||||||
if (npt > 0)
|
if (npt > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_set_fgcolor(pGC->fgPixel);
|
rdpup_set_fgcolor(pGC->fgPixel);
|
||||||
@ -169,10 +197,17 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||||
if (npt > 0 && num_clips > 0)
|
if (npt > 0 && num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_set_fgcolor(pGC->fgPixel);
|
rdpup_set_fgcolor(pGC->fgPixel);
|
||||||
@ -191,10 +226,14 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
if (pts != stack_pts)
|
if (pts != stack_pts)
|
||||||
{
|
{
|
||||||
g_free(pts);
|
g_free(pts);
|
||||||
}
|
}
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -71,6 +72,9 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
|
|||||||
int up;
|
int up;
|
||||||
int down;
|
int down;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
xRectangle* regRects;
|
xRectangle* regRects;
|
||||||
xRectangle* r;
|
xRectangle* r;
|
||||||
xRectangle* rect1;
|
xRectangle* rect1;
|
||||||
@ -80,6 +84,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
|
|||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolyRectangle:"));
|
LLOGLN(10, ("rdpPolyRectangle:"));
|
||||||
|
|
||||||
@ -93,18 +98,34 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPolyRectangleOrg(pDrawable, pGC, nrects, rects);
|
rdpPolyRectangleOrg(pDrawable, pGC, nrects, rects);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpPolyRectangle: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLL;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -112,12 +133,13 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
g_free(rect1);
|
g_free(rect1);
|
||||||
return;
|
return;
|
||||||
@ -163,6 +185,12 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
|
|||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
{
|
{
|
||||||
if (regRects != 0)
|
if (regRects != 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
if (pGC->lineStyle == LineSolid)
|
if (pGC->lineStyle == LineSolid)
|
||||||
@ -187,6 +215,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
|
|||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
if (regRects != 0)
|
if (regRects != 0)
|
||||||
@ -195,6 +224,12 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
|
|||||||
RegionIntersect(&clip_reg, &clip_reg, fill_reg);
|
RegionIntersect(&clip_reg, &clip_reg, fill_reg);
|
||||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
if (pGC->lineStyle == LineSolid)
|
if (pGC->lineStyle == LineSolid)
|
||||||
@ -218,11 +253,15 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionDestroy(fill_reg);
|
RegionDestroy(fill_reg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
g_free(regRects);
|
g_free(regRects);
|
||||||
g_free(rect1);
|
g_free(rect1);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -63,12 +64,16 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs)
|
|||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
xSegment* segs;
|
xSegment* segs;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolySegment:"));
|
LLOGLN(10, ("rdpPolySegment:"));
|
||||||
|
|
||||||
@ -88,18 +93,34 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs)
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPolySegmentOrg(pDrawable, pGC, nseg, pSegs);
|
rdpPolySegmentOrg(pDrawable, pGC, nseg, pSegs);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpPolySegment: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLY;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -107,12 +128,13 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs)
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
g_free(segs);
|
g_free(segs);
|
||||||
return;
|
return;
|
||||||
@ -123,6 +145,12 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs)
|
|||||||
if (cd == 1) /* no clip */
|
if (cd == 1) /* no clip */
|
||||||
{
|
{
|
||||||
if (segs != 0)
|
if (segs != 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_set_fgcolor(pGC->fgPixel);
|
rdpup_set_fgcolor(pGC->fgPixel);
|
||||||
@ -136,9 +164,16 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs)
|
|||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2) /* clip */
|
else if (cd == 2) /* clip */
|
||||||
{
|
{
|
||||||
if (segs != 0)
|
if (segs != 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_set_fgcolor(pGC->fgPixel);
|
rdpup_set_fgcolor(pGC->fgPixel);
|
||||||
@ -158,7 +193,11 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs)
|
|||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
g_free(segs);
|
g_free(segs);
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -69,11 +70,15 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
int j;
|
int j;
|
||||||
int rv;
|
int rv;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolyText16:"));
|
LLOGLN(10, ("rdpPolyText16:"));
|
||||||
|
|
||||||
@ -85,18 +90,34 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rv = rdpPolyText16Org(pDrawable, pGC, x, y, count, chars);
|
rv = rdpPolyText16Org(pDrawable, pGC, x, y, count, chars);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpPolyText16: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLY;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -104,12 +125,13 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -124,17 +146,32 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||||
}
|
}
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
RegionInit(®1, &box, 0);
|
RegionInit(®1, &box, 0);
|
||||||
RegionIntersect(®, ®, ®1);
|
RegionIntersect(®, ®, ®1);
|
||||||
num_clips = REGION_NUM_RECTS(®);
|
num_clips = REGION_NUM_RECTS(®);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (j = num_clips - 1; j >= 0; j--)
|
for (j = num_clips - 1; j >= 0; j--)
|
||||||
@ -144,9 +181,13 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(®1);
|
RegionUninit(®1);
|
||||||
}
|
}
|
||||||
RegionUninit(®);
|
RegionUninit(®);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -69,11 +70,15 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
int j;
|
int j;
|
||||||
int rv;
|
int rv;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolyText8:"));
|
LLOGLN(10, ("rdpPolyText8:"));
|
||||||
|
|
||||||
@ -85,18 +90,34 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rv = rdpPolyText8Org(pDrawable, pGC, x, y, count, chars);
|
rv = rdpPolyText8Org(pDrawable, pGC, x, y, count, chars);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpPolyText8: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLY;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -104,12 +125,13 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
@ -124,17 +146,32 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
cd = rdp_get_clip(®, pDrawable, pGC);
|
cd = rdp_get_clip(®, pDrawable, pGC);
|
||||||
}
|
}
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
RegionInit(®1, &box, 0);
|
RegionInit(®1, &box, 0);
|
||||||
RegionIntersect(®, ®, ®1);
|
RegionIntersect(®, ®, ®1);
|
||||||
num_clips = REGION_NUM_RECTS(®);
|
num_clips = REGION_NUM_RECTS(®);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (j = num_clips - 1; j >= 0; j--)
|
for (j = num_clips - 1; j >= 0; j--)
|
||||||
@ -144,9 +181,13 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(®1);
|
RegionUninit(®1);
|
||||||
}
|
}
|
||||||
RegionUninit(®);
|
RegionUninit(®);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -70,12 +71,16 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
int x2;
|
int x2;
|
||||||
int y2;
|
int y2;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
DDXPointPtr ppts;
|
DDXPointPtr ppts;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPolylines:"));
|
LLOGLN(10, ("rdpPolylines:"));
|
||||||
|
|
||||||
@ -92,18 +97,34 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPolylinesOrg(pDrawable, pGC, mode, npt, pptInit);
|
rdpPolylinesOrg(pDrawable, pGC, mode, npt, pptInit);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpPolylines: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
dirty_type = RDI_IMGLL;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -111,12 +132,13 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
g_free(ppts);
|
g_free(ppts);
|
||||||
return;
|
return;
|
||||||
@ -127,6 +149,12 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
{
|
{
|
||||||
if (ppts != 0)
|
if (ppts != 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_set_fgcolor(pGC->fgPixel);
|
rdpup_set_fgcolor(pGC->fgPixel);
|
||||||
@ -154,10 +182,17 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||||
if (ppts != 0 && num_clips > 0)
|
if (ppts != 0 && num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_set_fgcolor(pGC->fgPixel);
|
rdpup_set_fgcolor(pGC->fgPixel);
|
||||||
@ -191,7 +226,11 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
|
|||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
g_free(ppts);
|
g_free(ppts);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -62,33 +63,56 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
|
|||||||
{
|
{
|
||||||
RegionRec clip_reg;
|
RegionRec clip_reg;
|
||||||
RegionRec box_reg;
|
RegionRec box_reg;
|
||||||
|
RegionRec reg1;
|
||||||
int num_clips;
|
int num_clips;
|
||||||
int cd;
|
int cd;
|
||||||
int j;
|
int j;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPushPixels:"));
|
LLOGLN(0, ("rdpPushPixels:"));
|
||||||
|
|
||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPushPixelsOrg(pGC, pBitMap, pDst, w, h, x, y);
|
rdpPushPixelsOrg(pGC, pBitMap, pDst, w, h, x, y);
|
||||||
|
|
||||||
|
//return;
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDst->type == DRAWABLE_PIXMAP)
|
if (pDst->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDst;
|
pDstPixmap = (PixmapPtr)pDst;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
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);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDst->type == DRAWABLE_WINDOW)
|
if (pDst->type == DRAWABLE_WINDOW)
|
||||||
@ -96,12 +120,13 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
|
|||||||
pDstWnd = (WindowPtr)pDst;
|
pDstWnd = (WindowPtr)pDst;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -110,17 +135,42 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
|
|||||||
RegionInit(&clip_reg, NullBox, 0);
|
RegionInit(&clip_reg, NullBox, 0);
|
||||||
cd = rdp_get_clip(&clip_reg, pDst, pGC);
|
cd = rdp_get_clip(&clip_reg, pDst, pGC);
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
box.x1 = pDst->x + x;
|
||||||
|
box.y1 = pDst->y + y;
|
||||||
|
box.x2 = box.x1 + w;
|
||||||
|
box.y2 = box.y1 + h;
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(0, x, y, w, h);
|
rdpup_send_area(0, pDst->x + x, pDst->y + y, w, h);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
{
|
{
|
||||||
|
box.x1 = pDst->x + x;
|
||||||
|
box.y1 = pDst->y + y;
|
||||||
|
box.x2 = box.x1 + w;
|
||||||
|
box.y2 = box.y1 + h;
|
||||||
RegionInit(&box_reg, &box, 0);
|
RegionInit(&box_reg, &box, 0);
|
||||||
RegionIntersect(&clip_reg, &clip_reg, &box_reg);
|
RegionIntersect(&clip_reg, &clip_reg, &box_reg);
|
||||||
num_clips = REGION_NUM_RECTS(&clip_reg);
|
num_clips = REGION_NUM_RECTS(&clip_reg);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, &clip_reg, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (j = num_clips - 1; j >= 0; j--)
|
for (j = num_clips - 1; j >= 0; j--)
|
||||||
@ -130,8 +180,12 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(&box_reg);
|
RegionUninit(&box_reg);
|
||||||
}
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -64,31 +65,54 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
|
|||||||
RegionRec clip_reg;
|
RegionRec clip_reg;
|
||||||
int cd;
|
int cd;
|
||||||
int j;
|
int j;
|
||||||
|
int reset_surface;
|
||||||
|
int post_process;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
|
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
RegionRec reg1;
|
||||||
|
RegionRec reg2;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpPutImage:"));
|
LLOGLN(10, ("rdpPutImage:"));
|
||||||
LLOGLN(10, ("rdpPutImage: drawable id 0x%x", (int)(pDst->id)));
|
LLOGLN(10, ("rdpPutImage: drawable id 0x%x", (int)(pDst->id)));
|
||||||
|
|
||||||
/* do original call */
|
/* do original call */
|
||||||
rdpPutImageOrg(pDst, pGC, depth, x, y, w, h, leftPad, format, pBits);
|
rdpPutImageOrg(pDst, pGC, depth, x, y, w, h, leftPad, format, pBits);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDst->type == DRAWABLE_PIXMAP)
|
if (pDst->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDst;
|
pDstPixmap = (PixmapPtr)pDst;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
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);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDst->type == DRAWABLE_WINDOW)
|
if (pDst->type == DRAWABLE_WINDOW)
|
||||||
@ -96,24 +120,54 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
|
|||||||
pDstWnd = (WindowPtr)pDst;
|
pDstWnd = (WindowPtr)pDst;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RegionInit(&clip_reg, NullBox, 0);
|
RegionInit(&clip_reg, NullBox, 0);
|
||||||
cd = rdp_get_clip(&clip_reg, pDst, pGC);
|
cd = rdp_get_clip(&clip_reg, pDst, pGC);
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
box.x1 = pDst->x + x;
|
||||||
|
box.y1 = pDst->y + y;
|
||||||
|
box.x2 = box.x1 + w;
|
||||||
|
box.y2 = box.y1 + h;
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, pDst->x + x, pDst->y + y, w, h);
|
rdpup_send_area(&id, pDst->x + x, pDst->y + y, w, h);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cd == 2)
|
else if (cd == 2)
|
||||||
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
box.x1 = pDst->x + x;
|
||||||
|
box.y1 = pDst->y + y;
|
||||||
|
box.x2 = box.x1 + w;
|
||||||
|
box.y2 = box.y1 + h;
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
RegionInit(®2, NullBox, 0);
|
||||||
|
RegionCopy(®2, &clip_reg);
|
||||||
|
RegionIntersect(®1, ®1, ®2);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
RegionUninit(®2);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
{
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--)
|
for (j = REGION_NUM_RECTS(&clip_reg) - 1; j >= 0; j--)
|
||||||
@ -125,6 +179,10 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
|
|||||||
rdpup_reset_clip();
|
rdpup_reset_clip();
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(&clip_reg);
|
RegionUninit(&clip_reg);
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ extern DevPrivateKeyRec g_rdpPixmapIndex; /* from rdpmain.c */
|
|||||||
extern int g_Bpp; /* from rdpmain.c */
|
extern int g_Bpp; /* from rdpmain.c */
|
||||||
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
||||||
|
extern int g_do_dirty_os; /* in rdpmain.c */
|
||||||
|
|
||||||
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
extern GCOps g_rdpGCOps; /* from rdpdraw.c */
|
||||||
|
|
||||||
@ -63,29 +64,48 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc,
|
|||||||
RegionRec clip_reg;
|
RegionRec clip_reg;
|
||||||
int cd;
|
int cd;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int dirty_type;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
|
|
||||||
LLOGLN(0, ("rdpSetSpans: todo"));
|
LLOGLN(0, ("rdpSetSpans: todo"));
|
||||||
|
|
||||||
/* do original call */
|
/* do original call */
|
||||||
rdpSetSpansOrg(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
|
rdpSetSpansOrg(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (pDrawable->type == DRAWABLE_PIXMAP)
|
if (pDrawable->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)pDrawable;
|
pDstPixmap = (PixmapPtr)pDrawable;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
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);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (pDrawable->type == DRAWABLE_WINDOW)
|
if (pDrawable->type == DRAWABLE_WINDOW)
|
||||||
@ -93,12 +113,13 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc,
|
|||||||
pDstWnd = (WindowPtr)pDrawable;
|
pDstWnd = (WindowPtr)pDrawable;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -106,10 +127,25 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc,
|
|||||||
cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
|
cd = rdp_get_clip(&clip_reg, pDrawable, pGC);
|
||||||
if (cd == 1)
|
if (cd == 1)
|
||||||
{
|
{
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (cd == 2)
|
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);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,12 @@ extern ScreenPtr g_pScreen; /* from rdpmain.c */
|
|||||||
extern Bool g_wrapPixmap; /* from rdpmain.c */
|
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 */
|
||||||
|
|
||||||
ColormapPtr g_rdpInstalledColormap;
|
ColormapPtr g_rdpInstalledColormap;
|
||||||
|
|
||||||
|
static int g_doing_font = 0;
|
||||||
|
|
||||||
GCFuncs g_rdpGCFuncs =
|
GCFuncs g_rdpGCFuncs =
|
||||||
{
|
{
|
||||||
rdpValidateGC, rdpChangeGC, rdpCopyGC, rdpDestroyGC, rdpChangeClip,
|
rdpValidateGC, rdpChangeGC, rdpCopyGC, rdpDestroyGC, rdpChangeClip,
|
||||||
@ -317,7 +320,7 @@ rdpChangeClip(GCPtr pGC, int type, pointer pValue, int nrects)
|
|||||||
{
|
{
|
||||||
rdpGCRec* priv;
|
rdpGCRec* priv;
|
||||||
|
|
||||||
LLOGLN(0, ("in rdpChangeClip"));
|
LLOGLN(10, ("in rdpChangeClip"));
|
||||||
GC_FUNC_PROLOGUE(pGC);
|
GC_FUNC_PROLOGUE(pGC);
|
||||||
pGC->funcs->ChangeClip(pGC, type, pValue, nrects);
|
pGC->funcs->ChangeClip(pGC, type, pValue, nrects);
|
||||||
GC_FUNC_EPILOGUE(pGC);
|
GC_FUNC_EPILOGUE(pGC);
|
||||||
@ -379,6 +382,180 @@ rdpCloseScreen(int i, ScreenPtr pScreen)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
int
|
||||||
|
draw_item_add(rdpPixmapRec* priv, struct rdp_draw_item* di)
|
||||||
|
{
|
||||||
|
if (priv->draw_item_tail == 0)
|
||||||
|
{
|
||||||
|
priv->draw_item_tail = di;
|
||||||
|
priv->draw_item_head = di;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
di->prev = priv->draw_item_tail;
|
||||||
|
priv->draw_item_tail->next = di;
|
||||||
|
priv->draw_item_tail = di;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
int
|
||||||
|
draw_item_remove(rdpPixmapRec* priv, struct rdp_draw_item* di)
|
||||||
|
{
|
||||||
|
if (di->prev != 0)
|
||||||
|
{
|
||||||
|
di->prev->next = di->next;
|
||||||
|
}
|
||||||
|
if (di->next != 0)
|
||||||
|
{
|
||||||
|
di->next->prev = di->prev;
|
||||||
|
}
|
||||||
|
if (priv->draw_item_head == di)
|
||||||
|
{
|
||||||
|
priv->draw_item_head = di->next;
|
||||||
|
}
|
||||||
|
if (priv->draw_item_tail == di)
|
||||||
|
{
|
||||||
|
priv->draw_item_tail = di->prev;
|
||||||
|
}
|
||||||
|
RegionDestroy(di->reg);
|
||||||
|
free(di);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
int
|
||||||
|
draw_item_remove_all(rdpPixmapRec* priv)
|
||||||
|
{
|
||||||
|
struct rdp_draw_item* di;
|
||||||
|
|
||||||
|
di = priv->draw_item_head;
|
||||||
|
while (di != 0)
|
||||||
|
{
|
||||||
|
draw_item_remove(priv, di);
|
||||||
|
di = priv->draw_item_head;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
int
|
||||||
|
draw_item_pack(rdpPixmapRec* priv)
|
||||||
|
{
|
||||||
|
struct rdp_draw_item* di;
|
||||||
|
struct rdp_draw_item* di_prev;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
/* look for repeating draw types */
|
||||||
|
if (priv->draw_item_head != 0)
|
||||||
|
{
|
||||||
|
if (priv->draw_item_head->next != 0)
|
||||||
|
{
|
||||||
|
di_prev = priv->draw_item_head;
|
||||||
|
di = priv->draw_item_head->next;
|
||||||
|
while (di != 0)
|
||||||
|
{
|
||||||
|
if ((di_prev->type == RDI_IMGLL) && (di->type == RDI_IMGLL))
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("draw_item_pack: packing RDI_IMGLL"));
|
||||||
|
RegionUnion(di_prev->reg, di_prev->reg, di->reg);
|
||||||
|
draw_item_remove(priv, di);
|
||||||
|
di = di_prev->next;
|
||||||
|
}
|
||||||
|
else if ((di_prev->type == RDI_IMGLY) && (di->type == RDI_IMGLY))
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("draw_item_pack: packing RDI_IMGLY"));
|
||||||
|
RegionUnion(di_prev->reg, di_prev->reg, di->reg);
|
||||||
|
draw_item_remove(priv, di);
|
||||||
|
di = di_prev->next;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
di_prev = di;
|
||||||
|
di = di_prev->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if 1
|
||||||
|
/* subtract regions */
|
||||||
|
if (priv->draw_item_tail != 0)
|
||||||
|
{
|
||||||
|
if (priv->draw_item_tail->prev != 0)
|
||||||
|
{
|
||||||
|
di = priv->draw_item_tail;
|
||||||
|
while (di->prev != 0)
|
||||||
|
{
|
||||||
|
di_prev = di->prev;
|
||||||
|
while (di_prev != 0)
|
||||||
|
{
|
||||||
|
/* D = M - S */
|
||||||
|
RegionSubtract(di_prev->reg, di_prev->reg, di->reg);
|
||||||
|
di_prev = di_prev->prev;
|
||||||
|
}
|
||||||
|
di = di->prev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#if 1
|
||||||
|
/* remove draw items with empty regions */
|
||||||
|
di = priv->draw_item_head;
|
||||||
|
di_prev = 0;
|
||||||
|
while (di != 0)
|
||||||
|
{
|
||||||
|
if (!RegionNotEmpty(di->reg))
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("draw_item_pack: removing empty item type %d", di->type));
|
||||||
|
draw_item_remove(priv, di);
|
||||||
|
di = di_prev == 0 ? priv->draw_item_head : di_prev->next;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
di_prev = di;
|
||||||
|
di = di->next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
int
|
||||||
|
draw_item_add_img_region(rdpPixmapRec* priv, RegionPtr reg, int type)
|
||||||
|
{
|
||||||
|
struct rdp_draw_item* di;
|
||||||
|
|
||||||
|
di = (struct rdp_draw_item*)malloc(sizeof(struct rdp_draw_item));
|
||||||
|
memset(di, 0, sizeof(struct rdp_draw_item));
|
||||||
|
di->type = type;
|
||||||
|
di->reg = RegionCreate(NullBox, 0);
|
||||||
|
RegionCopy(di->reg, reg);
|
||||||
|
draw_item_add(priv, di);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
int
|
||||||
|
draw_item_add_fill_region(rdpPixmapRec* priv, RegionPtr reg, int color,
|
||||||
|
int opcode)
|
||||||
|
{
|
||||||
|
struct rdp_draw_item* di;
|
||||||
|
|
||||||
|
di = (struct rdp_draw_item*)malloc(sizeof(struct rdp_draw_item));
|
||||||
|
memset(di, 0, sizeof(struct rdp_draw_item));
|
||||||
|
di->type = RDI_FILL;
|
||||||
|
di->fg_color = color;
|
||||||
|
di->opcode = opcode;
|
||||||
|
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,
|
||||||
@ -391,12 +568,13 @@ rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
|||||||
org_width = width;
|
org_width = width;
|
||||||
/* width must be a multiple of 4 in rdp */
|
/* width must be a multiple of 4 in rdp */
|
||||||
width = (width + 3) & ~3;
|
width = (width + 3) & ~3;
|
||||||
LLOGLN(10, ("rdpCreatePixmap: width %d org_width %d", width, org_width));
|
LLOGLN(10, ("rdpCreatePixmap: width %d org_width %d depth %d screen depth %d",
|
||||||
|
width, org_width, depth, g_rdpScreen.depth));
|
||||||
pScreen->CreatePixmap = g_rdpScreen.CreatePixmap;
|
pScreen->CreatePixmap = g_rdpScreen.CreatePixmap;
|
||||||
rv = pScreen->CreatePixmap(pScreen, width, height, depth, usage_hint);
|
rv = pScreen->CreatePixmap(pScreen, width, height, depth, usage_hint);
|
||||||
priv = GETPIXPRIV(rv);
|
priv = GETPIXPRIV(rv);
|
||||||
priv->rdpindex = -1;
|
priv->rdpindex = -1;
|
||||||
if ((rv->drawable.depth == g_rdpScreen.depth) &&
|
if ((rv->drawable.depth >= g_rdpScreen.depth) &&
|
||||||
(org_width > 1) && (height > 1))
|
(org_width > 1) && (height > 1))
|
||||||
{
|
{
|
||||||
priv->allocBytes = width * height * g_Bpp;
|
priv->allocBytes = width * height * g_Bpp;
|
||||||
@ -406,6 +584,8 @@ rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
|
|||||||
priv->status = 1;
|
priv->status = 1;
|
||||||
rdpup_create_os_surface(priv->rdpindex, width, height);
|
rdpup_create_os_surface(priv->rdpindex, width, height);
|
||||||
}
|
}
|
||||||
|
//priv->reg_lossy = RegionCreate(NullBox, 0);
|
||||||
|
//priv->reg_lossless = RegionCreate(NullBox, 0);
|
||||||
}
|
}
|
||||||
pScreen->ModifyPixmapHeader(rv, org_width, 0, 0, 0, 0, 0);
|
pScreen->ModifyPixmapHeader(rv, org_width, 0, 0, 0, 0, 0);
|
||||||
pScreen->CreatePixmap = rdpCreatePixmap;
|
pScreen->CreatePixmap = rdpCreatePixmap;
|
||||||
@ -429,6 +609,9 @@ rdpDestroyPixmap(PixmapPtr pPixmap)
|
|||||||
{
|
{
|
||||||
rdpup_remove_os_bitmap(priv->rdpindex);
|
rdpup_remove_os_bitmap(priv->rdpindex);
|
||||||
rdpup_delete_os_surface(priv->rdpindex);
|
rdpup_delete_os_surface(priv->rdpindex);
|
||||||
|
//RegionDestroy(priv->reg_lossy);
|
||||||
|
//RegionDestroy(priv->reg_lossless);
|
||||||
|
draw_item_remove_all(priv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pScreen = pPixmap->drawable.pScreen;
|
pScreen = pPixmap->drawable.pScreen;
|
||||||
@ -833,12 +1016,18 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|||||||
RegionRec reg1;
|
RegionRec reg1;
|
||||||
RegionRec reg2;
|
RegionRec reg2;
|
||||||
DrawablePtr p;
|
DrawablePtr p;
|
||||||
|
int dirty_type;
|
||||||
int j;
|
int j;
|
||||||
int num_clips;
|
int num_clips;
|
||||||
|
int post_process;
|
||||||
|
int reset_surface;
|
||||||
int got_id;
|
int got_id;
|
||||||
|
int lx;
|
||||||
|
int ly;
|
||||||
WindowPtr pDstWnd;
|
WindowPtr pDstWnd;
|
||||||
PixmapPtr pDstPixmap;
|
PixmapPtr pDstPixmap;
|
||||||
rdpPixmapRec* pDstPriv;
|
rdpPixmapRec* pDstPriv;
|
||||||
|
rdpPixmapRec* pDirtyPriv;
|
||||||
struct image_data id;
|
struct image_data id;
|
||||||
|
|
||||||
LLOGLN(10, ("rdpComposite:"));
|
LLOGLN(10, ("rdpComposite:"));
|
||||||
@ -850,16 +1039,34 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|||||||
|
|
||||||
p = pDst->pDrawable;
|
p = pDst->pDrawable;
|
||||||
|
|
||||||
|
dirty_type = 0;
|
||||||
|
pDirtyPriv = 0;
|
||||||
|
post_process = 0;
|
||||||
|
reset_surface = 0;
|
||||||
got_id = 0;
|
got_id = 0;
|
||||||
if (p->type == DRAWABLE_PIXMAP)
|
if (p->type == DRAWABLE_PIXMAP)
|
||||||
{
|
{
|
||||||
pDstPixmap = (PixmapPtr)p;
|
pDstPixmap = (PixmapPtr)p;
|
||||||
pDstPriv = GETPIXPRIV(pDstPixmap);
|
pDstPriv = GETPIXPRIV(pDstPixmap);
|
||||||
if (XRDP_IS_OS(pDstPriv))
|
if (XRDP_IS_OS(pDstPriv))
|
||||||
|
{
|
||||||
|
post_process = 1;
|
||||||
|
if (g_do_dirty_os)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpComposite: gettig dirty"));
|
||||||
|
pDstPriv->is_dirty = 1;
|
||||||
|
dirty_type = g_doing_font ? RDI_IMGLL : RDI_IMGLY;
|
||||||
|
pDirtyPriv = pDstPriv;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
rdpup_switch_os_surface(pDstPriv->rdpindex);
|
||||||
|
reset_surface = 1;
|
||||||
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
rdpup_get_pixmap_image_rect(pDstPixmap, &id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
|
LLOGLN(10, ("rdpComposite: offscreen"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -869,12 +1076,14 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|||||||
pDstWnd = (WindowPtr)p;
|
pDstWnd = (WindowPtr)p;
|
||||||
if (pDstWnd->viewable)
|
if (pDstWnd->viewable)
|
||||||
{
|
{
|
||||||
|
post_process = 1;
|
||||||
rdpup_get_screen_image_rect(&id);
|
rdpup_get_screen_image_rect(&id);
|
||||||
got_id = 1;
|
got_id = 1;
|
||||||
|
LLOGLN(10, ("rdpComposite: screen"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!got_id)
|
if (!post_process)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -888,9 +1097,16 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|||||||
RegionInit(®1, &box, 0);
|
RegionInit(®1, &box, 0);
|
||||||
RegionInit(®2, NullBox, 0);
|
RegionInit(®2, NullBox, 0);
|
||||||
RegionCopy(®2, pDst->clientClip);
|
RegionCopy(®2, pDst->clientClip);
|
||||||
RegionTranslate(®2, p->x + pDst->clipOrigin.x,
|
lx = p->x + pDst->clipOrigin.x;
|
||||||
p->y + pDst->clipOrigin.y);
|
ly = p->y + pDst->clipOrigin.y;
|
||||||
|
RegionTranslate(®2, lx, ly);
|
||||||
RegionIntersect(®1, ®1, ®2);
|
RegionIntersect(®1, ®1, ®2);
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
|
{
|
||||||
num_clips = REGION_NUM_RECTS(®1);
|
num_clips = REGION_NUM_RECTS(®1);
|
||||||
if (num_clips > 0)
|
if (num_clips > 0)
|
||||||
{
|
{
|
||||||
@ -902,6 +1118,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|||||||
}
|
}
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
RegionUninit(®1);
|
RegionUninit(®1);
|
||||||
RegionUninit(®2);
|
RegionUninit(®2);
|
||||||
}
|
}
|
||||||
@ -911,11 +1128,23 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|||||||
box.y1 = p->y + yDst;
|
box.y1 = p->y + yDst;
|
||||||
box.x2 = box.x1 + width;
|
box.x2 = box.x1 + width;
|
||||||
box.y2 = box.y1 + height;
|
box.y2 = box.y1 + height;
|
||||||
|
if (dirty_type != 0)
|
||||||
|
{
|
||||||
|
RegionInit(®1, &box, 0);
|
||||||
|
draw_item_add_img_region(pDirtyPriv, ®1, dirty_type);
|
||||||
|
RegionUninit(®1);
|
||||||
|
}
|
||||||
|
else if (got_id)
|
||||||
|
{
|
||||||
rdpup_begin_update();
|
rdpup_begin_update();
|
||||||
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
rdpup_send_area(&id, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
|
||||||
rdpup_end_update();
|
rdpup_end_update();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (reset_surface)
|
||||||
|
{
|
||||||
rdpup_switch_os_surface(-1);
|
rdpup_switch_os_surface(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
@ -931,6 +1160,7 @@ rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
|||||||
LLOGLN(10, ("rdpGlyphs:"));
|
LLOGLN(10, ("rdpGlyphs:"));
|
||||||
LLOGLN(10, ("rdpGlyphs: nlists %d len %d", nlists, lists->len));
|
LLOGLN(10, ("rdpGlyphs: nlists %d len %d", nlists, lists->len));
|
||||||
rdpup_set_hints(1, 1);
|
rdpup_set_hints(1, 1);
|
||||||
|
g_doing_font = 1;
|
||||||
for (index = 0; index < lists->len; index++)
|
for (index = 0; index < lists->len; index++)
|
||||||
{
|
{
|
||||||
LLOGLN(10, (" index %d size %d refcnt %d width %d height %d",
|
LLOGLN(10, (" index %d size %d refcnt %d width %d height %d",
|
||||||
@ -943,5 +1173,6 @@ rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
|
|||||||
nlists, lists, glyphs);
|
nlists, lists, glyphs);
|
||||||
ps->Glyphs = rdpGlyphs;
|
ps->Glyphs = rdpGlyphs;
|
||||||
rdpup_set_hints(0, 1);
|
rdpup_set_hints(0, 1);
|
||||||
|
g_doing_font = 0;
|
||||||
LLOGLN(10, ("rdpGlyphs: out"));
|
LLOGLN(10, ("rdpGlyphs: out"));
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ DevPrivateKeyRec g_rdpPixmapIndex;
|
|||||||
DeviceIntPtr g_pointer = 0;
|
DeviceIntPtr g_pointer = 0;
|
||||||
DeviceIntPtr g_keyboard = 0;
|
DeviceIntPtr g_keyboard = 0;
|
||||||
|
|
||||||
|
int g_do_dirty_os = 1; /* delay remoting off screen bitmaps */
|
||||||
Bool g_wrapWindow = 1;
|
Bool g_wrapWindow = 1;
|
||||||
Bool g_wrapPixmap = 1;
|
Bool g_wrapPixmap = 1;
|
||||||
|
|
||||||
|
@ -1590,3 +1590,79 @@ rdpup_delete_window(WindowPtr pWindow, rdpWindowRec* priv)
|
|||||||
out_uint32_le(g_out_s, pWindow->drawable.id); /* window_id */
|
out_uint32_le(g_out_s, pWindow->drawable.id); /* window_id */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
int
|
||||||
|
rdpup_check_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec* pDirtyPriv)
|
||||||
|
{
|
||||||
|
int index;
|
||||||
|
int count;
|
||||||
|
BoxRec box;
|
||||||
|
struct image_data id;
|
||||||
|
struct rdp_draw_item* di;
|
||||||
|
|
||||||
|
if (pDirtyPriv == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (pDirtyPriv->is_dirty == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* update uses time / count */
|
||||||
|
g_os_bitmaps[pDirtyPriv->rdpindex].stamp = g_os_bitmap_stamp;
|
||||||
|
g_os_bitmap_stamp++;
|
||||||
|
|
||||||
|
LLOGLN(10, ("-----------------got dirty"));
|
||||||
|
rdpup_switch_os_surface(pDirtyPriv->rdpindex);
|
||||||
|
rdpup_get_pixmap_image_rect(pDirtyPixmap, &id);
|
||||||
|
rdpup_begin_update();
|
||||||
|
draw_item_pack(pDirtyPriv);
|
||||||
|
di = pDirtyPriv->draw_item_head;
|
||||||
|
while (di != 0)
|
||||||
|
{
|
||||||
|
LLOGLN(10, ("rdpup_check_dirty: type %d", di->type));
|
||||||
|
switch (di->type)
|
||||||
|
{
|
||||||
|
case RDI_FILL:
|
||||||
|
rdpup_set_fgcolor(di->fg_color);
|
||||||
|
rdpup_set_opcode(di->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);
|
||||||
|
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_hints(0, 1);
|
||||||
|
break;
|
||||||
|
case RDI_IMGLY:
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
di = di->next;
|
||||||
|
}
|
||||||
|
draw_item_remove_all(pDirtyPriv);
|
||||||
|
rdpup_end_update();
|
||||||
|
pDirtyPriv->is_dirty = 0;
|
||||||
|
rdpup_switch_os_surface(-1);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user