Code refactoring.
This commit is contained in:
parent
e6e8f2d4f2
commit
5e9c9f90ab
@ -415,13 +415,13 @@ static BOOL BitBlt_DSPDxax(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
|
|||||||
|
|
||||||
if (srcp && dstp)
|
if (srcp && dstp)
|
||||||
{
|
{
|
||||||
UINT32 color;
|
UINT32 dstColor;
|
||||||
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
|
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
|
||||||
UINT32 colorB = ReadColor(dstp, hdcDest->format);
|
UINT32 colorB = ReadColor(dstp, hdcDest->format);
|
||||||
colorA = ConvertColor(colorA, hdcSrc->format,
|
colorA = ConvertColor(colorA, hdcSrc->format,
|
||||||
hdcDest->format, palette);
|
hdcDest->format, palette);
|
||||||
color = (colorA & color) | (~colorA & colorB);
|
dstColor = (colorA & color) | (~colorA & colorB);
|
||||||
WriteColor(dstp, hdcDest->format, color);
|
WriteColor(dstp, hdcDest->format, dstColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -799,9 +799,7 @@ BOOL gdi_BitBlt(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
|
|||||||
hdcSrc, nXSrc, nYSrc, palette);
|
hdcSrc, nXSrc, nYSrc, palette);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
WLog_ERR(TAG, "BitBlt: unknown rop: 0x%08X", rop);
|
WLog_ERR(TAG, "BitBlt: unknown rop: 0x%08X", rop);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -563,7 +563,7 @@ static BOOL BitBlt_WHITENESS(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
|
|||||||
UINT32 nWidth, UINT32 nHeight)
|
UINT32 nWidth, UINT32 nHeight)
|
||||||
{
|
{
|
||||||
UINT32 x, y;
|
UINT32 x, y;
|
||||||
UINT32 color = GetColor(hdcDest->format, 0, 0, 0, 0);
|
UINT32 color = GetColor(hdcDest->format, 0xFF, 0xFF, 0xFF, 0xFF);
|
||||||
|
|
||||||
for (y = 0; y < nHeight; y++)
|
for (y = 0; y < nHeight; y++)
|
||||||
{
|
{
|
||||||
|
@ -308,7 +308,7 @@ static const DWORD rop3_code_table[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Hatch Patterns as monochrome data */
|
/* Hatch Patterns as monochrome data */
|
||||||
static BYTE GDI_BS_HATCHED_PATTERNS[] =
|
static const BYTE GDI_BS_HATCHED_PATTERNS[] =
|
||||||
{
|
{
|
||||||
0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, /* HS_HORIZONTAL */
|
0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, /* HS_HORIZONTAL */
|
||||||
0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, /* HS_VERTICAL */
|
0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, /* HS_VERTICAL */
|
||||||
@ -319,7 +319,6 @@ static BYTE GDI_BS_HATCHED_PATTERNS[] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* GDI Helper Functions */
|
/* GDI Helper Functions */
|
||||||
|
|
||||||
INLINE DWORD gdi_rop3_code(BYTE code)
|
INLINE DWORD gdi_rop3_code(BYTE code)
|
||||||
{
|
{
|
||||||
return rop3_code_table[code];
|
return rop3_code_table[code];
|
||||||
@ -487,6 +486,7 @@ static BOOL gdi_bitmap_update(rdpContext* context,
|
|||||||
FREERDP_CODEC_INTERLEAVED,
|
FREERDP_CODEC_INTERLEAVED,
|
||||||
gdi->width, gdi->height))
|
gdi->width, gdi->height))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
status = interleaved_decompress(codecs->interleaved,
|
status = interleaved_decompress(codecs->interleaved,
|
||||||
pSrcData, SrcSize,
|
pSrcData, SrcSize,
|
||||||
bitsPerPixel,
|
bitsPerPixel,
|
||||||
@ -502,6 +502,7 @@ static BOOL gdi_bitmap_update(rdpContext* context,
|
|||||||
FREERDP_CODEC_PLANAR,
|
FREERDP_CODEC_PLANAR,
|
||||||
gdi->width, gdi->height))
|
gdi->width, gdi->height))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
status = planar_decompress(codecs->planar, pSrcData,
|
status = planar_decompress(codecs->planar, pSrcData,
|
||||||
SrcSize, gdi->primary_buffer,
|
SrcSize, gdi->primary_buffer,
|
||||||
gdi->dstFormat,
|
gdi->dstFormat,
|
||||||
@ -542,14 +543,13 @@ static BOOL gdi_bitmap_update(rdpContext* context,
|
|||||||
static BOOL gdi_palette_update(rdpContext* context,
|
static BOOL gdi_palette_update(rdpContext* context,
|
||||||
const PALETTE_UPDATE* palette)
|
const PALETTE_UPDATE* palette)
|
||||||
{
|
{
|
||||||
int index;
|
UINT32 index;
|
||||||
const PALETTE_ENTRY* pe;
|
|
||||||
rdpGdi* gdi = context->gdi;
|
rdpGdi* gdi = context->gdi;
|
||||||
gdi->palette.format = gdi->dstFormat;
|
gdi->palette.format = gdi->dstFormat;
|
||||||
|
|
||||||
for (index = 0; index < (int) palette->number; index++)
|
for (index = 0; index < palette->number; index++)
|
||||||
{
|
{
|
||||||
pe = &(palette->entries[index]);
|
const PALETTE_ENTRY* pe = &(palette->entries[index]);
|
||||||
gdi->palette.palette[index] =
|
gdi->palette.palette[index] =
|
||||||
GetColor(gdi->dstFormat, pe->red, pe->green, pe->blue, 0xFF);
|
GetColor(gdi->dstFormat, pe->red, pe->green, pe->blue, 0xFF);
|
||||||
}
|
}
|
||||||
@ -567,9 +567,7 @@ static BOOL gdi_set_bounds(rdpContext* context, const rdpBounds* bounds)
|
|||||||
bounds->right - bounds->left + 1, bounds->bottom - bounds->top + 1);
|
bounds->right - bounds->left + 1, bounds->bottom - bounds->top + 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
gdi_SetNullClipRgn(gdi->drawing->hdc);
|
gdi_SetNullClipRgn(gdi->drawing->hdc);
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -584,7 +582,6 @@ static BOOL gdi_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt)
|
|||||||
|
|
||||||
static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||||
{
|
{
|
||||||
BYTE* data;
|
|
||||||
const rdpBrush* brush = &patblt->brush;
|
const rdpBrush* brush = &patblt->brush;
|
||||||
UINT32 foreColor;
|
UINT32 foreColor;
|
||||||
UINT32 backColor;
|
UINT32 backColor;
|
||||||
@ -602,8 +599,9 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
|||||||
gdi->dstFormat, &gdi->palette);
|
gdi->dstFormat, &gdi->palette);
|
||||||
originalColor = gdi_SetTextColor(gdi->drawing->hdc, foreColor);
|
originalColor = gdi_SetTextColor(gdi->drawing->hdc, foreColor);
|
||||||
|
|
||||||
if (brush->style == GDI_BS_SOLID)
|
switch (brush->style)
|
||||||
{
|
{
|
||||||
|
case GDI_BS_SOLID:
|
||||||
originalBrush = gdi->drawing->hdc->brush;
|
originalBrush = gdi->drawing->hdc->brush;
|
||||||
gdi->drawing->hdc->brush = gdi_CreateSolidBrush(foreColor);
|
gdi->drawing->hdc->brush = gdi_CreateSolidBrush(foreColor);
|
||||||
|
|
||||||
@ -622,12 +620,14 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
|||||||
|
|
||||||
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
||||||
gdi->drawing->hdc->brush = originalBrush;
|
gdi->drawing->hdc->brush = originalBrush;
|
||||||
}
|
break;
|
||||||
else if (brush->style == GDI_BS_HATCHED)
|
|
||||||
|
case GDI_BS_HATCHED:
|
||||||
{
|
{
|
||||||
BYTE* hatched;
|
const BYTE* hatched;
|
||||||
HGDI_BITMAP hBmp;
|
HGDI_BITMAP hBmp;
|
||||||
data = (BYTE*) _aligned_malloc(8 * 8 * GetBytesPerPixel(gdi->dstFormat), 16);
|
BYTE* data = (BYTE*) _aligned_malloc(8 * 8 * GetBytesPerPixel(gdi->dstFormat),
|
||||||
|
16);
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
{
|
{
|
||||||
@ -652,7 +652,6 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
|||||||
|
|
||||||
if (!gdi->drawing->hdc->brush)
|
if (!gdi->drawing->hdc->brush)
|
||||||
{
|
{
|
||||||
_aligned_free(data);
|
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
goto out_error;
|
goto out_error;
|
||||||
}
|
}
|
||||||
@ -670,15 +669,14 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
|||||||
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
||||||
gdi->drawing->hdc->brush = originalBrush;
|
gdi->drawing->hdc->brush = originalBrush;
|
||||||
}
|
}
|
||||||
else if (brush->style == GDI_BS_PATTERN)
|
break;
|
||||||
|
|
||||||
|
case GDI_BS_PATTERN:
|
||||||
{
|
{
|
||||||
HGDI_BITMAP hBmp;
|
HGDI_BITMAP hBmp;
|
||||||
UINT32 brushFormat;
|
UINT32 brushFormat;
|
||||||
|
BYTE* data = (BYTE*) _aligned_malloc(8 * 8 * GetBytesPerPixel(gdi->dstFormat),
|
||||||
if (brush->bpp > 1)
|
16);
|
||||||
{
|
|
||||||
brushFormat = gdi_get_pixel_format(brush->bpp, FALSE);
|
|
||||||
data = (BYTE*) _aligned_malloc(8 * 8 * GetBytesPerPixel(gdi->dstFormat), 16);
|
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
{
|
{
|
||||||
@ -686,26 +684,28 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
|||||||
goto out_error;
|
goto out_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (brush->bpp > 1)
|
||||||
|
{
|
||||||
|
brushFormat = gdi_get_pixel_format(brush->bpp, FALSE);
|
||||||
|
|
||||||
if (!freerdp_image_copy(data, gdi->dstFormat, 0, 0, 0,
|
if (!freerdp_image_copy(data, gdi->dstFormat, 0, 0, 0,
|
||||||
8, 8, brush->data, brushFormat, 0, 0, 0,
|
8, 8, brush->data, brushFormat, 0, 0, 0,
|
||||||
&gdi->palette))
|
&gdi->palette))
|
||||||
{
|
{
|
||||||
|
_aligned_free(data);
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
goto out_error;
|
goto out_error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = (BYTE*) _aligned_malloc(8 * 8 * GetBytesPerPixel(gdi->dstFormat), 16);
|
if (!freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
|
||||||
|
brush->data, backColor, foreColor, &gdi->palette))
|
||||||
if (!data)
|
|
||||||
{
|
{
|
||||||
|
_aligned_free(data);
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
goto out_error;
|
goto out_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
|
|
||||||
brush->data, backColor, foreColor, &gdi->palette);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
|
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
|
||||||
@ -740,9 +740,11 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
|||||||
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
||||||
gdi->drawing->hdc->brush = originalBrush;
|
gdi->drawing->hdc->brush = originalBrush;
|
||||||
}
|
}
|
||||||
else
|
break;
|
||||||
{
|
|
||||||
|
default:
|
||||||
WLog_ERR(TAG, "unimplemented brush style:%d", brush->style);
|
WLog_ERR(TAG, "unimplemented brush style:%d", brush->style);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
out_error:
|
out_error:
|
||||||
@ -871,9 +873,8 @@ static BOOL gdi_polyline(rdpContext* context, const POLYLINE_ORDER* polyline)
|
|||||||
|
|
||||||
static BOOL gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
|
static BOOL gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
|
||||||
{
|
{
|
||||||
gdiBitmap* bitmap;
|
gdiBitmap* bitmap = (gdiBitmap*) memblt->bitmap;
|
||||||
rdpGdi* gdi = context->gdi;
|
rdpGdi* gdi = context->gdi;
|
||||||
bitmap = (gdiBitmap*) memblt->bitmap;
|
|
||||||
return gdi_BitBlt(gdi->drawing->hdc, memblt->nLeftRect, memblt->nTopRect,
|
return gdi_BitBlt(gdi->drawing->hdc, memblt->nLeftRect, memblt->nTopRect,
|
||||||
memblt->nWidth, memblt->nHeight, bitmap->hdc,
|
memblt->nWidth, memblt->nHeight, bitmap->hdc,
|
||||||
memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop),
|
memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop),
|
||||||
@ -882,26 +883,22 @@ static BOOL gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt)
|
|||||||
|
|
||||||
static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
||||||
{
|
{
|
||||||
BYTE* data;
|
|
||||||
const rdpBrush* brush;
|
|
||||||
UINT32 foreColor;
|
|
||||||
UINT32 backColor;
|
|
||||||
gdiBitmap* bitmap;
|
|
||||||
UINT32 originalColor;
|
|
||||||
HGDI_BRUSH originalBrush;
|
HGDI_BRUSH originalBrush;
|
||||||
rdpGdi* gdi = context->gdi;
|
rdpGdi* gdi = context->gdi;
|
||||||
BOOL ret = TRUE;
|
BOOL ret = TRUE;
|
||||||
UINT32 SrcFormat = gdi_get_pixel_format(context->settings->ColorDepth, FALSE);
|
const UINT32 SrcFormat = gdi_get_pixel_format(context->settings->ColorDepth,
|
||||||
brush = &mem3blt->brush;
|
FALSE);
|
||||||
bitmap = (gdiBitmap*) mem3blt->bitmap;
|
const rdpBrush* brush = &mem3blt->brush;
|
||||||
foreColor = ConvertColor(mem3blt->foreColor, SrcFormat,
|
gdiBitmap* bitmap = (gdiBitmap*) mem3blt->bitmap;
|
||||||
|
const UINT32 foreColor = ConvertColor(mem3blt->foreColor, SrcFormat,
|
||||||
gdi->dstFormat, &gdi->palette);
|
gdi->dstFormat, &gdi->palette);
|
||||||
backColor = ConvertColor(mem3blt->backColor, SrcFormat,
|
const UINT32 backColor = ConvertColor(mem3blt->backColor, SrcFormat,
|
||||||
gdi->dstFormat, &gdi->palette);
|
gdi->dstFormat, &gdi->palette);
|
||||||
originalColor = gdi_SetTextColor(gdi->drawing->hdc, foreColor);
|
const UINT32 originalColor = gdi_SetTextColor(gdi->drawing->hdc, foreColor);
|
||||||
|
|
||||||
if (brush->style == GDI_BS_SOLID)
|
switch (brush->style)
|
||||||
{
|
{
|
||||||
|
case GDI_BS_SOLID:
|
||||||
originalBrush = gdi->drawing->hdc->brush;
|
originalBrush = gdi->drawing->hdc->brush;
|
||||||
gdi->drawing->hdc->brush = gdi_CreateSolidBrush(foreColor);
|
gdi->drawing->hdc->brush = gdi_CreateSolidBrush(foreColor);
|
||||||
|
|
||||||
@ -911,22 +908,20 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
|||||||
goto out_fail;
|
goto out_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect,
|
ret = gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect,
|
||||||
mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
|
mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
|
||||||
mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
|
mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
|
||||||
&gdi->palette);
|
&gdi->palette);
|
||||||
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
||||||
gdi->drawing->hdc->brush = originalBrush;
|
gdi->drawing->hdc->brush = originalBrush;
|
||||||
}
|
break;
|
||||||
else if (brush->style == GDI_BS_PATTERN)
|
|
||||||
|
case GDI_BS_PATTERN:
|
||||||
{
|
{
|
||||||
HGDI_BITMAP hBmp;
|
HGDI_BITMAP hBmp;
|
||||||
UINT32 brushFormat;
|
UINT32 brushFormat;
|
||||||
|
BYTE* data = (BYTE*) _aligned_malloc(8 * 8 * GetBytesPerPixel(gdi->dstFormat),
|
||||||
if (brush->bpp > 1)
|
16);
|
||||||
{
|
|
||||||
brushFormat = gdi_get_pixel_format(brush->bpp, FALSE);
|
|
||||||
data = (BYTE*) _aligned_malloc(8 * 8 * GetBytesPerPixel(gdi->dstFormat), 16);
|
|
||||||
|
|
||||||
if (!data)
|
if (!data)
|
||||||
{
|
{
|
||||||
@ -934,33 +929,37 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
|||||||
goto out_fail;
|
goto out_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (brush->bpp > 1)
|
||||||
|
{
|
||||||
|
brushFormat = gdi_get_pixel_format(brush->bpp, FALSE);
|
||||||
|
|
||||||
if (!freerdp_image_copy(data, gdi->dstFormat, 0, 0, 0,
|
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;
|
ret = FALSE;
|
||||||
|
_aligned_free(data);
|
||||||
goto out_fail;
|
goto out_fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
data = (BYTE*) _aligned_malloc(8 * 8 * GetBytesPerPixel(gdi->dstFormat), 16);
|
if (!freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
|
||||||
|
brush->data, backColor, foreColor,
|
||||||
if (!data)
|
&gdi->palette))
|
||||||
{
|
{
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
_aligned_free(data);
|
||||||
goto out_fail;
|
goto out_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
|
|
||||||
brush->data, backColor, foreColor, &gdi->palette);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
|
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
|
||||||
|
|
||||||
if (!hBmp)
|
if (!hBmp)
|
||||||
{
|
{
|
||||||
_aligned_free(data);
|
|
||||||
ret = FALSE;
|
ret = FALSE;
|
||||||
|
_aligned_free(data);
|
||||||
goto out_fail;
|
goto out_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -975,16 +974,18 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
|||||||
|
|
||||||
gdi->drawing->hdc->brush->nXOrg = brush->x;
|
gdi->drawing->hdc->brush->nXOrg = brush->x;
|
||||||
gdi->drawing->hdc->brush->nYOrg = brush->y;
|
gdi->drawing->hdc->brush->nYOrg = brush->y;
|
||||||
gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect,
|
ret = gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect,
|
||||||
mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
|
mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
|
||||||
mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
|
mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
|
||||||
&gdi->palette);
|
&gdi->palette);
|
||||||
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
||||||
gdi->drawing->hdc->brush = originalBrush;
|
gdi->drawing->hdc->brush = originalBrush;
|
||||||
}
|
}
|
||||||
else
|
break;
|
||||||
{
|
|
||||||
|
default:
|
||||||
WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%d", brush->style);
|
WLog_ERR(TAG, "Mem3Blt unimplemented brush style:%d", brush->style);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
out_fail:
|
out_fail:
|
||||||
@ -1309,6 +1310,7 @@ void gdi_free(freerdp* instance)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
gdi = instance->context->gdi;
|
gdi = instance->context->gdi;
|
||||||
|
|
||||||
if (gdi)
|
if (gdi)
|
||||||
{
|
{
|
||||||
gdi_bitmap_free_ex(gdi->primary);
|
gdi_bitmap_free_ex(gdi->primary);
|
||||||
@ -1317,6 +1319,7 @@ void gdi_free(freerdp* instance)
|
|||||||
}
|
}
|
||||||
|
|
||||||
context = instance->context;
|
context = instance->context;
|
||||||
|
|
||||||
if (context->cache)
|
if (context->cache)
|
||||||
{
|
{
|
||||||
cache_free(context->cache);
|
cache_free(context->cache);
|
||||||
|
@ -84,7 +84,6 @@ static BOOL gdi_Bitmap_New(rdpContext* context, rdpBitmap* bitmap)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
UINT32 format = bitmap->format;
|
UINT32 format = bitmap->format;
|
||||||
|
|
||||||
gdi_bitmap->bitmap = gdi_create_bitmap(gdi, bitmap->width,
|
gdi_bitmap->bitmap = gdi_create_bitmap(gdi, bitmap->width,
|
||||||
bitmap->height,
|
bitmap->height,
|
||||||
format, bitmap->data);
|
format, bitmap->data);
|
||||||
@ -115,10 +114,9 @@ static void gdi_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap)
|
|||||||
|
|
||||||
static BOOL gdi_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap)
|
static BOOL gdi_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap)
|
||||||
{
|
{
|
||||||
int width, height;
|
|
||||||
gdiBitmap* gdi_bitmap = (gdiBitmap*) bitmap;
|
gdiBitmap* gdi_bitmap = (gdiBitmap*) bitmap;
|
||||||
width = bitmap->right - bitmap->left + 1;
|
UINT32 width = bitmap->right - bitmap->left + 1;
|
||||||
height = bitmap->bottom - bitmap->top + 1;
|
UINT32 height = bitmap->bottom - bitmap->top + 1;
|
||||||
return gdi_BitBlt(context->gdi->primary->hdc,
|
return gdi_BitBlt(context->gdi->primary->hdc,
|
||||||
bitmap->left, bitmap->top,
|
bitmap->left, bitmap->top,
|
||||||
width, height, gdi_bitmap->hdc,
|
width, height, gdi_bitmap->hdc,
|
||||||
@ -153,6 +151,7 @@ static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
|
|||||||
FREERDP_CODEC_INTERLEAVED,
|
FREERDP_CODEC_INTERLEAVED,
|
||||||
gdi->width, gdi->height))
|
gdi->width, gdi->height))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
status = interleaved_decompress(context->codecs->interleaved,
|
status = interleaved_decompress(context->codecs->interleaved,
|
||||||
pSrcData, SrcSize,
|
pSrcData, SrcSize,
|
||||||
bpp,
|
bpp,
|
||||||
@ -166,6 +165,7 @@ static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
|
|||||||
FREERDP_CODEC_PLANAR,
|
FREERDP_CODEC_PLANAR,
|
||||||
gdi->width, gdi->height))
|
gdi->width, gdi->height))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
status = planar_decompress(context->codecs->planar, pSrcData, SrcSize,
|
status = planar_decompress(context->codecs->planar, pSrcData, SrcSize,
|
||||||
pDstData, gdi->dstFormat, 0, 0, 0,
|
pDstData, gdi->dstFormat, 0, 0, 0,
|
||||||
width, height, TRUE);
|
width, height, TRUE);
|
||||||
|
Loading…
Reference in New Issue
Block a user