diff options
Diffstat (limited to 'xrdp/xrdp_painter.c')
-rw-r--r-- | xrdp/xrdp_painter.c | 82 |
1 files changed, 81 insertions, 1 deletions
diff --git a/xrdp/xrdp_painter.c b/xrdp/xrdp_painter.c index 4457fee8..b9d1da16 100644 --- a/xrdp/xrdp_painter.c +++ b/xrdp/xrdp_painter.c @@ -849,7 +849,7 @@ xrdp_painter_copy(struct xrdp_painter *self, { w = MIN(64, ((srcx + cx) - i)); h = MIN(64, ((srcy + cy) - j)); - b = xrdp_bitmap_create(w, h, self->wm->screen->bpp, 0, self->wm); + b = xrdp_bitmap_create(w, h, src->bpp, 0, self->wm); xrdp_bitmap_copy_box_with_crc(src, b, i, j, w, h); bitmap_id = xrdp_cache_add_bitmap(self->wm->cache, b, self->wm->hints); cache_id = HIWORD(bitmap_id); @@ -889,6 +889,86 @@ xrdp_painter_copy(struct xrdp_painter *self, /*****************************************************************************/ int APP_CC +xrdp_painter_composite(struct xrdp_painter* self, + struct xrdp_bitmap* src, + int srcformat, + int srcwidth, + int srcrepeat, + struct xrdp_bitmap* dst, + int* srctransform, + int mskflags, + struct xrdp_bitmap* msk, + int mskformat, int mskwidth, int mskrepeat, int op, + int srcx, int srcy, int mskx, int msky, + int dstx, int dsty, int width, int height, int dstformat) +{ + struct xrdp_rect clip_rect; + struct xrdp_rect draw_rect; + struct xrdp_rect rect1; + struct xrdp_rect rect2; + struct xrdp_region* region; + int k; + int dx; + int dy; + int palette_id; + int cache_srcidx; + int cache_mskidx; + + if (self == 0 || src == 0 || dst == 0) + { + return 0; + } + + /* todo data */ + + if (dst->type == WND_TYPE_BITMAP) + { + return 0; + } + + if (src->type == WND_TYPE_OFFSCREEN) + { + xrdp_bitmap_get_screen_clip(dst, self, &clip_rect, &dx, &dy); + region = xrdp_region_create(self->wm); + xrdp_region_add_rect(region, &clip_rect); + dstx += dx; + dsty += dy; + + palette_id = 0; + cache_srcidx = src->item_index; + cache_mskidx = -1; + if (mskflags & 1) + { + if (msk != 0) + { + cache_mskidx = msk->item_index; // todo + } + } + + k = 0; + while (xrdp_region_get_rect(region, k, &rect1) == 0) + { + if (rect_intersect(&rect1, &clip_rect, &rect2)) + { + MAKERECT(rect1, dstx, dsty, width, height); + if (rect_intersect(&rect2, &rect1, &draw_rect)) + { + libxrdp_orders_composite_blt(self->session, cache_srcidx, srcformat, srcwidth, + srcrepeat, srctransform, mskflags, cache_mskidx, + mskformat, mskwidth, mskrepeat, op, srcx, srcy, + mskx, msky, dstx, dsty, width, height, dstformat, + &draw_rect); + } + } + k++; + } + xrdp_region_delete(region); + } + return 0; +} + +/*****************************************************************************/ +int APP_CC xrdp_painter_line(struct xrdp_painter *self, struct xrdp_bitmap *dst, int x1, int y1, int x2, int y2) |