xorg: work on offscreen bitmaps

master
Jay Sorg 13 years ago
parent cc3754a2bd
commit aa3fad894d

@ -173,7 +173,7 @@ typedef rdpWindowRec* rdpWindowPtr;
struct _rdpPixmapRec struct _rdpPixmapRec
{ {
int status; int status;
int rdpid; /* unique id for xrdp */ int rdpindex;
int allocBytes; int allocBytes;
int con_number; int con_number;
}; };
@ -182,8 +182,7 @@ typedef rdpPixmapRec* rdpPixmapPtr;
#define GETPIXPRIV(_pPixmap) \ #define GETPIXPRIV(_pPixmap) \
(rdpPixmapPtr)dixGetPrivateAddr(&(_pPixmap->devPrivates), &g_rdpPixmapIndex) (rdpPixmapPtr)dixGetPrivateAddr(&(_pPixmap->devPrivates), &g_rdpPixmapIndex)
#define XRDP_IS_OS(_priv) ((_priv->status != 0) && \ #define XRDP_IS_OS(_priv) (_priv->status != 0)
(_priv->con_number == g_con_number))
/* rdpmisc.c */ /* rdpmisc.c */
void void
@ -336,6 +335,10 @@ void
KbdSync(int param1); KbdSync(int param1);
/* rdpup.c */ /* rdpup.c */
int
rdpup_add_os_bitmap(PixmapPtr pixmap, rdpPixmapPtr priv);
int
rdpup_remove_os_bitmap(int rdpindex);
void void
rdpup_get_screen_image_rect(struct image_data* id); rdpup_get_screen_image_rect(struct image_data* id);
void void
@ -375,15 +378,15 @@ rdpup_send_area(struct image_data* id, int x, int y, int w, int h);
int int
rdpup_set_cursor(short x, short y, char* cur_data, char* cur_mask); rdpup_set_cursor(short x, short y, char* cur_data, char* cur_mask);
int int
rdpup_create_os_surface(int rdpid, int width, int height); rdpup_create_os_surface(int rdpindexd, int width, int height);
int int
rdpup_switch_os_surface(int rdpid); rdpup_switch_os_surface(int rdpindex);
int int
rdpup_delete_os_surface(int rdpid); rdpup_delete_os_surface(int rdpindex);
void void
rdpup_paint_rect_os(int x, int y, int cx, int cy, rdpup_paint_rect_os(int x, int y, int cx, int cy,
int rdpid, int srcx, int srcy); int rdpindex, int srcx, int srcy);
void void
rdpup_set_hints(int hints, int mask); rdpup_set_hints(int hints, int mask);

@ -158,7 +158,7 @@ rdpCopyAreaWndToPixmap(WindowPtr pSrcWnd,
ldsty = pDstPixmap->drawable.y + dsty; ldsty = pDstPixmap->drawable.y + dsty;
if (cd == 1) if (cd == 1)
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_begin_update(); rdpup_begin_update();
rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy); rdpup_screen_blt(ldstx, ldsty, w, h, lsrcx, lsrcy);
rdpup_end_update(); rdpup_end_update();
@ -169,7 +169,7 @@ rdpCopyAreaWndToPixmap(WindowPtr pSrcWnd,
num_clips = REGION_NUM_RECTS(&clip_reg); num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0) if (num_clips > 0)
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_begin_update(); rdpup_begin_update();
dx = dstx - srcx; dx = dstx - srcx;
dy = dsty - srcy; dy = dsty - srcy;
@ -232,7 +232,7 @@ rdpCopyAreaPixmapToWnd(PixmapPtr pSrcPixmap, rdpPixmapRec* pSrcPriv,
if (cd == 1) if (cd == 1)
{ {
rdpup_begin_update(); rdpup_begin_update();
rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpid, lsrcx, lsrcy); rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy);
rdpup_end_update(); rdpup_end_update();
} }
else if (cd == 2) else if (cd == 2)
@ -246,7 +246,7 @@ rdpCopyAreaPixmapToWnd(PixmapPtr pSrcPixmap, rdpPixmapRec* pSrcPriv,
box = REGION_RECTS(&clip_reg)[j]; box = REGION_RECTS(&clip_reg)[j];
LLOGLN(10, ("rdpCopyAreaPixmapToWnd: %d %d %d %d", box.x1, box.y1, box.x2, box.y2)); LLOGLN(10, ("rdpCopyAreaPixmapToWnd: %d %d %d %d", box.x1, box.y1, box.x2, box.y2));
rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpid, lsrcx, lsrcy); rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy);
} }
rdpup_reset_clip(); rdpup_reset_clip();
rdpup_end_update(); rdpup_end_update();
@ -287,9 +287,9 @@ rdpCopyAreaPixmapToPixmap(PixmapPtr pSrcPixmap, rdpPixmapRec* pSrcPriv,
lsrcy = pSrcPixmap->drawable.y + srcy; lsrcy = pSrcPixmap->drawable.y + srcy;
if (cd == 1) if (cd == 1)
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_begin_update(); rdpup_begin_update();
rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpid, lsrcx, lsrcy); rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy);
rdpup_end_update(); rdpup_end_update();
rdpup_switch_os_surface(-1); rdpup_switch_os_surface(-1);
} }
@ -298,13 +298,13 @@ rdpCopyAreaPixmapToPixmap(PixmapPtr pSrcPixmap, rdpPixmapRec* pSrcPriv,
num_clips = REGION_NUM_RECTS(&clip_reg); num_clips = REGION_NUM_RECTS(&clip_reg);
if (num_clips > 0) if (num_clips > 0)
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_begin_update(); rdpup_begin_update();
for (j = 0; j < num_clips; j++) for (j = 0; j < num_clips; j++)
{ {
box = REGION_RECTS(&clip_reg)[j]; box = REGION_RECTS(&clip_reg)[j];
rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); rdpup_set_clip(box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1);
rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpid, lsrcx, lsrcy); rdpup_paint_rect_os(ldstx, ldsty, w, h, pSrcPriv->rdpindex, lsrcx, lsrcy);
} }
rdpup_reset_clip(); rdpup_reset_clip();
rdpup_end_update(); rdpup_end_update();
@ -414,7 +414,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_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -91,7 +91,7 @@ rdpCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -91,7 +91,7 @@ rdpFillPolygon(DrawablePtr pDrawable, GCPtr pGC,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -80,7 +80,7 @@ rdpFillSpans(DrawablePtr pDrawable, GCPtr pGC, int nInit,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -91,7 +91,7 @@ rdpImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -89,7 +89,7 @@ rdpImageText16(DrawablePtr pDrawable, GCPtr pGC,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -89,7 +89,7 @@ rdpImageText8(DrawablePtr pDrawable, GCPtr pGC,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -104,7 +104,7 @@ rdpPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -104,7 +104,7 @@ rdpPolyFillArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc* parcs)
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -88,7 +88,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -91,7 +91,7 @@ rdpPolyGlyphBlt(DrawablePtr pDrawable, GCPtr pGC,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -130,7 +130,7 @@ rdpPolyPoint(DrawablePtr pDrawable, GCPtr pGC, int mode,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -100,7 +100,7 @@ rdpPolyRectangle(DrawablePtr pDrawable, GCPtr pGC, int nrects,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -95,7 +95,7 @@ rdpPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment* pSegs)
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -92,7 +92,7 @@ rdpPolyText16(DrawablePtr pDrawable, GCPtr pGC,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -92,7 +92,7 @@ rdpPolyText8(DrawablePtr pDrawable, GCPtr pGC,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -99,7 +99,7 @@ rdpPolylines(DrawablePtr pDrawable, GCPtr pGC, int mode,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -84,7 +84,7 @@ rdpPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -73,7 +73,7 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
rdpPixmapRec* pDstPriv; rdpPixmapRec* pDstPriv;
LLOGLN(10, ("rdpPutImage:")); LLOGLN(10, ("rdpPutImage:"));
LLOGLN(10, ("rdpPutImage: drawable id 0x%x", 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);
@ -84,7 +84,7 @@ rdpPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -81,7 +81,7 @@ rdpSetSpans(DrawablePtr pDrawable, GCPtr pGC, char* psrc,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }

@ -68,15 +68,8 @@ 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_con_number; /* in rdpup.c */
extern int g_connected; /* in rdpup.c */
ColormapPtr g_rdpInstalledColormap; ColormapPtr g_rdpInstalledColormap;
static int g_pixmap_rdpid = 1;
int g_pixmap_byte_total = 0;
int g_pixmap_num_used = 0;
GCFuncs g_rdpGCFuncs = GCFuncs g_rdpGCFuncs =
{ {
rdpValidateGC, rdpChangeGC, rdpCopyGC, rdpDestroyGC, rdpChangeClip, rdpValidateGC, rdpChangeGC, rdpCopyGC, rdpDestroyGC, rdpChangeClip,
@ -408,20 +401,17 @@ rdpCreatePixmap(ScreenPtr pScreen, int width, int height, int 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);
if ((g_rdpScreen.client_info.offscreen_support_level > 0) && priv->rdpindex = -1;
(rv->drawable.depth == g_rdpScreen.depth) && if ((rv->drawable.depth == g_rdpScreen.depth) &&
(org_width > 1) && (height > 1) && g_connected) (org_width > 1) && (height > 1))
{
priv->allocBytes = width * height * g_Bpp;
priv->rdpindex = rdpup_add_os_bitmap(rv, priv);
if (priv->rdpindex >= 0)
{ {
priv->allocBytes = width * height * 4;
g_pixmap_byte_total += priv->allocBytes;
g_pixmap_num_used++;
priv->status = 1; priv->status = 1;
priv->rdpid = g_pixmap_rdpid; rdpup_create_os_surface(priv->rdpindex, width, height);
g_pixmap_rdpid++; }
priv->con_number = g_con_number;
rdpup_create_os_surface(priv->rdpid, width, height);
LLOGLN(0, ("rdpCreatePixmap: g_pixmap_byte_total %d g_pixmap_num_used %d",
g_pixmap_byte_total, g_pixmap_num_used));
} }
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;
@ -441,15 +431,10 @@ rdpDestroyPixmap(PixmapPtr pPixmap)
LLOGLN(10, ("status %d refcnt %d", priv->status, pPixmap->refcnt)); LLOGLN(10, ("status %d refcnt %d", priv->status, pPixmap->refcnt));
if (pPixmap->refcnt < 2) if (pPixmap->refcnt < 2)
{ {
if (XRDP_IS_OS(priv) && g_connected) if (XRDP_IS_OS(priv))
{ {
g_pixmap_byte_total -= priv->allocBytes; rdpup_remove_os_bitmap(priv->rdpindex);
g_pixmap_num_used--; rdpup_delete_os_surface(priv->rdpindex);
LLOGLN(0, ("rdpDestroyPixmap: id 0x%x "
"rdpid 0x%x g_pixmap_byte_total %d g_pixmap_num_used %d",
pPixmap->drawable.id, priv->rdpid,
g_pixmap_byte_total, g_pixmap_num_used));
rdpup_delete_os_surface(priv->rdpid);
} }
} }
pScreen = pPixmap->drawable.pScreen; pScreen = pPixmap->drawable.pScreen;
@ -748,7 +733,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
pDstPriv = GETPIXPRIV(pDstPixmap); pDstPriv = GETPIXPRIV(pDstPixmap);
if (XRDP_IS_OS(pDstPriv)) if (XRDP_IS_OS(pDstPriv))
{ {
rdpup_switch_os_surface(pDstPriv->rdpid); rdpup_switch_os_surface(pDstPriv->rdpindex);
rdpup_get_pixmap_image_rect(pDstPixmap, &id); rdpup_get_pixmap_image_rect(pDstPixmap, &id);
got_id = 1; got_id = 1;
} }
@ -828,7 +813,7 @@ rdpGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
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",
index, glyphs[index]->size, glyphs[index]->refcnt, index, (int)(glyphs[index]->size), (int)(glyphs[index]->refcnt),
glyphs[index]->info.width, glyphs[index]->info.height)); glyphs[index]->info.width, glyphs[index]->info.height));
} }
ps = GetPictureScreen(g_pScreen); ps = GetPictureScreen(g_pScreen);

@ -123,7 +123,7 @@ rdpRRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height,
BoxRec box; BoxRec box;
ErrorF("rdpRRScreenSetSize: width %d height %d mmWidth %d mmHeight %d\n", ErrorF("rdpRRScreenSetSize: width %d height %d mmWidth %d mmHeight %d\n",
width, height, mmWidth, mmHeight); width, height, (int)mmWidth, (int)mmHeight);
if ((width < 1) || (height < 1)) if ((width < 1) || (height < 1))
{ {

@ -38,9 +38,7 @@ int g_con_number = 0; /* increments for each connection */
static int g_listen_sck = 0; static int g_listen_sck = 0;
static int g_sck = 0; static int g_sck = 0;
static int g_sck_closed = 0; static int g_sck_closed = 0;
static int g_connected = 0;
int g_connected = 0;
static int g_dis_listen_sck = 0; static int g_dis_listen_sck = 0;
//static int g_dis_sck = 0; //static int g_dis_sck = 0;
//static int g_dis_sck_closed = 0; //static int g_dis_sck_closed = 0;
@ -55,7 +53,7 @@ static int g_cursor_y = 0;
static OsTimerPtr g_timer = 0; static OsTimerPtr g_timer = 0;
static int g_scheduled = 0; static int g_scheduled = 0;
static int g_count = 0; static int g_count = 0;
static int g_rdpid = -1; static int g_rdpindex = -1;
extern ScreenPtr g_pScreen; /* from rdpmain.c */ extern ScreenPtr g_pScreen; /* from rdpmain.c */
extern int g_Bpp; /* from rdpmain.c */ extern int g_Bpp; /* from rdpmain.c */
@ -69,6 +67,21 @@ extern char g_uds_data[]; /* in rdpmain.c */
extern int g_pixmap_byte_total; /* in rdpdraw.c */ extern int g_pixmap_byte_total; /* in rdpdraw.c */
extern int g_pixmap_num_used; /* in rdpdraw.c */ extern int g_pixmap_num_used; /* in rdpdraw.c */
struct rdpup_os_bitmap
{
int used;
PixmapPtr pixmap;
rdpPixmapPtr priv;
int stamp;
};
static struct rdpup_os_bitmap* g_os_bitmaps = 0;
static int g_max_os_bitmaps = 0;
static int g_os_bitmap_stamp = 0;
int g_pixmap_byte_total = 0;
int g_pixmap_num_used = 0;
/* /*
0 GXclear, 0 0 GXclear, 0
1 GXnor, DPon 1 GXnor, DPon
@ -108,6 +121,86 @@ static int g_rdp_opcodes[16] =
0xff /* GXset 0xf 1 */ 0xff /* GXset 0xf 1 */
}; };
/*****************************************************************************/
int
rdpup_add_os_bitmap(PixmapPtr pixmap, rdpPixmapPtr priv)
{
int index;
int rv;
int oldest;
int oldest_index;
if (!g_connected)
{
return -1;
}
rv = -1;
index = 0;
while (index < g_max_os_bitmaps)
{
if (g_os_bitmaps[index].used == 0)
{
g_os_bitmaps[index].used = 1;
g_os_bitmaps[index].pixmap = pixmap;
g_os_bitmaps[index].priv = priv;
g_os_bitmaps[index].stamp = g_os_bitmap_stamp;
g_os_bitmap_stamp++;
g_pixmap_num_used++;
rv = index;
break;
}
index++;
}
if (rv == -1)
{
/* find oldest */
oldest = 0x7fffffff;
oldest_index = 0;
index = 0;
while (index < g_max_os_bitmaps)
{
if (g_os_bitmaps[index].stamp < oldest)
{
oldest = g_os_bitmaps[index].stamp;
oldest_index = index;
}
index++;
}
LLOGLN(0, ("rdpup_add_os_bitmap: evicting old, oldest_index %d", oldest_index));
/* evict old */
g_os_bitmaps[oldest_index].priv->status = 0;
/* set new */
g_os_bitmaps[oldest_index].pixmap = pixmap;
g_os_bitmaps[oldest_index].priv = priv;
g_os_bitmaps[oldest_index].stamp = g_os_bitmap_stamp;
g_os_bitmap_stamp++;
rv = oldest_index;
}
LLOGLN(0, ("rdpup_add_os_bitmap: new bitmap index %d", rv));
LLOGLN(0, (" g_pixmap_num_used %d", g_pixmap_num_used));
return rv;
}
/*****************************************************************************/
int
rdpup_remove_os_bitmap(int rdpindex)
{
LLOGLN(0, ("rdpup_remove_os_bitmap: index %d", rdpindex));
if ((rdpindex < 0) && (rdpindex >= g_max_os_bitmaps))
{
return 1;
}
if (g_os_bitmaps[rdpindex].used)
{
g_os_bitmaps[rdpindex].used = 0;
g_os_bitmaps[rdpindex].pixmap = 0;
g_os_bitmaps[rdpindex].priv = 0;
g_pixmap_num_used--;
}
LLOGLN(0, (" g_pixmap_num_used %d", g_pixmap_num_used));
return 0;
}
/*****************************************************************************/ /*****************************************************************************/
/* returns error */ /* returns error */
static int static int
@ -250,8 +343,8 @@ rdpup_recv(char* data, int len)
g_tcp_close(g_sck); g_tcp_close(g_sck);
g_sck = 0; g_sck = 0;
g_sck_closed = 1; g_sck_closed = 1;
g_pixmap_byte_total = 0; //g_pixmap_byte_total = 0;
g_pixmap_num_used = 0; //g_pixmap_num_used = 0;
return 1; return 1;
} }
} }
@ -262,8 +355,8 @@ rdpup_recv(char* data, int len)
g_tcp_close(g_sck); g_tcp_close(g_sck);
g_sck = 0; g_sck = 0;
g_sck_closed = 1; g_sck_closed = 1;
g_pixmap_byte_total = 0; //g_pixmap_byte_total = 0;
g_pixmap_num_used = 0; //g_pixmap_num_used = 0;
return 1; return 1;
} }
else else
@ -540,6 +633,15 @@ param4 %d\n", msg, param1, param2, param3, param4));
g_rdpScreen.client_info.offscreen_cache_size); g_rdpScreen.client_info.offscreen_cache_size);
ErrorF(" offscreen entries %d\n", ErrorF(" offscreen entries %d\n",
g_rdpScreen.client_info.offscreen_cache_entries); g_rdpScreen.client_info.offscreen_cache_entries);
if (g_rdpScreen.client_info.offscreen_support_level > 0)
{
if (g_rdpScreen.client_info.offscreen_cache_entries > 0)
{
g_max_os_bitmaps = g_rdpScreen.client_info.offscreen_cache_entries;
g_os_bitmaps = (struct rdpup_os_bitmap*)
g_malloc(sizeof(struct rdpup_os_bitmap) * g_max_os_bitmaps, 1);
}
}
} }
else else
{ {
@ -1085,7 +1187,7 @@ rdpup_set_cursor(short x, short y, char* cur_data, char* cur_mask)
/******************************************************************************/ /******************************************************************************/
int int
rdpup_create_os_surface(int rdpid, int width, int height) rdpup_create_os_surface(int rdpindex, int width, int height)
{ {
LLOGLN(10, ("rdpup_create_os_surface:")); LLOGLN(10, ("rdpup_create_os_surface:"));
if (g_connected) if (g_connected)
@ -1095,7 +1197,7 @@ rdpup_create_os_surface(int rdpid, int width, int height)
out_uint16_le(g_out_s, 20); out_uint16_le(g_out_s, 20);
out_uint16_le(g_out_s, 12); out_uint16_le(g_out_s, 12);
g_count++; g_count++;
out_uint32_le(g_out_s, rdpid); out_uint32_le(g_out_s, rdpindex);
out_uint16_le(g_out_s, width); out_uint16_le(g_out_s, width);
out_uint16_le(g_out_s, height); out_uint16_le(g_out_s, height);
} }
@ -1104,53 +1206,40 @@ rdpup_create_os_surface(int rdpid, int width, int height)
/******************************************************************************/ /******************************************************************************/
int int
rdpup_switch_os_surface(int rdpid) rdpup_switch_os_surface(int rdpindex)
{ {
LLOGLN(10, ("rdpup_switch_os_surface:")); LLOGLN(10, ("rdpup_switch_os_surface:"));
if (g_connected) if (g_connected)
{ {
if (g_rdpid == rdpid) if (g_rdpindex == rdpindex)
{ {
return 0; return 0;
} }
g_rdpid = rdpid; g_rdpindex = rdpindex;
rdpup_send_pending(); // TODO: do we need this ? LLOGLN(10, ("rdpup_switch_os_surface: rdpindex %d", rdpindex));
// the protocol allows switch the surface anytime
LLOGLN(10, ("rdpup_switch_os_surface: rdpid %d", rdpid));
/* switch surface */ /* switch surface */
rdpup_pre_check(8);
out_uint16_le(g_out_s, 21); out_uint16_le(g_out_s, 21);
out_uint16_le(g_out_s, 8); out_uint16_le(g_out_s, 8);
out_uint32_le(g_out_s, rdpid); out_uint32_le(g_out_s, rdpindex);
g_count++;
/* begin update */
out_uint16_le(g_out_s, 1);
out_uint16_le(g_out_s, 4);
g_begin = 1;
g_count = 2;
} }
return 0; return 0;
} }
/******************************************************************************/ /******************************************************************************/
int int
rdpup_delete_os_surface(int rdpid) rdpup_delete_os_surface(int rdpindex)
{ {
LLOGLN(10, ("rdpup_delete_os_surface: rdpid %d", rdpid)); LLOGLN(10, ("rdpup_delete_os_surface: rdpindex %d", rdpindex));
if (g_connected) if (g_connected)
{ {
LLOGLN(10, ("rdpup_delete_os_surface: rdpid %d", rdpid)); LLOGLN(10, ("rdpup_delete_os_surface: rdpindex %d", rdpindex));
//if (g_current_surface == rdpid)
//{
// g_current_surface = -1;
//}
rdpup_pre_check(8); rdpup_pre_check(8);
out_uint16_le(g_out_s, 22); out_uint16_le(g_out_s, 22);
out_uint16_le(g_out_s, 8); out_uint16_le(g_out_s, 8);
g_count++; g_count++;
out_uint32_le(g_out_s, rdpid); out_uint32_le(g_out_s, rdpindex);
} }
return 0; return 0;
} }
@ -1341,7 +1430,7 @@ rdpup_send_area(struct image_data* id, int x, int y, int w, int h)
/******************************************************************************/ /******************************************************************************/
void void
rdpup_paint_rect_os(int x, int y, int cx, int cy, rdpup_paint_rect_os(int x, int y, int cx, int cy,
int rdpid, int srcx, int srcy) int rdpindex, int srcx, int srcy)
{ {
if (g_connected) if (g_connected)
{ {
@ -1353,7 +1442,7 @@ rdpup_paint_rect_os(int x, int y, int cx, int cy,
out_uint16_le(g_out_s, y); out_uint16_le(g_out_s, y);
out_uint16_le(g_out_s, cx); out_uint16_le(g_out_s, cx);
out_uint16_le(g_out_s, cy); out_uint16_le(g_out_s, cy);
out_uint32_le(g_out_s, rdpid); out_uint32_le(g_out_s, rdpindex);
out_uint16_le(g_out_s, srcx); out_uint16_le(g_out_s, srcx);
out_uint16_le(g_out_s, srcy); out_uint16_le(g_out_s, srcy);
} }

@ -83,11 +83,11 @@ xrdp_cache_add_brush(struct xrdp_cache* self,
char* brush_item_data); char* brush_item_data);
int APP_CC int APP_CC
xrdp_cache_add_os_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap, xrdp_cache_add_os_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap,
int id); int rdpindex);
int APP_CC int APP_CC
xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int id); xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int rdpindex);
struct xrdp_os_bitmap_item* APP_CC struct xrdp_os_bitmap_item* APP_CC
xrdp_cache_get_os_bitmap(struct xrdp_cache* self, int id); xrdp_cache_get_os_bitmap(struct xrdp_cache* self, int rdpindex);
/* xrdp_wm.c */ /* xrdp_wm.c */
struct xrdp_wm* APP_CC struct xrdp_wm* APP_CC
@ -240,6 +240,8 @@ xrdp_painter_create(struct xrdp_wm* wm, struct xrdp_session* session);
void APP_CC void APP_CC
xrdp_painter_delete(struct xrdp_painter* self); xrdp_painter_delete(struct xrdp_painter* self);
int APP_CC int APP_CC
wm_painter_set_target(struct xrdp_painter* self);
int APP_CC
xrdp_painter_begin_update(struct xrdp_painter* self); xrdp_painter_begin_update(struct xrdp_painter* self);
int APP_CC int APP_CC
xrdp_painter_end_update(struct xrdp_painter* self); xrdp_painter_end_update(struct xrdp_painter* self);

@ -541,76 +541,49 @@ xrdp_cache_add_brush(struct xrdp_cache* self,
} }
/*****************************************************************************/ /*****************************************************************************/
/* returns index */ /* returns error */
int APP_CC int APP_CC
xrdp_cache_add_os_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap, xrdp_cache_add_os_bitmap(struct xrdp_cache* self, struct xrdp_bitmap* bitmap,
int id) int rdpindex)
{ {
int index;
struct xrdp_os_bitmap_item* bi; struct xrdp_os_bitmap_item* bi;
if (id < 1) if ((rdpindex < 0) || (rdpindex >= 2000))
{ {
return -1; return 1;
} }
index = 0; bi = self->os_bitmap_items + rdpindex;
for (index = 0; index < 2000; index++)
{
bi = self->os_bitmap_items + index;
if (bi->bitmap == 0)
{
bi->id = id;
bi->bitmap = bitmap; bi->bitmap = bitmap;
//g_writeln("xrdp_cache_add_os_bitmap: bitmap id 0x%x added at index %d", id, index); return 0;
return index;
}
}
g_writeln("xrdp_cache_add_os_bitmap: bitmap id 0x%x not added, full", id);
return -1;
} }
/*****************************************************************************/ /*****************************************************************************/
/* returns index */ /* returns error */
int APP_CC int APP_CC
xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int id) xrdp_cache_remove_os_bitmap(struct xrdp_cache* self, int rdpindex)
{ {
int index;
struct xrdp_os_bitmap_item* bi; struct xrdp_os_bitmap_item* bi;
if (id < 1) if ((rdpindex < 0) || (rdpindex >= 2000))
{ {
return -1; return 1;
} }
for (index = 0; index < 2000; index++) bi = self->os_bitmap_items + rdpindex;
{
bi = self->os_bitmap_items + index;
if (bi->id == id)
{
xrdp_bitmap_delete(bi->bitmap); xrdp_bitmap_delete(bi->bitmap);
g_memset(bi, 0, sizeof(struct xrdp_os_bitmap_item)); g_memset(bi, 0, sizeof(struct xrdp_os_bitmap_item));
//g_writeln("xrdp_cache_remove_os_bitmap: bitmap id 0x%x removed from index %d", id, index); return 0;
return index;
}
}
return -1;
} }
/*****************************************************************************/ /*****************************************************************************/
struct xrdp_os_bitmap_item* APP_CC struct xrdp_os_bitmap_item* APP_CC
xrdp_cache_get_os_bitmap(struct xrdp_cache* self, int id) xrdp_cache_get_os_bitmap(struct xrdp_cache* self, int rdpindex)
{ {
int index;
struct xrdp_os_bitmap_item* bi; struct xrdp_os_bitmap_item* bi;
for (index = 0; index < 2000; index++) if ((rdpindex < 0) || (rdpindex >= 2000))
{
bi = self->os_bitmap_items + index;
if (bi->id == id)
{ {
//g_writeln("xrdp_cache_get_os_bitmap: bitmap id 0x%x found at index %d", id, index);
return bi;
}
}
g_writeln("xrdp_cache_get_os_bitmap: bitmap id 0x%x not found", id);
return 0; return 0;
} }
bi = self->os_bitmap_items + rdpindex;
return bi;
}

@ -1594,81 +1594,99 @@ server_send_to_channel(struct xrdp_mod* mod, int channel_id,
/*****************************************************************************/ /*****************************************************************************/
int DEFAULT_CC int DEFAULT_CC
server_create_os_surface(struct xrdp_mod* mod, int id, server_create_os_surface(struct xrdp_mod* mod, int rdpindex,
int width, int height) int width, int height)
{ {
struct xrdp_wm* wm; struct xrdp_wm* wm;
struct xrdp_bitmap* bitmap; struct xrdp_bitmap* bitmap;
int index; int error;
//g_writeln("server_create_os_surface: id 0x%x, width %d height %d",
// id, width, height);
wm = (struct xrdp_wm*)(mod->wm); wm = (struct xrdp_wm*)(mod->wm);
bitmap = xrdp_bitmap_create(width, height, wm->screen->bpp, bitmap = xrdp_bitmap_create(width, height, wm->screen->bpp,
WND_TYPE_OFFSCREEN, wm); WND_TYPE_OFFSCREEN, wm);
bitmap->id = id; error = xrdp_cache_add_os_bitmap(wm->cache, bitmap, rdpindex);
index = xrdp_cache_add_os_bitmap(wm->cache, bitmap, id); if (error != 0)
if (index < 0)
{ {
g_writeln("server_create_os_surface: xrdp_cache_add_os_bitmap failed"); g_writeln("server_create_os_surface: xrdp_cache_add_os_bitmap failed");
return 1; return 1;
} }
bitmap->item_index = index; bitmap->item_index = rdpindex;
bitmap->id = rdpindex;
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
int DEFAULT_CC int DEFAULT_CC
server_switch_os_surface(struct xrdp_mod* mod, int id) server_switch_os_surface(struct xrdp_mod* mod, int rdpindex)
{ {
struct xrdp_wm* wm; struct xrdp_wm* wm;
struct xrdp_os_bitmap_item* bi; struct xrdp_os_bitmap_item* bi;
struct xrdp_painter* p;
//g_writeln("server_switch_os_surface: id 0x%x", id); //g_writeln("server_switch_os_surface: id 0x%x", id);
wm = (struct xrdp_wm*)(mod->wm); wm = (struct xrdp_wm*)(mod->wm);
if (id == -1) if (rdpindex == -1)
{ {
//g_writeln("server_switch_os_surface: setting target_surface to screen"); //g_writeln("server_switch_os_surface: setting target_surface to screen");
wm->target_surface = wm->screen; wm->target_surface = wm->screen;
p = (struct xrdp_painter*)(mod->painter);
if (p != 0)
{
//g_writeln("setting target");
wm_painter_set_target(p);
}
return 0; return 0;
} }
bi = xrdp_cache_get_os_bitmap(wm->cache, id); bi = xrdp_cache_get_os_bitmap(wm->cache, rdpindex);
if (bi != 0) if (bi != 0)
{ {
//g_writeln("server_switch_os_surface: setting target_surface to rdpid %d", id); //g_writeln("server_switch_os_surface: setting target_surface to rdpid %d", id);
wm->target_surface = bi->bitmap; wm->target_surface = bi->bitmap;
p = (struct xrdp_painter*)(mod->painter);
if (p != 0)
{
//g_writeln("setting target");
wm_painter_set_target(p);
}
} }
else else
{ {
g_writeln("server_switch_os_surface: error finding id 0x%x", id); g_writeln("server_switch_os_surface: error finding id %d", rdpindex);
} }
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
int DEFAULT_CC int DEFAULT_CC
server_delete_os_surface(struct xrdp_mod* mod, int id) server_delete_os_surface(struct xrdp_mod* mod, int rdpindex)
{ {
struct xrdp_wm* wm; struct xrdp_wm* wm;
struct xrdp_painter* p;
//g_writeln("server_delete_os_surface: id 0x%x", id); //g_writeln("server_delete_os_surface: id 0x%x", id);
wm = (struct xrdp_wm*)(mod->wm); wm = (struct xrdp_wm*)(mod->wm);
if (wm->target_surface->type == WND_TYPE_OFFSCREEN) if (wm->target_surface->type == WND_TYPE_OFFSCREEN)
{ {
if (wm->target_surface->id == id) if (wm->target_surface->id == rdpindex)
{ {
g_writeln("server_delete_os_surface: setting target_surface to screen"); g_writeln("server_delete_os_surface: setting target_surface to screen");
wm->target_surface = wm->screen; wm->target_surface = wm->screen;
p = (struct xrdp_painter*)(mod->painter);
if (p != 0)
{
//g_writeln("setting target");
wm_painter_set_target(p);
}
} }
} }
xrdp_cache_remove_os_bitmap(wm->cache, id); xrdp_cache_remove_os_bitmap(wm->cache, rdpindex);
return 0; return 0;
} }
/*****************************************************************************/ /*****************************************************************************/
int DEFAULT_CC int DEFAULT_CC
server_paint_rect_os(struct xrdp_mod* mod, int x, int y, int cx, int cy, server_paint_rect_os(struct xrdp_mod* mod, int x, int y, int cx, int cy,
int id, int srcx, int srcy) int rdpindex, int srcx, int srcy)
{ {
struct xrdp_wm* wm; struct xrdp_wm* wm;
struct xrdp_bitmap* b; struct xrdp_bitmap* b;
@ -1681,7 +1699,7 @@ server_paint_rect_os(struct xrdp_mod* mod, int x, int y, int cx, int cy,
return 0; return 0;
} }
wm = (struct xrdp_wm*)(mod->wm); wm = (struct xrdp_wm*)(mod->wm);
bi = xrdp_cache_get_os_bitmap(wm->cache, id); bi = xrdp_cache_get_os_bitmap(wm->cache, rdpindex);
if (bi != 0) if (bi != 0)
{ {
b = bi->bitmap; b = bi->bitmap;
@ -1689,7 +1707,7 @@ server_paint_rect_os(struct xrdp_mod* mod, int x, int y, int cx, int cy,
} }
else else
{ {
g_writeln("server_paint_rect_os: error finding id 0x%x", id); g_writeln("server_paint_rect_os: error finding id %d", rdpindex);
} }
return 0; return 0;
} }

@ -49,16 +49,10 @@ xrdp_painter_delete(struct xrdp_painter* self)
/*****************************************************************************/ /*****************************************************************************/
int APP_CC int APP_CC
xrdp_painter_begin_update(struct xrdp_painter* self) wm_painter_set_target(struct xrdp_painter* self)
{ {
int surface_index; int surface_index;
if (self == 0)
{
return 0;
}
libxrdp_orders_init(self->session);
if (self->wm->target_surface->type == WND_TYPE_SCREEN) if (self->wm->target_surface->type == WND_TYPE_SCREEN)
{ {
if (self->wm->current_surface_index != 0xffff) if (self->wm->current_surface_index != 0xffff)
@ -90,6 +84,19 @@ xrdp_painter_begin_update(struct xrdp_painter* self)
return 0; return 0;
} }
/*****************************************************************************/
int APP_CC
xrdp_painter_begin_update(struct xrdp_painter* self)
{
if (self == 0)
{
return 0;
}
libxrdp_orders_init(self->session);
wm_painter_set_target(self);
return 0;
}
/*****************************************************************************/ /*****************************************************************************/
int APP_CC int APP_CC
xrdp_painter_end_update(struct xrdp_painter* self) xrdp_painter_end_update(struct xrdp_painter* self)
@ -667,13 +674,13 @@ xrdp_painter_copy(struct xrdp_painter* self,
region = xrdp_region_create(self->wm); region = xrdp_region_create(self->wm);
if (dst->type != WND_TYPE_OFFSCREEN) if (dst->type != WND_TYPE_OFFSCREEN)
{ {
g_writeln("off screen to screen"); //g_writeln("off screen to screen");
xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy, xrdp_wm_get_vis_region(self->wm, dst, x, y, cx, cy,
region, self->clip_children); region, self->clip_children);
} }
else else
{ {
g_writeln("off screen to off screen"); //g_writeln("off screen to off screen");
xrdp_region_add_rect(region, &clip_rect); xrdp_region_add_rect(region, &clip_rect);
} }
x += dx; x += dx;

@ -80,13 +80,13 @@ struct xrdp_mod
char* data, int data_len, char* data, int data_len,
int total_data_len, int flags); int total_data_len, int flags);
int (*server_bell_trigger)(struct xrdp_mod* v); int (*server_bell_trigger)(struct xrdp_mod* v);
int (*server_create_os_surface)(struct xrdp_mod* v, int id, int (*server_create_os_surface)(struct xrdp_mod* v, int rdpindex,
int width, int height); int width, int height);
int (*server_switch_os_surface)(struct xrdp_mod* v, int id); int (*server_switch_os_surface)(struct xrdp_mod* v, int rdpindex);
int (*server_delete_os_surface)(struct xrdp_mod* v, int id); int (*server_delete_os_surface)(struct xrdp_mod* v, int rdpindex);
int (*server_paint_rect_os)(struct xrdp_mod* mod, int x, int y, int (*server_paint_rect_os)(struct xrdp_mod* mod, int x, int y,
int cx, int cy, int cx, int cy,
int id, int srcx, int srcy); int rdpindex, int srcx, int srcy);
int (*server_set_hints)(struct xrdp_mod* mod, int hints, int mask); int (*server_set_hints)(struct xrdp_mod* mod, int hints, int mask);
long server_dumby[100 - 30]; /* align, 100 minus the number of server long server_dumby[100 - 30]; /* align, 100 minus the number of server
functions above */ functions above */

@ -88,13 +88,13 @@ struct mod
char* data, int data_len, char* data, int data_len,
int total_data_len, int flags); int total_data_len, int flags);
int (*server_bell_trigger)(struct mod* v); int (*server_bell_trigger)(struct mod* v);
int (*server_create_os_surface)(struct mod* v, int id, int (*server_create_os_surface)(struct mod* v, int rdpindex,
int width, int height); int width, int height);
int (*server_switch_os_surface)(struct mod* v, int id); int (*server_switch_os_surface)(struct mod* v, int rdpindex);
int (*server_delete_os_surface)(struct mod* v, int id); int (*server_delete_os_surface)(struct mod* v, int rdpindex);
int (*server_paint_rect_os)(struct mod* v, int x, int y, int (*server_paint_rect_os)(struct mod* v, int x, int y,
int cx, int cy, int cx, int cy,
int id, int srcx, int srcy); int rdpindex, int srcx, int srcy);
int (*server_set_hints)(struct mod* v, int hints, int mask); int (*server_set_hints)(struct mod* v, int hints, int mask);
tbus server_dumby[100 - 30]; /* align, 100 minus the number of server tbus server_dumby[100 - 30]; /* align, 100 minus the number of server
functions above */ functions above */

Loading…
Cancel
Save