Compile fix

This commit is contained in:
Armin Novak 2016-07-11 11:05:38 +02:00
parent 5039a82d8b
commit bbae42d9c3
2 changed files with 115 additions and 112 deletions

View File

@ -355,7 +355,7 @@ UINT32 gdi_get_pixel_format(UINT32 bitsPerPixel, BOOL vFlip)
return format;
}
INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, int x, int y)
BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, UINT32 x, UINT32 y)
{
BYTE* p;
HGDI_BITMAP hBmp = (HGDI_BITMAP) hdcBmp->selectedObject;
@ -368,8 +368,8 @@ INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, int x, int y)
else
{
WLog_ERR(TAG,
"gdi_get_bitmap_pointer: requesting invalid pointer: (%d,%d) in %dx%d",
x, y, hBmp->width, hBmp->height);
"gdi_get_bitmap_pointer: requesting invalid pointer: (%d,%d) in %dx%d",
x, y, hBmp->width, hBmp->height);
return 0;
}
}
@ -381,7 +381,7 @@ INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, int x, int y)
* @param y dest y-coordinate
* @return color
*/
INLINE BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, int x, int y)
BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, UINT32 x, UINT32 y)
{
BYTE* p;
@ -403,7 +403,7 @@ INLINE BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, int x, int y)
y = (y + hBmpBrush->height - (hdcBrush->brush->nYOrg % hBmpBrush->height)) %
hBmpBrush->height;
p = hBmpBrush->data + (y * hBmpBrush->scanline) + (x * GetBytesPerPixel(
hBmpBrush->format));
hBmpBrush->format));
return p;
}
}
@ -414,7 +414,7 @@ INLINE BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, int x, int y)
}
gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp,
BYTE* data)
BYTE* data)
{
gdiBitmap* bitmap;
bitmap = (gdiBitmap*) calloc(1, sizeof(gdiBitmap));
@ -458,7 +458,7 @@ void gdi_bitmap_free_ex(gdiBitmap* bitmap)
}
static BOOL gdi_bitmap_update(rdpContext* context,
const BITMAP_UPDATE* bitmapUpdate)
const BITMAP_UPDATE* bitmapUpdate)
{
int status;
UINT32 index;
@ -484,21 +484,21 @@ static BOOL gdi_bitmap_update(rdpContext* context,
if (bitsPerPixel < 32)
{
status = interleaved_decompress(codecs->interleaved,
pSrcData, SrcSize,
bitsPerPixel,
gdi->primary_buffer,
gdi->dstFormat,
gdi->stride, nXDst, nYDst,
nWidth, nHeight,
&gdi->palette);
pSrcData, SrcSize,
bitsPerPixel,
gdi->primary_buffer,
gdi->dstFormat,
gdi->stride, nXDst, nYDst,
nWidth, nHeight,
&gdi->palette);
}
else
{
status = planar_decompress(codecs->planar, pSrcData,
SrcSize, gdi->primary_buffer,
gdi->dstFormat,
gdi->stride,
nXDst, nYDst, nWidth, nHeight, TRUE);
SrcSize, gdi->primary_buffer,
gdi->dstFormat,
gdi->stride,
nXDst, nYDst, nWidth, nHeight, TRUE);
}
if (status < 0)
@ -512,19 +512,19 @@ static BOOL gdi_bitmap_update(rdpContext* context,
UINT32 SrcFormat = gdi_get_pixel_format(bitsPerPixel, TRUE);
UINT32 nSrcStep = nWidth * GetBytesPerPixel(SrcFormat);
nWidth = MIN(bitmap->destRight,
gdi->width - 1) - bitmap->destLeft + 1; /* clip width */
gdi->width - 1) - bitmap->destLeft + 1; /* clip width */
nHeight = MIN(bitmap->destBottom,
gdi->height - 1) - bitmap->destTop + 1; /* clip height */
gdi->height - 1) - bitmap->destTop + 1; /* clip height */
if (!freerdp_image_copy(gdi->primary_buffer, gdi->dstFormat, gdi->stride,
nXDst, nYDst, nWidth, nHeight,
pSrcData, SrcFormat, nSrcStep,
nXSrc, nYSrc, &gdi->palette))
nXDst, nYDst, nWidth, nHeight,
pSrcData, SrcFormat, nSrcStep,
nXSrc, nYSrc, &gdi->palette))
return FALSE;
}
if (!gdi_InvalidateRegion(gdi->primary->hdc, nXDst, nYDst,
nWidth, nHeight))
nWidth, nHeight))
return FALSE;
}
@ -532,7 +532,7 @@ static BOOL gdi_bitmap_update(rdpContext* context,
}
static BOOL gdi_palette_update(rdpContext* context,
const PALETTE_UPDATE* palette)
const PALETTE_UPDATE* palette)
{
int index;
const PALETTE_ENTRY* pe;
@ -556,7 +556,7 @@ static BOOL gdi_set_bounds(rdpContext* context, const rdpBounds* bounds)
if (bounds)
{
gdi_SetClipRgn(gdi->drawing->hdc, bounds->left, bounds->top,
bounds->right - bounds->left + 1, bounds->bottom - bounds->top + 1);
bounds->right - bounds->left + 1, bounds->bottom - bounds->top + 1);
}
else
{
@ -570,8 +570,8 @@ static BOOL gdi_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt)
{
rdpGdi* gdi = context->gdi;
return gdi_BitBlt(gdi->drawing->hdc, dstblt->nLeftRect, dstblt->nTopRect,
dstblt->nWidth, dstblt->nHeight, NULL, 0, 0,
gdi_rop3_code(dstblt->bRop), &gdi->palette);
dstblt->nWidth, dstblt->nHeight, NULL, 0, 0,
gdi_rop3_code(dstblt->bRop), &gdi->palette);
}
static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
@ -586,9 +586,9 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
BOOL ret = TRUE;
UINT32 SrcFormat = gdi_get_pixel_format(patblt->brush.bpp, FALSE);
foreColor = ConvertColor(patblt->foreColor, SrcFormat,
gdi->dstFormat, &gdi->palette);
gdi->dstFormat, &gdi->palette);
backColor = ConvertColor(patblt->backColor, SrcFormat,
gdi->dstFormat, &gdi->palette);
gdi->dstFormat, &gdi->palette);
originalColor = gdi_SetTextColor(gdi->drawing->hdc, foreColor);
if (brush->style == GDI_BS_SOLID)
@ -603,8 +603,8 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
}
if (!gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
patblt->nWidth, patblt->nHeight, rop,
gdi->primary->hdc, nXSrc, nYSrc))
patblt->nWidth, patblt->nHeight, rop,
gdi->primary->hdc, nXSrc, nYSrc))
{
ret = FALSE;
}
@ -626,7 +626,7 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
hatched = GDI_BS_HATCHED_PATTERNS + (8 * brush->hatch);
freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
hatched, backColor, foreColor, &gdi->palette);
hatched, backColor, foreColor, &gdi->palette);
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
if (!hBmp)
@ -650,8 +650,8 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
gdi->drawing->hdc->brush->nYOrg = brush->y;
if (!gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
patblt->nWidth, patblt->nHeight, rop,
gdi->primary->hdc, nXSrc, nYSrc))
patblt->nWidth, patblt->nHeight, rop,
gdi->primary->hdc, nXSrc, nYSrc))
{
ret = FALSE;
}
@ -676,8 +676,8 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
}
if (!freerdp_image_copy(data, gdi->dstFormat, 0, 0, 0,
8, 8, brush->data, brushFormat, 0, 0, 0,
&gdi->palette))
8, 8, brush->data, brushFormat, 0, 0, 0,
&gdi->palette))
{
ret = FALSE;
goto out_error;
@ -694,7 +694,7 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
}
freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
brush->data, backColor, foreColor, &gdi->palette);
brush->data, backColor, foreColor, &gdi->palette);
}
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
@ -720,8 +720,8 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
gdi->drawing->hdc->brush->nYOrg = brush->y;
if (!gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
patblt->nWidth, patblt->nHeight, rop,
gdi->primary->hdc, nXSrc, nYSrc))
patblt->nWidth, patblt->nHeight, rop,
gdi->primary->hdc, nXSrc, nYSrc))
{
ret = FALSE;
}
@ -743,13 +743,13 @@ static BOOL gdi_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt)
{
rdpGdi* gdi = context->gdi;
return gdi_BitBlt(gdi->drawing->hdc, scrblt->nLeftRect, scrblt->nTopRect,
scrblt->nWidth, scrblt->nHeight, gdi->primary->hdc,
scrblt->nXSrc, scrblt->nYSrc, gdi_rop3_code(scrblt->bRop),
&gdi->palette);
scrblt->nWidth, scrblt->nHeight, gdi->primary->hdc,
scrblt->nXSrc, scrblt->nYSrc, gdi_rop3_code(scrblt->bRop),
&gdi->palette);
}
static BOOL gdi_opaque_rect(rdpContext* context,
const OPAQUE_RECT_ORDER* opaque_rect)
const OPAQUE_RECT_ORDER* opaque_rect)
{
GDI_RECT rect;
HGDI_BRUSH hBrush;
@ -758,9 +758,9 @@ static BOOL gdi_opaque_rect(rdpContext* context,
BOOL ret;
UINT32 SrcFormat = gdi_get_pixel_format(context->settings->ColorDepth, FALSE);
gdi_CRgnToRect(opaque_rect->nLeftRect, opaque_rect->nTopRect,
opaque_rect->nWidth, opaque_rect->nHeight, &rect);
opaque_rect->nWidth, opaque_rect->nHeight, &rect);
brush_color = ConvertColor(opaque_rect->color, SrcFormat,
gdi->dstFormat, &gdi->palette);
gdi->dstFormat, &gdi->palette);
if (!(hBrush = gdi_CreateSolidBrush(brush_color)))
return FALSE;
@ -771,7 +771,7 @@ static BOOL gdi_opaque_rect(rdpContext* context,
}
static BOOL gdi_multi_opaque_rect(rdpContext* context,
const MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect)
const MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect)
{
UINT32 i;
GDI_RECT rect;
@ -786,9 +786,9 @@ static BOOL gdi_multi_opaque_rect(rdpContext* context,
{
rectangle = &multi_opaque_rect->rectangles[i];
gdi_CRgnToRect(rectangle->left, rectangle->top,
rectangle->width, rectangle->height, &rect);
rectangle->width, rectangle->height, &rect);
brush_color = ConvertColor(multi_opaque_rect->color, SrcFormat,
gdi->dstFormat, &gdi->palette);
gdi->dstFormat, &gdi->palette);
hBrush = gdi_CreateSolidBrush(brush_color);
if (!hBrush)
@ -813,7 +813,7 @@ static BOOL gdi_line_to(rdpContext* context, const LINE_TO_ORDER* lineTo)
UINT32 SrcFormat = gdi_get_pixel_format(context->settings->ColorDepth, FALSE);
if (!(hPen = gdi_CreatePen(lineTo->penStyle, lineTo->penWidth, color,
SrcFormat, &gdi->palette)))
SrcFormat, &gdi->palette)))
return FALSE;
gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT) hPen);
@ -864,9 +864,9 @@ static BOOL gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
rdpGdi* gdi = context->gdi;
bitmap = (gdiBitmap*) memblt->bitmap;
return gdi_BitBlt(gdi->drawing->hdc, memblt->nLeftRect, memblt->nTopRect,
memblt->nWidth, memblt->nHeight, bitmap->hdc,
memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop),
&gdi->palette);
memblt->nWidth, memblt->nHeight, bitmap->hdc,
memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop),
&gdi->palette);
}
static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
@ -884,9 +884,9 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
brush = &mem3blt->brush;
bitmap = (gdiBitmap*) mem3blt->bitmap;
foreColor = ConvertColor(mem3blt->foreColor, SrcFormat,
gdi->dstFormat, &gdi->palette);
gdi->dstFormat, &gdi->palette);
backColor = ConvertColor(mem3blt->backColor, SrcFormat,
gdi->dstFormat, &gdi->palette);
gdi->dstFormat, &gdi->palette);
originalColor = gdi_SetTextColor(gdi->drawing->hdc, foreColor);
if (brush->style == GDI_BS_SOLID)
@ -901,9 +901,9 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
}
gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect,
mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
&gdi->palette);
mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
&gdi->palette);
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
gdi->drawing->hdc->brush = originalBrush;
}
@ -924,7 +924,7 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
}
if (!freerdp_image_copy(data, gdi->dstFormat, 0, 0, 0,
8, 8, brush->data, brushFormat, 0, 0, 0, &gdi->palette))
8, 8, brush->data, brushFormat, 0, 0, 0, &gdi->palette))
{
ret = FALSE;
goto out_fail;
@ -941,7 +941,7 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
}
freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
brush->data, backColor, foreColor, &gdi->palette);
brush->data, backColor, foreColor, &gdi->palette);
}
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
@ -965,9 +965,9 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
gdi->drawing->hdc->brush->nXOrg = brush->x;
gdi->drawing->hdc->brush->nYOrg = brush->y;
gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect,
mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
&gdi->palette);
mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
&gdi->palette);
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
gdi->drawing->hdc->brush = originalBrush;
}
@ -982,7 +982,7 @@ out_fail:
}
static BOOL gdi_polygon_sc(rdpContext* context,
const POLYGON_SC_ORDER* polygon_sc)
const POLYGON_SC_ORDER* polygon_sc)
{
WLog_VRB(TAG, "%s: not implemented", __FUNCTION__);
return TRUE;
@ -995,31 +995,31 @@ static BOOL gdi_polygon_cb(rdpContext* context, POLYGON_CB_ORDER* polygon_cb)
}
static BOOL gdi_ellipse_sc(rdpContext* context,
const ELLIPSE_SC_ORDER* ellipse_sc)
const ELLIPSE_SC_ORDER* ellipse_sc)
{
WLog_VRB(TAG, "%s: not implemented", __FUNCTION__);
return TRUE;
}
static BOOL gdi_ellipse_cb(rdpContext* context,
const ELLIPSE_CB_ORDER* ellipse_cb)
const ELLIPSE_CB_ORDER* ellipse_cb)
{
WLog_VRB(TAG, "%s: not implemented", __FUNCTION__);
return TRUE;
}
static BOOL gdi_frame_marker(rdpContext* context,
const FRAME_MARKER_ORDER* frameMarker)
const FRAME_MARKER_ORDER* frameMarker)
{
return TRUE;
}
BOOL gdi_surface_frame_marker(rdpContext* context,
const SURFACE_FRAME_MARKER* surfaceFrameMarker)
const SURFACE_FRAME_MARKER* surfaceFrameMarker)
{
DEBUG_GDI("frameId %d frameAction %d",
surfaceFrameMarker->frameId,
surfaceFrameMarker->frameAction);
surfaceFrameMarker->frameId,
surfaceFrameMarker->frameAction);
switch (surfaceFrameMarker->frameAction)
{
@ -1040,25 +1040,25 @@ BOOL gdi_surface_frame_marker(rdpContext* context,
}
static BOOL gdi_surface_bits(rdpContext* context,
const SURFACE_BITS_COMMAND* cmd)
const SURFACE_BITS_COMMAND* cmd)
{
rdpGdi* gdi = context->gdi;
DEBUG_GDI("destLeft %d destTop %d destRight %d destBottom %d "
"bpp %d codecID %d width %d height %d length %d",
cmd->destLeft, cmd->destTop, cmd->destRight, cmd->destBottom,
cmd->bpp, cmd->codecID, cmd->width, cmd->height, cmd->bitmapDataLength);
"bpp %d codecID %d width %d height %d length %d",
cmd->destLeft, cmd->destTop, cmd->destRight, cmd->destBottom,
cmd->bpp, cmd->codecID, cmd->width, cmd->height, cmd->bitmapDataLength);
switch (cmd->codecID)
{
case RDP_CODEC_ID_REMOTEFX:
{
if (!rfx_process_message(gdi->codecs->rfx, cmd->bitmapData,
PIXEL_FORMAT_BGRX32,
cmd->bitmapDataLength,
0, 0,
gdi->bitmap_buffer, gdi->dstFormat,
cmd->width * GetBytesPerPixel(gdi->dstFormat),
cmd->height, NULL))
PIXEL_FORMAT_BGRX32,
cmd->bitmapDataLength,
0, 0,
gdi->bitmap_buffer, gdi->dstFormat,
cmd->width * GetBytesPerPixel(gdi->dstFormat),
cmd->height, NULL))
{
WLog_ERR(TAG, "Failed to process RemoteFX message");
return FALSE;
@ -1069,10 +1069,10 @@ static BOOL gdi_surface_bits(rdpContext* context,
case RDP_CODEC_ID_NSCODEC:
{
if (!nsc_process_message(gdi->codecs->nsc, cmd->bpp, cmd->width,
cmd->height, cmd->bitmapData,
cmd->bitmapDataLength, gdi->primary_buffer,
gdi->dstFormat, gdi->stride, cmd->destLeft, cmd->destTop,
cmd->width, cmd->height))
cmd->height, cmd->bitmapData,
cmd->bitmapDataLength, gdi->primary_buffer,
gdi->dstFormat, gdi->stride, cmd->destLeft, cmd->destTop,
cmd->width, cmd->height))
return FALSE;
}
break;
@ -1080,9 +1080,9 @@ static BOOL gdi_surface_bits(rdpContext* context,
case RDP_CODEC_ID_NONE:
{
if (!freerdp_image_copy(gdi->primary_buffer, gdi->dstFormat, gdi->stride,
cmd->destLeft, cmd->destTop, cmd->width, cmd->height,
cmd->bitmapData, PIXEL_FORMAT_XRGB32_VF, 0, 0, 0,
&gdi->palette))
cmd->destLeft, cmd->destTop, cmd->width, cmd->height,
cmd->bitmapData, PIXEL_FORMAT_XRGB32_VF, 0, 0, 0,
&gdi->palette))
return FALSE;
}
break;
@ -1134,7 +1134,7 @@ void gdi_register_update_callbacks(rdpUpdate* update)
}
static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, BYTE* buffer,
void (*pfree)(void*))
void (*pfree)(void*))
{
gdi->primary = (gdiBitmap*) calloc(1, sizeof(gdiBitmap));
@ -1147,14 +1147,14 @@ static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, BYTE* buffer,
if (!buffer)
{
gdi->primary->bitmap = gdi_CreateCompatibleBitmap(
gdi->hdc, gdi->width, gdi->height);
gdi->hdc, gdi->width, gdi->height);
}
else
{
gdi->primary->bitmap = gdi_CreateBitmapEx(gdi->width, gdi->height,
gdi->dstFormat,
gdi->stride,
gdi->primary_buffer, pfree);
gdi->dstFormat,
gdi->stride,
gdi->primary_buffer, pfree);
}
gdi->stride = gdi->primary->bitmap->scanline;
@ -1176,7 +1176,7 @@ static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, BYTE* buffer,
gdi->primary->hdc->hwnd->count = 32;
if (!(gdi->primary->hdc->hwnd->cinvalid = (HGDI_RGN) calloc(
gdi->primary->hdc->hwnd->count, sizeof(GDI_RGN))))
gdi->primary->hdc->hwnd->count, sizeof(GDI_RGN))))
goto fail_hwnd;
gdi->primary->hdc->hwnd->ninvalid = 0;
@ -1202,8 +1202,8 @@ BOOL gdi_resize(rdpGdi* gdi, UINT32 width, UINT32 height)
}
BOOL gdi_resize_ex(rdpGdi* gdi, UINT32 width, UINT32 height,
INT32 stride, INT32 format, BYTE* buffer,
void (*pfree)(void*))
INT32 stride, INT32 format, BYTE* buffer,
void (*pfree)(void*))
{
if (!gdi || !gdi->primary)
return FALSE;
@ -1233,7 +1233,7 @@ BOOL gdi_init(freerdp* instance, UINT32 format)
}
BOOL gdi_init_ex(freerdp* instance, UINT32 format, UINT32 stride, BYTE* buffer,
void (*pfree)(void*))
void (*pfree)(void*))
{
rdpGdi* gdi;
rdpCache* cache = NULL;
@ -1251,9 +1251,9 @@ BOOL gdi_init_ex(freerdp* instance, UINT32 format, UINT32 stride, BYTE* buffer,
gdi->dstFormat = format;
/* default internal buffer format */
WLog_INFO(TAG, "Local framebuffer format %s",
GetColorFormatName(gdi->dstFormat));
GetColorFormatName(gdi->dstFormat));
WLog_INFO(TAG, "Remote framebuffer format %s",
GetColorFormatName(SrcFormat));
GetColorFormatName(SrcFormat));
if (!(gdi->hdc = gdi_GetDC()))
goto fail_get_hdc;
@ -1272,7 +1272,7 @@ BOOL gdi_init_ex(freerdp* instance, UINT32 format, UINT32 stride, BYTE* buffer,
}
if (!freerdp_client_codecs_reset(gdi->codecs, FREERDP_CODEC_ALL, gdi->width,
gdi->height))
gdi->height))
goto fail_register_graphics;
gdi_register_update_callbacks(instance->update);

View File

@ -56,8 +56,8 @@ HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, UINT32 nWidth, UINT32 nHeight,
nSrcStep = nWidth * GetBytesPerPixel(SrcFormat);
if (!freerdp_image_copy(pDstData, gdi->dstFormat, nDstStep, 0, 0,
nWidth, nHeight, pSrcData, SrcFormat, nSrcStep, 0, 0,
&gdi->palette))
nWidth, nHeight, pSrcData, SrcFormat, nSrcStep, 0, 0,
&gdi->palette))
{
_aligned_free(pDstData);
return NULL;
@ -119,8 +119,10 @@ static BOOL gdi_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap)
gdiBitmap* gdi_bitmap = (gdiBitmap*) bitmap;
width = bitmap->right - bitmap->left + 1;
height = bitmap->bottom - bitmap->top + 1;
return gdi_BitBlt(context->gdi->primary->hdc, bitmap->left, bitmap->top,
width, height, gdi_bitmap->hdc, 0, 0, GDI_SRCCOPY);
return gdi_BitBlt(context->gdi->primary->hdc,
bitmap->left, bitmap->top,
width, height, gdi_bitmap->hdc,
0, 0, GDI_SRCCOPY, &context->gdi->palette);
}
static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
@ -148,11 +150,11 @@ static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
if (bpp < 32)
{
status = interleaved_decompress(gdi->codecs->interleaved,
pSrcData, SrcSize,
bpp,
pDstData, gdi->dstFormat,
0, 0, 0, width, height,
&gdi->palette);
pSrcData, SrcSize,
bpp,
pDstData, gdi->dstFormat,
0, 0, 0, width, height,
&gdi->palette);
}
else
{
@ -171,8 +173,8 @@ static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
{
SrcFormat = gdi_get_pixel_format(bpp, FALSE);
status = freerdp_image_copy(pDstData, gdi->dstFormat, 0, 0, 0,
width, height, pSrcData, SrcFormat,
0, 0, 0, &gdi->palette);
width, height, pSrcData, SrcFormat,
0, 0, 0, &gdi->palette);
}
bitmap->compressed = FALSE;
@ -250,7 +252,8 @@ static BOOL gdi_Glyph_Draw(rdpContext* context, rdpGlyph* glyph, UINT32 x,
rdpGdi* gdi = context->gdi;
gdi_glyph = (gdiGlyph*) glyph;
return gdi_BitBlt(gdi->drawing->hdc, x, y, gdi_glyph->bitmap->width,
gdi_glyph->bitmap->height, gdi_glyph->hdc, 0, 0, GDI_DSPDxax);
gdi_glyph->bitmap->height, gdi_glyph->hdc, 0, 0,
GDI_DSPDxax, &context->gdi->palette);
}
static BOOL gdi_Glyph_BeginDraw(rdpContext* context, UINT32 x, UINT32 y,
@ -283,7 +286,7 @@ static BOOL gdi_Glyph_EndDraw(rdpContext* context, UINT32 x, UINT32 y,
rdpGdi* gdi = context->gdi;
UINT32 SrcFormat = gdi_get_pixel_format(context->settings->ColorDepth, FALSE);
bgcolor = ConvertColor(bgcolor, SrcFormat,
gdi->dstFormat, &gdi->palette);
gdi->dstFormat, &gdi->palette);
gdi->textColor = gdi_SetTextColor(gdi->drawing->hdc, bgcolor);
return TRUE;
}