Removed palette, using GDI one.

This commit is contained in:
Armin Novak 2016-07-15 16:45:36 +02:00
parent 6525a564f1
commit bc8217ed42
4 changed files with 13 additions and 22 deletions

View File

@ -1214,16 +1214,8 @@ static BOOL xf_post_connect(freerdp* instance)
if (!gdi_init(instance, xfc->format)) if (!gdi_init(instance, xfc->format))
return FALSE; return FALSE;
if (settings->SoftwareGdi) if (!settings->SoftwareGdi)
{
rdpGdi* gdi = context->gdi;
xfc->palette = gdi->palette;
}
else
{
xfc->palette = context->gdi->palette;
xf_gdi_register_update_callbacks(update); xf_gdi_register_update_callbacks(update);
}
xfc->srcBpp = settings->ColorDepth; xfc->srcBpp = settings->ColorDepth;
xfc->sessionWidth = settings->DesktopWidth; xfc->sessionWidth = settings->DesktopWidth;

View File

@ -256,7 +256,7 @@ UINT32 xf_convert_rdp_order_color(xfContext* xfc, UINT32 color)
case 8: case 8:
color = (color >> 16) & (UINT32) 0xFF; color = (color >> 16) & (UINT32) 0xFF;
UINT32 dstColor = xfc->palette.palette[color]; UINT32 dstColor = xfc->context.gdi->palette.palette[color];
SplitColor(dstColor, xfc->format, &r, &g, &b, SplitColor(dstColor, xfc->format, &r, &g, &b,
NULL, NULL); NULL, NULL);
break; break;
@ -285,7 +285,7 @@ Pixmap xf_brush_new(xfContext* xfc, int width, int height, int bpp, BYTE* data)
cdata = (BYTE*) _aligned_malloc(width * height * 4, 16); cdata = (BYTE*) _aligned_malloc(width * height * 4, 16);
freerdp_image_copy(cdata, xfc->format, -1, 0, 0, freerdp_image_copy(cdata, xfc->format, -1, 0, 0,
width, height, data, brushFormat, -1, 0, 0, width, height, data, brushFormat, -1, 0, 0,
&xfc->palette); &xfc->context.gdi->palette);
image = XCreateImage(xfc->display, xfc->visual, xfc->depth, image = XCreateImage(xfc->display, xfc->visual, xfc->depth,
ZPixmap, 0, (char*) cdata, width, height, xfc->scanline_pad, 0); ZPixmap, 0, (char*) cdata, width, height, xfc->scanline_pad, 0);
gc = XCreateGC(xfc->display, xfc->drawable, 0, NULL); gc = XCreateGC(xfc->display, xfc->drawable, 0, NULL);
@ -366,7 +366,7 @@ BOOL xf_gdi_bitmap_update(rdpContext* context,
xfc->format, -1, xfc->format, -1,
0, 0, 0, 0,
nWidth, nHeight, nWidth, nHeight,
&xfc->palette); &xfc->context.gdi->palette);
} }
else else
{ {
@ -387,7 +387,7 @@ BOOL xf_gdi_bitmap_update(rdpContext* context,
pDstData = xfc->bitmap_buffer; pDstData = xfc->bitmap_buffer;
status = freerdp_image_copy(pDstData, xfc->format, -1, 0, 0, status = freerdp_image_copy(pDstData, xfc->format, -1, 0, 0,
nWidth, nHeight, pSrcData, SrcFormat, nWidth, nHeight, pSrcData, SrcFormat,
-1, 0, 0, &xfc->palette); -1, 0, 0, &xfc->context.gdi->palette);
pSrcData = xfc->bitmap_buffer; pSrcData = xfc->bitmap_buffer;
} }
@ -424,12 +424,12 @@ static BOOL xf_gdi_palette_update(rdpContext* context,
const PALETTE_ENTRY* pe; const PALETTE_ENTRY* pe;
xfContext* xfc = (xfContext*) context; xfContext* xfc = (xfContext*) context;
xf_lock_x11(xfc, FALSE); xf_lock_x11(xfc, FALSE);
xfc->palette.format = xfc->format; xfc->context.gdi->palette.format = xfc->format;
for (index = 0; index < palette->number; index++) for (index = 0; index < palette->number; index++)
{ {
pe = &(palette->entries[index]); pe = &(palette->entries[index]);
xfc->palette.palette[index] = GetColor(xfc->format, xfc->context.gdi->palette.palette[index] = GetColor(xfc->format,
pe->red, pe->green, pe->blue, 0xFF); pe->red, pe->green, pe->blue, 0xFF);
} }
@ -1178,7 +1178,7 @@ static BOOL xf_gdi_surface_bits(rdpContext* context,
pDstData = xfc->bitmap_buffer; pDstData = xfc->bitmap_buffer;
freerdp_image_copy(pDstData, xfc->format, -1, 0, 0, freerdp_image_copy(pDstData, xfc->format, -1, 0, 0,
cmd->width, cmd->height, pSrcData, cmd->width, cmd->height, pSrcData,
PIXEL_FORMAT_BGRX32_VF, -1, 0, 0, &xfc->palette); PIXEL_FORMAT_BGRX32_VF, -1, 0, 0, &xfc->context.gdi->palette);
image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0,
(char*) pDstData, cmd->width, cmd->height, xfc->scanline_pad, 0); (char*) pDstData, cmd->width, cmd->height, xfc->scanline_pad, 0);
XPutImage(xfc->display, xfc->primary, xfc->gc, image, 0, 0, XPutImage(xfc->display, xfc->primary, xfc->gc, image, 0, 0,

View File

@ -73,7 +73,7 @@ static BOOL xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap)
freerdp_image_copy(data, xfc->format, -1, 0, 0, freerdp_image_copy(data, xfc->format, -1, 0, 0,
bitmap->width, bitmap->height, bitmap->width, bitmap->height,
bitmap->data, SrcFormat, bitmap->data, SrcFormat,
-1, 0, 0, &xfc->palette); -1, 0, 0, &context->gdi->palette);
_aligned_free(bitmap->data); _aligned_free(bitmap->data);
bitmap->data = data; bitmap->data = data;
bitmap->format = xfc->format; bitmap->format = xfc->format;
@ -155,7 +155,7 @@ static BOOL xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
pSrcData, SrcSize, bpp, pSrcData, SrcSize, bpp,
pDstData, xfc->format, pDstData, xfc->format,
-1, 0, 0, width, height, -1, 0, 0, width, height,
&xfc->palette); &context->gdi->palette);
} }
else else
{ {
@ -174,7 +174,7 @@ static BOOL xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
SrcFormat = gdi_get_pixel_format(bpp, TRUE); SrcFormat = gdi_get_pixel_format(bpp, TRUE);
status = freerdp_image_copy(pDstData, xfc->format, -1, 0, 0, status = freerdp_image_copy(pDstData, xfc->format, -1, 0, 0,
width, height, pSrcData, width, height, pSrcData,
SrcFormat, -1, 0, 0, &xfc->palette); SrcFormat, -1, 0, 0, &context->gdi->palette);
} }
bitmap->compressed = FALSE; bitmap->compressed = FALSE;
@ -224,7 +224,7 @@ static BOOL xf_Pointer_New(rdpContext* context, rdpPointer* pointer)
pointer->width * 4, 0, 0, pointer->width, pointer->height, pointer->width * 4, 0, 0, pointer->width, pointer->height,
pointer->xorMaskData, pointer->lengthXorMask, pointer->xorMaskData, pointer->lengthXorMask,
pointer->andMaskData, pointer->lengthAndMask, pointer->andMaskData, pointer->lengthAndMask,
pointer->xorBpp, &xfc->palette) < 0) pointer->xorBpp, &context->gdi->palette) < 0)
{ {
free(ci.pixels); free(ci.pixels);
xf_unlock_x11(xfc, FALSE); xf_unlock_x11(xfc, FALSE);

View File

@ -135,7 +135,6 @@ struct xf_context
HANDLE mutex; HANDLE mutex;
BOOL UseXThreads; BOOL UseXThreads;
BOOL cursorHidden; BOOL cursorHidden;
gdiPalette palette;
HGDI_DC hdc; HGDI_DC hdc;
UINT32 bitmap_size; UINT32 bitmap_size;