diff options
| author | jsorg71 <jsorg71> | 2008-06-24 05:43:10 +0000 |
|---|---|---|
| committer | jsorg71 <jsorg71> | 2008-06-24 05:43:10 +0000 |
| commit | bfe555e3b6ad96df9ab45365305d1ef463c3f015 (patch) | |
| tree | 7be1450fb6430acfc82566caedb6f83620c5e0d8 /xrdp/xrdp_painter.c | |
| parent | 756fcef1c8e4748b4a0c5b616d7afd7347aa6d5d (diff) | |
| download | xrdp-proprietary-bfe555e3b6ad96df9ab45365305d1ef463c3f015.tar.gz xrdp-proprietary-bfe555e3b6ad96df9ab45365305d1ef463c3f015.zip | |
added brush cache bits for clients that support it
Diffstat (limited to 'xrdp/xrdp_painter.c')
| -rw-r--r-- | xrdp/xrdp_painter.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/xrdp/xrdp_painter.c b/xrdp/xrdp_painter.c index 564054bb..f68627d1 100644 --- a/xrdp/xrdp_painter.c +++ b/xrdp/xrdp_painter.c @@ -230,6 +230,28 @@ xrdp_painter_text_height(struct xrdp_painter* self, char* text) } /*****************************************************************************/ +static int APP_CC +xrdp_painter_setup_brush(struct xrdp_painter* self, + struct xrdp_brush* out_brush, + struct xrdp_brush* in_brush) +{ + int cache_id; + + g_memcpy(out_brush, in_brush, sizeof(struct xrdp_brush)); + if (in_brush->style == 3) + { + if (self->session->client_info->brush_cache_code == 1) + { + cache_id = xrdp_cache_add_brush(self->wm->cache, in_brush->pattern); + g_memset(out_brush->pattern, 0, 8); + out_brush->pattern[0] = cache_id; + out_brush->style = 0x81; + } + } + return 0; +} + +/*****************************************************************************/ /* fill in an area of the screen with one color */ int APP_CC xrdp_painter_fill_rect(struct xrdp_painter* self, @@ -240,6 +262,7 @@ xrdp_painter_fill_rect(struct xrdp_painter* self, struct xrdp_rect draw_rect; struct xrdp_rect rect; struct xrdp_region* region; + struct xrdp_brush brush; int k; int dx; int dy; @@ -314,13 +337,14 @@ xrdp_painter_fill_rect(struct xrdp_painter* self, break; } } + xrdp_painter_setup_brush(self, &brush, &self->brush); while (xrdp_region_get_rect(region, k, &rect) == 0) { if (rect_intersect(&rect, &clip_rect, &draw_rect)) { libxrdp_orders_pat_blt(self->session, x, y, cx, cy, rop, self->bg_color, self->fg_color, - &self->brush, &draw_rect); + &brush, &draw_rect); } k++; } |
