Hand-apply patches (glphy cache) from Authetnic8 branch: 1048147 3fc5974 0552905 00b08a0

ulab-next
Jim Grandy 12 years ago
parent 4bfe0c167a
commit 689b178050

@ -671,38 +671,38 @@ xrdp_rdp_send_demand_active(struct xrdp_rdp *self)
out_uint16_le(s, 0x2f); /* Number of fonts */
out_uint16_le(s, 0x22); /* Capability flags */
/* caps */
out_uint8(s, 1); /* dest blt */
out_uint8(s, 1); /* pat blt */
out_uint8(s, 1); /* screen blt */
out_uint8(s, 1); /* mem blt */
out_uint8(s, 0); /* tri blt */
out_uint8(s, 0); /* unused */
out_uint8(s, 0); /* unused */
out_uint8(s, 0); /* nine grid */
out_uint8(s, 1); /* line to */
out_uint8(s, 0); /* multi nine grid */
out_uint8(s, 1); /* rect */
out_uint8(s, 0); /* desk save */
out_uint8(s, 0); /* unused */
out_uint8(s, 0); /* unused */
out_uint8(s, 0); /* unused */
out_uint8(s, 0); /* multi dest blt */
out_uint8(s, 0); /* multi pat blt */
out_uint8(s, 0); /* multi screen blt */
out_uint8(s, 1); /* multi rect */
out_uint8(s, 0); /* fast index */
out_uint8(s, 0); /* polygonSC ([MS-RDPEGDI], 2.2.2.2.1.1.2.16) */
out_uint8(s, 0); /* polygonCB ([MS-RDPEGDI], 2.2.2.2.1.1.2.17) */
out_uint8(s, 0); /* polyline */
out_uint8(s, 0); /* unused */
out_uint8(s, 0); /* fast glyph */
out_uint8(s, 0); /* ellipse */
out_uint8(s, 0); /* ellipse */
out_uint8(s, 0); /* ? */
out_uint8(s, 0); /* unused */
out_uint8(s, 0); /* unused */
out_uint8(s, 0); /* unused */
out_uint8(s, 0); /* unused */
out_uint8(s, 1); /* NEG_DSTBLT_INDEX 0x00 0 */
out_uint8(s, 1); /* NEG_PATBLT_INDEX 0x01 1 */
out_uint8(s, 1); /* NEG_SCRBLT_INDEX 0x02 2 */
out_uint8(s, 1); /* NEG_MEMBLT_INDEX 0x03 3 */
out_uint8(s, 0); /* NEG_MEM3BLT_INDEX 0x04 4 */
out_uint8(s, 0); /* NEG_ATEXTOUT_INDEX 0x05 5 */
out_uint8(s, 0); /* NEG_AEXTTEXTOUT_INDEX 0x06 6 */
out_uint8(s, 0); /* NEG_DRAWNINEGRID_INDEX 0x07 7 */
out_uint8(s, 1); /* NEG_LINETO_INDEX 0x08 8 */
out_uint8(s, 0); /* NEG_MULTI_DRAWNINEGRID_INDEX 0x09 9 */
out_uint8(s, 1); /* NEG_OPAQUE_RECT_INDEX 0x0A 10 */
out_uint8(s, 0); /* NEG_SAVEBITMAP_INDEX 0x0B 11 */
out_uint8(s, 0); /* NEG_WTEXTOUT_INDEX 0x0C 12 */
out_uint8(s, 0); /* NEG_MEMBLT_V2_INDEX 0x0D 13 */
out_uint8(s, 0); /* NEG_MEM3BLT_V2_INDEX 0x0E 14 */
out_uint8(s, 0); /* NEG_MULTIDSTBLT_INDEX 0x0F 15 */
out_uint8(s, 0); /* NEG_MULTIPATBLT_INDEX 0x10 16 */
out_uint8(s, 0); /* NEG_MULTISCRBLT_INDEX 0x11 17 */
out_uint8(s, 1); /* NEG_MULTIOPAQUERECT_INDEX 0x12 18 */
out_uint8(s, 0); /* NEG_FAST_INDEX_INDEX 0x13 19 */
out_uint8(s, 0); /* NEG_POLYGON_SC_INDEX 0x14 20 */
out_uint8(s, 0); /* NEG_POLYGON_CB_INDEX 0x15 21 */
out_uint8(s, 0); /* NEG_POLYLINE_INDEX 0x16 22 */
out_uint8(s, 0); /* unused 0x17 23 */
out_uint8(s, 0); /* NEG_FAST_GLYPH_INDEX 0x18 24 */
out_uint8(s, 0); /* NEG_ELLIPSE_SC_INDEX 0x19 25 */
out_uint8(s, 0); /* NEG_ELLIPSE_CB_INDEX 0x1A 26 */
out_uint8(s, 1); /* NEG_GLYPH_INDEX_INDEX 0x1B 27 */
out_uint8(s, 0); /* NEG_GLYPH_WEXTTEXTOUT_INDEX 0x1C 28 */
out_uint8(s, 0); /* NEG_GLYPH_WLONGTEXTOUT_INDEX 0x1D 29 */
out_uint8(s, 0); /* NEG_GLYPH_WLONGEXTTEXTOUT_INDEX 0x1E 30 */
out_uint8(s, 0); /* unused 0x1F 31 */
out_uint16_le(s, 0x6a1);
/* declare support of bitmap cache rev3 */
out_uint16_le(s, XR_ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT);

@ -92,6 +92,26 @@ set_mono_pixel(char* data, int x, int y, int width, int pixel)
}
}
/*****************************************************************************/
static int
lget_pixel(char* data, int x, int y, int depth, int stride_bytes)
{
int start;
int shift;
if (depth == 1)
{
start = (y * stride_bytes) + x / 8;
shift = x % 8;
return (data[start] & (0x01 << shift)) ? 0xff : 0;
}
else if (depth == 8)
{
return data[y * stride_bytes + x];
}
return 0;
}
/******************************************************************************/
static int
glyph_get_data(ScreenPtr pScreen, GlyphPtr glyph, struct rdp_font_char* rfd)
@ -100,11 +120,11 @@ glyph_get_data(ScreenPtr pScreen, GlyphPtr glyph, struct rdp_font_char* rfd)
int j;
int src_xoff;
int src_yoff;
int stride_bytes;
int src_stride_bytes;
int dst_stride_bytes;
int hh;
int ww;
int ss;
int depth;
int src_depth;
unsigned char pixel;
PicturePtr pPicture;
pixman_image_t *src;
@ -122,49 +142,43 @@ glyph_get_data(ScreenPtr pScreen, GlyphPtr glyph, struct rdp_font_char* rfd)
return 0;
}
depth = pixman_image_get_depth(src);
stride_bytes = pixman_image_get_stride(src);
ww = pixman_image_get_width(src);
hh = pixman_image_get_height(src);
ss = (glyph->info.width + 3) & ~3;
if ((ww != glyph->info.width) || (hh != glyph->info.height) ||
(depth != 8) || (stride_bytes != ss))
{
LLOGLN(10, ("glyph_get_data: error w %d w %d h %d h %d "
"stride %d stride %d depth %d", ww,
glyph->info.width, hh, glyph->info.height,
stride_bytes, ss, depth));
free_pixman_pict(pPicture, src);
return 0;
}
src_stride_bytes = pixman_image_get_stride(src);
if (g_do_alpha_glyphs)
{
rfd->data_bytes = glyph->info.height * stride_bytes;
dst_stride_bytes = (glyph->info.width + 3) & ~3;
rfd->bpp = 8;
}
else
{
rfd->data_bytes = (((glyph->info.height *
((glyph->info.width + 7) / 8)) + 3) & ~3);
dst_stride_bytes = (((glyph->info.width + 7) / 8) + 3) & ~3;
rfd->bpp = 1;
}
src_depth = pixman_image_get_depth(src);
ww = pixman_image_get_width(src);
hh = pixman_image_get_height(src);
if ((ww != glyph->info.width) || (hh != glyph->info.height) ||
((src_depth != 1) && (src_depth != 8)))
{
LLOGLN(0, ("glyph_get_data: bad glyph"));
free_pixman_pict(pPicture, src);
return 0;
}
rfd->data_bytes = glyph->info.height * dst_stride_bytes;
rfd->data = (char*)g_malloc(rfd->data_bytes, 1);
rfd->offset = -glyph->info.x;
rfd->baseline = -glyph->info.y;
rfd->width = glyph->info.width;
rfd->height = glyph->info.height;
pi32 = pixman_image_get_data(src);
pi8 = (char*)pi32;
for (j = 0; j < rfd->height; j++)
{
for (i = 0; i < rfd->width; i++)
{
pixel = pi8[j * stride_bytes + i];
pixel = lget_pixel(pi8, i, j, src_depth, src_stride_bytes);
if (g_do_alpha_glyphs)
{
rfd->data[j * stride_bytes + i] = pixel;
rfd->data[j * dst_stride_bytes + i] = pixel;
}
else
{

@ -48,7 +48,7 @@ int g_can_do_pix_to_pix = 0;
int g_do_dirty_os = 1; /* delay remoting off screen bitmaps */
int g_do_dirty_ons = 0; /* delay remoting screen */
int g_do_glyph_cache = 1;
int g_do_glyph_cache = 0;
int g_do_alpha_glyphs = 1;
Bool g_wrapWindow = 1;
Bool g_wrapPixmap = 1;

@ -54,6 +54,7 @@ extern ScreenPtr g_pScreen; /* from rdpmain.c */
extern int g_Bpp; /* from rdpmain.c */
extern int g_Bpp_mask; /* from rdpmain.c */
extern rdpScreenInfoRec g_rdpScreen; /* from rdpmain.c */
extern int g_do_glyph_cache; /* from rdpmain.c */
extern int g_can_do_pix_to_pix; /* from rdpmain.c */
extern int g_use_rail; /* from rdpmain.c */
@ -157,6 +158,7 @@ rdpup_disconnect(void)
g_free(g_os_bitmaps);
g_os_bitmaps = 0;
g_use_rail = 0;
g_do_glyph_cache = 0;
return 0;
}
@ -765,6 +767,11 @@ rdpup_process_msg(struct stream *s)
rdpup_send_rail();
#endif
}
if (g_rdpScreen.client_info.orders[0x1b]) /* 27 NEG_GLYPH_INDEX_INDEX */
{
LLOGLN(0, (" using glyph cache"));
g_do_glyph_cache = 1;
}
if (g_rdpScreen.client_info.offscreen_cache_entries == 2000)
{
LLOGLN(0, (" client can do offscreen to offscreen blits"));

Loading…
Cancel
Save