Hand-apply patches (drawing configuration) from Authentic8 branch: 34b92df f994298 38e2def

This commit is contained in:
Jim Grandy 2013-07-03 10:45:46 -07:00
parent 117e514cb4
commit c64586c25c
7 changed files with 60 additions and 21 deletions

View File

@ -559,4 +559,6 @@
#define CMDTYPE_FRAME_MARKER 0x0004
#define CMDTYPE_STREAM_SURFACE_BITS 0x0006
#define XRDP_BITMAP_CACHE_ENTRIES 2048
#endif

View File

@ -211,6 +211,7 @@ struct xrdp_orders
int order_count;
int order_level; /* inc for every call to xrdp_orders_init */
struct xrdp_orders_state orders_state;
int rfx_min_pixel;
};
#define PROTO_RDP_40 1

View File

@ -47,6 +47,11 @@ xrdp_orders_create(struct xrdp_session *session, struct xrdp_rdp *rdp_layer)
init_stream(self->out_s, 16384);
self->orders_state.clip_right = 1; /* silly rdp right clip */
self->orders_state.clip_bottom = 1; /* silly rdp bottom clip */
self->rfx_min_pixel = rdp_layer->client_info.rfx_min_pixel;
if (self->rfx_min_pixel == 0)
{
self->rfx_min_pixel = 64 * 32;
}
return self;
}
@ -2241,7 +2246,9 @@ xrdp_orders_send_as_rfx(struct xrdp_orders *self,
return 0;
}
if (width * height < 64)
LLOGLN(10, ("width %d height %d rfx_min_pixel %d", width, height,
self->rfx_min_pixel));
if (width * height < self->rfx_min_pixel)
{
return 0;
}

View File

@ -131,6 +131,10 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
{
client_info->max_bpp = g_atoi(value);
}
else if (g_strcasecmp(item, "rfx_min_pixel") == 0)
{
client_info->rfx_min_pixel = g_atoi(value);
}
else if (g_strcasecmp(item, "new_cursors") == 0)
{
client_info->pointer_flags = text2bool(value) == 0 ? 2 : 0;
@ -925,16 +929,16 @@ xrdp_process_capset_bmpcache2(struct xrdp_rdp *self, struct stream *s,
self->client_info.bitmap_cache_persist_enable = i;
in_uint8s(s, 2); /* number of caches in set, 3 */
in_uint32_le(s, i);
i = MIN(i, 2000);
i = MIN(i, XRDP_BITMAP_CACHE_ENTRIES);
self->client_info.cache1_entries = i;
self->client_info.cache1_size = 256 * Bpp;
in_uint32_le(s, i);
i = MIN(i, 2000);
i = MIN(i, XRDP_BITMAP_CACHE_ENTRIES);
self->client_info.cache2_entries = i;
self->client_info.cache2_size = 1024 * Bpp;
in_uint32_le(s, i);
i = i & 0x7fffffff;
i = MIN(i, 2000);
i = MIN(i, XRDP_BITMAP_CACHE_ENTRIES);
self->client_info.cache3_entries = i;
self->client_info.cache3_size = 4096 * Bpp;
DEBUG(("cache1 entries %d size %d", self->client_info.cache1_entries,

View File

@ -487,6 +487,7 @@ draw_item_pack(PixmapPtr pix, rdpPixmapRec *priv)
{
struct rdp_draw_item *di;
struct rdp_draw_item *di_prev;
RegionRec treg;
#if 1
@ -500,19 +501,17 @@ draw_item_pack(PixmapPtr pix, rdpPixmapRec *priv)
while (di != 0)
{
if ((di_prev->type == RDI_IMGLL) && (di->type == RDI_IMGLL))
if ((di_prev->type == RDI_IMGLL || di_prev->type == RDI_IMGLY ||
di_prev->type == RDI_FILL) &&
(di->type == RDI_IMGLL || di->type == RDI_IMGLY ||
di->type == RDI_FILL))
{
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"));
LLOGLN(10, ("draw_item_pack: packing RDI_IMGLL / RDI_IMGLY / "
"RDI_FILL"));
RegionUnion(di_prev->reg, di_prev->reg, di->reg);
draw_item_remove(priv, di);
di = di_prev->next;
di_prev->type = RDI_IMGLL;
}
else
{
@ -547,7 +546,14 @@ draw_item_pack(PixmapPtr pix, rdpPixmapRec *priv)
while (di_prev != 0)
{
/* D = M - S */
RegionSubtract(di_prev->reg, di_prev->reg, di->reg);
RegionInit(&treg, NullBox, 0);
RegionSubtract(&treg, di_prev->reg, di->reg);
if (!RegionNotEmpty(&treg))
{
/* copy empty region so this draw item will get removed below */
RegionCopy(di_prev->reg, &treg);
}
RegionUninit(&treg);
di_prev = di_prev->prev;
}
}

View File

@ -21,6 +21,18 @@
#include "xrdp.h"
#include "log.h"
#define LLOG_LEVEL 1
#define LLOGLN(_level, _args) \
do \
{ \
if (_level < LLOG_LEVEL) \
{ \
g_write("xrdp:xrdp_cache [%10.10u]: ", g_time3()); \
g_writeln _args ; \
} \
} \
while (0)
/*****************************************************************************/
struct xrdp_cache *APP_CC
xrdp_cache_create(struct xrdp_wm *owner,
@ -43,6 +55,8 @@ xrdp_cache_create(struct xrdp_wm *owner,
self->bitmap_cache_version = client_info->bitmap_cache_version;
self->pointer_cache_entries = client_info->pointer_cache_entries;
self->xrdp_os_del_list = list_create();
LLOGLN(10, ("xrdp_cache_create: 0 %d 1 %d 2 %d",
self->cache1_entries, self->cache2_entries, self->cache3_entries));
return self;
}
@ -61,7 +75,7 @@ xrdp_cache_delete(struct xrdp_cache *self)
/* free all the cached bitmaps */
for (i = 0; i < 3; i++)
{
for (j = 0; j < 2000; j++)
for (j = 0; j < XRDP_BITMAP_CACHE_ENTRIES; j++)
{
xrdp_bitmap_delete(self->bitmap_items[i][j].bitmap);
}
@ -100,7 +114,7 @@ xrdp_cache_reset(struct xrdp_cache *self,
/* free all the cached bitmaps */
for (i = 0; i < 3; i++)
{
for (j = 0; j < 2000; j++)
for (j = 0; j < XRDP_BITMAP_CACHE_ENTRIES; j++)
{
xrdp_bitmap_delete(self->bitmap_items[i][j].bitmap);
}
@ -177,7 +191,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap,
#endif
{
self->bitmap_items[i][j].stamp = self->bitmap_stamp;
DEBUG(("found bitmap at %d %d", i, j));
LLOGLN(10, ("found bitmap at %d %d", i, j));
xrdp_bitmap_delete(bitmap);
return MAKELONG(j, i);
}
@ -197,7 +211,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap,
#endif
{
self->bitmap_items[i][j].stamp = self->bitmap_stamp;
DEBUG(("found bitmap at %d %d", i, j));
LLOGLN(10, ("found bitmap at %d %d", i, j));
xrdp_bitmap_delete(bitmap);
return MAKELONG(j, i);
}
@ -217,7 +231,7 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap,
#endif
{
self->bitmap_items[i][j].stamp = self->bitmap_stamp;
DEBUG(("found bitmap at %d %d", i, j));
LLOGLN(10, ("found bitmap at %d %d", i, j));
xrdp_bitmap_delete(bitmap);
return MAKELONG(j, i);
}
@ -276,7 +290,8 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap,
}
}
DEBUG(("adding bitmap at %d %d", cache_id, cache_idx));
LLOGLN(10, ("adding bitmap at %d %d ptr %p", cache_id, cache_idx,
self->bitmap_items[cache_id][cache_idx].bitmap));
/* set, send bitmap and return */
xrdp_bitmap_delete(self->bitmap_items[cache_id][cache_idx].bitmap);
self->bitmap_items[cache_id][cache_idx].bitmap = bitmap;

View File

@ -22,6 +22,7 @@
#define LOG_WINDOW_CHAR_PER_LINE 60
#include "xrdp_rail.h"
#include "xrdp_constants.h"
#define MAX_NR_CHANNELS 16
#define MAX_CHANNEL_NAME 16
@ -185,6 +186,9 @@ struct xrdp_brush_item
char pattern[8];
};
/* moved to xrdp_constants.h
#define XRDP_BITMAP_CACHE_ENTRIES 2048 */
/* differnce caches */
struct xrdp_cache
{
@ -195,7 +199,7 @@ struct xrdp_cache
struct xrdp_palette_item palette_items[6];
/* bitmap */
int bitmap_stamp;
struct xrdp_bitmap_item bitmap_items[3][2000];
struct xrdp_bitmap_item bitmap_items[3][XRDP_BITMAP_CACHE_ENTRIES];
int use_bitmap_comp;
int cache1_entries;
int cache1_size;