Fixed #3810: Renamed color functions
This commit is contained in:
parent
8f27b1a51c
commit
57958cb178
@ -584,7 +584,7 @@ static UINT rdpgfx_write_surface_command(wStream* s,
|
||||
break;
|
||||
|
||||
default:
|
||||
WLog_ERR(TAG, "Format %s not supported!", GetColorFormatName(cmd->format));
|
||||
WLog_ERR(TAG, "Format %s not supported!", FreeRDPGetColorFormatName(cmd->format));
|
||||
return ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ static BOOL wf_decode_color(wfContext* wfc, const UINT32 srcColor,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*color = ConvertColor(srcColor, SrcFormat,
|
||||
*color = FreeRDPConvertColor(srcColor, SrcFormat,
|
||||
DstFormat, &gdi->palette);
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ static INLINE DWORD AreColorFormatsEqualNoAlpha(DWORD first, DWORD second)
|
||||
*
|
||||
* @return A string representation of format
|
||||
*/
|
||||
static const char* GetColorFormatName(UINT32 format)
|
||||
static const char* FreeRDPGetColorFormatName(UINT32 format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
@ -509,7 +509,7 @@ static INLINE void SplitColor(UINT32 color, UINT32 format, BYTE* _r, BYTE* _g,
|
||||
if (_a)
|
||||
*_a = 0x00;
|
||||
|
||||
WLog_ERR(CTAG, "Unsupported format %s", GetColorFormatName(format));
|
||||
WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -527,7 +527,7 @@ static INLINE void SplitColor(UINT32 color, UINT32 format, BYTE* _r, BYTE* _g,
|
||||
* @return The pixel color in the desired format. Value is in internal
|
||||
* representation.
|
||||
*/
|
||||
static INLINE UINT32 GetColor(UINT32 format, BYTE r, BYTE g, BYTE b, BYTE a)
|
||||
static INLINE UINT32 FreeRDPGetColor(UINT32 format, BYTE r, BYTE g, BYTE b, BYTE a)
|
||||
{
|
||||
UINT32 _r = r;
|
||||
UINT32 _g = g;
|
||||
@ -603,7 +603,7 @@ static INLINE UINT32 GetColor(UINT32 format, BYTE r, BYTE g, BYTE b, BYTE a)
|
||||
/* 1bpp formats */
|
||||
case PIXEL_FORMAT_MONO:
|
||||
default:
|
||||
WLog_ERR(CTAG, "Unsupported format %s", GetColorFormatName(format));
|
||||
WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -679,7 +679,7 @@ static INLINE UINT32 ReadColor(const BYTE* src, UINT32 format)
|
||||
break;
|
||||
|
||||
default:
|
||||
WLog_ERR(CTAG, "Unsupported format %s", GetColorFormatName(format));
|
||||
WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format));
|
||||
color = 0;
|
||||
break;
|
||||
}
|
||||
@ -732,7 +732,7 @@ static INLINE BOOL WriteColor(BYTE* dst, UINT32 format, UINT32 color)
|
||||
break;
|
||||
|
||||
default:
|
||||
WLog_ERR(CTAG, "Unsupported format %s", GetColorFormatName(format));
|
||||
WLog_ERR(CTAG, "Unsupported format %s", FreeRDPGetColorFormatName(format));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -751,7 +751,7 @@ static INLINE BOOL WriteColor(BYTE* dst, UINT32 format, UINT32 color)
|
||||
*
|
||||
* @return The converted pixel color in dstFormat representation
|
||||
*/
|
||||
static INLINE UINT32 ConvertColor(UINT32 color, UINT32 srcFormat,
|
||||
static INLINE UINT32 FreeRDPConvertColor(UINT32 color, UINT32 srcFormat,
|
||||
UINT32 dstFormat, const gdiPalette* palette)
|
||||
{
|
||||
BYTE r = 0;
|
||||
@ -759,7 +759,7 @@ static INLINE UINT32 ConvertColor(UINT32 color, UINT32 srcFormat,
|
||||
BYTE b = 0;
|
||||
BYTE a = 0;
|
||||
SplitColor(color, srcFormat, &r, &g, &b, &a, palette);
|
||||
return GetColor(dstFormat, r, g, b, a);
|
||||
return FreeRDPGetColor(dstFormat, r, g, b, a);
|
||||
}
|
||||
|
||||
/***
|
||||
@ -872,7 +872,7 @@ FREERDP_API BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat,
|
||||
* @param nWidth width to copy in pixels
|
||||
* @param nHeight height to copy in pixels
|
||||
* @param color Pixel color in DstFormat (internal representation format,
|
||||
* use GetColor to create)
|
||||
* use FreeRDPGetColor to create)
|
||||
*
|
||||
* @return TRUE if success, FALSE otherwise
|
||||
*/
|
||||
@ -880,6 +880,12 @@ FREERDP_API BOOL freerdp_image_fill(BYTE* pDstData, DWORD DstFormat,
|
||||
UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst,
|
||||
UINT32 nWidth, UINT32 nHeight, UINT32 color);
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
#define GetColorFormatName FreeRDPGetColorFormatName
|
||||
#define GetColor FreeRDPGetColor
|
||||
#define ConvertColor FreeRDPFreeRDPConvertColor
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -176,7 +176,7 @@ static BOOL clear_decompress_subcode_rlex(wStream* s,
|
||||
Stream_Read_UINT8(s, b);
|
||||
Stream_Read_UINT8(s, g);
|
||||
Stream_Read_UINT8(s, r);
|
||||
palette[i] = GetColor(DstFormat, r, g, b, 0xFF);
|
||||
palette[i] = FreeRDPGetColor(DstFormat, r, g, b, 0xFF);
|
||||
}
|
||||
|
||||
pixelIndex = 0;
|
||||
@ -393,7 +393,7 @@ static BOOL clear_decompress_residual_data(CLEAR_CONTEXT* clear,
|
||||
Stream_Read_UINT8(s, r);
|
||||
Stream_Read_UINT8(s, runLengthFactor);
|
||||
suboffset += 4;
|
||||
color = GetColor(clear->format, r, g, b, 0xFF);
|
||||
color = FreeRDPGetColor(clear->format, r, g, b, 0xFF);
|
||||
|
||||
if (runLengthFactor >= 0xFF)
|
||||
{
|
||||
@ -655,7 +655,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear,
|
||||
Stream_Read_UINT8(s, g);
|
||||
Stream_Read_UINT8(s, r);
|
||||
suboffset += 11;
|
||||
colorBkg = GetColor(clear->format, r, g, b, 0xFF);
|
||||
colorBkg = FreeRDPGetColor(clear->format, r, g, b, 0xFF);
|
||||
|
||||
if (xEnd < xStart)
|
||||
{
|
||||
@ -766,7 +766,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear,
|
||||
Stream_Read_UINT8(s, b);
|
||||
Stream_Read_UINT8(s, g);
|
||||
Stream_Read_UINT8(s, r);
|
||||
color = GetColor(clear->format, r, g, b, 0xFF);
|
||||
color = FreeRDPGetColor(clear->format, r, g, b, 0xFF);
|
||||
|
||||
if (!WriteColor(dstBuffer, clear->format, color))
|
||||
return FALSE;
|
||||
@ -888,7 +888,7 @@ static BOOL clear_decompress_bands_data(CLEAR_CONTEXT* clear,
|
||||
BYTE* pDstPixel8 = &pDstData[((nYDstRel + y) * nDstStep) +
|
||||
((nXDstRel + i) * GetBytesPerPixel(DstFormat))];
|
||||
UINT32 color = ReadColor(pSrcPixel, clear->format);
|
||||
color = ConvertColor(color, clear->format,
|
||||
color = FreeRDPConvertColor(color, clear->format,
|
||||
DstFormat, NULL);
|
||||
|
||||
if (!WriteColor(pDstPixel8, DstFormat, color))
|
||||
|
@ -142,7 +142,7 @@ static INLINE UINT32 freerdp_image_inverted_pointer_color(UINT32 x, UINT32 y,
|
||||
#else
|
||||
BYTE fill = 0x00;
|
||||
#endif
|
||||
return GetColor(format, fill, fill, fill, 0xFF);
|
||||
return FreeRDPGetColor(format, fill, fill, fill, 0xFF);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -237,11 +237,11 @@ BOOL freerdp_image_copy_from_pointer_data(
|
||||
}
|
||||
|
||||
if (!andPixel && !xorPixel)
|
||||
color = GetColor(DstFormat, 0, 0, 0, 0xFF); /* black */
|
||||
color = FreeRDPGetColor(DstFormat, 0, 0, 0, 0xFF); /* black */
|
||||
else if (!andPixel && xorPixel)
|
||||
color = GetColor(DstFormat, 0xFF, 0xFF, 0xFF, 0xFF); /* white */
|
||||
color = FreeRDPGetColor(DstFormat, 0xFF, 0xFF, 0xFF, 0xFF); /* white */
|
||||
else if (andPixel && !xorPixel)
|
||||
color = GetColor(DstFormat, 0, 0, 0, 0); /* transparent */
|
||||
color = FreeRDPGetColor(DstFormat, 0, 0, 0, 0); /* transparent */
|
||||
else if (andPixel && xorPixel)
|
||||
color = freerdp_image_inverted_pointer_color(x, y, DstFormat); /* inverted */
|
||||
|
||||
@ -325,7 +325,7 @@ BOOL freerdp_image_copy_from_pointer_data(
|
||||
xorPixel = ReadColor(xorBits, pixelFormat);
|
||||
}
|
||||
|
||||
xorPixel = ConvertColor(xorPixel,
|
||||
xorPixel = FreeRDPConvertColor(xorPixel,
|
||||
pixelFormat,
|
||||
PIXEL_FORMAT_ARGB32,
|
||||
palette);
|
||||
@ -351,7 +351,7 @@ BOOL freerdp_image_copy_from_pointer_data(
|
||||
xorPixel = freerdp_image_inverted_pointer_color(x, y, PIXEL_FORMAT_ARGB32);
|
||||
}
|
||||
|
||||
color = ConvertColor(xorPixel, PIXEL_FORMAT_ARGB32,
|
||||
color = FreeRDPConvertColor(xorPixel, PIXEL_FORMAT_ARGB32,
|
||||
DstFormat, palette);
|
||||
WriteColor(pDstPixel, DstFormat, color);
|
||||
pDstPixel += GetBytesPerPixel(DstFormat);
|
||||
@ -526,7 +526,7 @@ BOOL freerdp_image_copy(BYTE* pDstData, DWORD DstFormat,
|
||||
UINT32 dstColor;
|
||||
UINT32 color = ReadColor(&srcLine[(x + nXSrc) * srcByte],
|
||||
SrcFormat);
|
||||
dstColor = ConvertColor(color, SrcFormat, DstFormat, palette);
|
||||
dstColor = FreeRDPConvertColor(color, SrcFormat, DstFormat, palette);
|
||||
WriteColor(&dstLine[(x + nXDst) * dstByte], DstFormat, dstColor);
|
||||
}
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ static INLINE BOOL writeLine(BYTE** ppRgba, UINT32 DstFormat, UINT32 width, cons
|
||||
for (x = 0; x < width; x++)
|
||||
{
|
||||
BYTE alpha = *(*ppA)++;
|
||||
UINT32 color = GetColor(DstFormat, *(*ppR)++, *(*ppG)++, *(*ppB)++, alpha);
|
||||
UINT32 color = FreeRDPGetColor(DstFormat, *(*ppR)++, *(*ppG)++, *(*ppB)++, alpha);
|
||||
WriteColor(*ppRgba, DstFormat, color);
|
||||
*ppRgba += GetBytesPerPixel(DstFormat);
|
||||
}
|
||||
@ -269,7 +269,7 @@ static INLINE BOOL writeLine(BYTE** ppRgba, UINT32 DstFormat, UINT32 width, cons
|
||||
|
||||
for (x = 0; x < width; x++)
|
||||
{
|
||||
UINT32 color = GetColor(DstFormat, *(*ppR)++, *(*ppG)++, *(*ppB)++, alpha);
|
||||
UINT32 color = FreeRDPGetColor(DstFormat, *(*ppR)++, *(*ppG)++, *(*ppB)++, alpha);
|
||||
WriteColor(*ppRgba, DstFormat, color);
|
||||
*ppRgba += GetBytesPerPixel(DstFormat);
|
||||
}
|
||||
@ -573,7 +573,7 @@ BOOL planar_decompress(BITMAP_PLANAR_CONTEXT* planar,
|
||||
}
|
||||
else /* NoAlpha */
|
||||
{
|
||||
const UINT32 color = GetColor(TempFormat, 0, 0, 0, 0xFF);
|
||||
const UINT32 color = FreeRDPGetColor(TempFormat, 0, 0, 0, 0xFF);
|
||||
|
||||
if (!freerdp_image_fill(pTempData, TempFormat, nTempStep, nXDst, nYDst, nSrcWidth, nSrcHeight,
|
||||
color))
|
||||
|
@ -2969,7 +2969,7 @@ static BOOL RunTestPlanar(BITMAP_PLANAR_CONTEXT* planar, const BYTE* srcBitmap,
|
||||
srcBitmap, srcFormat, width, height, 0, NULL, &dstSize);
|
||||
BYTE* decompressedBitmap = (BYTE*) calloc(height, width * GetBytesPerPixel(dstFormat));
|
||||
printf("%s [%s] --> [%s]: ", __FUNCTION__,
|
||||
GetColorFormatName(srcFormat), GetColorFormatName(dstFormat));
|
||||
FreeRDPGetColorFormatName(srcFormat), FreeRDPGetColorFormatName(dstFormat));
|
||||
fflush(stdout);
|
||||
printf("TODO: Skipping unfinished test!");
|
||||
rc = TRUE;
|
||||
@ -3009,8 +3009,8 @@ static BOOL RunTestPlanarSingleColor(BITMAP_PLANAR_CONTEXT* planar,
|
||||
{
|
||||
UINT32 i, j, x, y;
|
||||
BOOL rc = FALSE;
|
||||
printf("%s: [%s] --> [%s]: ", __FUNCTION__, GetColorFormatName(srcFormat),
|
||||
GetColorFormatName(dstFormat));
|
||||
printf("%s: [%s] --> [%s]: ", __FUNCTION__, FreeRDPGetColorFormatName(srcFormat),
|
||||
FreeRDPGetColorFormatName(dstFormat));
|
||||
fflush(stdout);
|
||||
|
||||
for (j = 0; j < 100; j += 8)
|
||||
@ -3019,7 +3019,7 @@ static BOOL RunTestPlanarSingleColor(BITMAP_PLANAR_CONTEXT* planar,
|
||||
{
|
||||
UINT32 compressedSize;
|
||||
const UINT32 fill = j;
|
||||
const UINT32 color = GetColor(srcFormat, (fill >> 8) & 0xF, (fill >> 4) & 0xF,
|
||||
const UINT32 color = FreeRDPGetColor(srcFormat, (fill >> 8) & 0xF, (fill >> 4) & 0xF,
|
||||
(fill) & 0xF, 0xFF);
|
||||
const UINT32 width = i;
|
||||
const UINT32 height = i;
|
||||
|
@ -230,11 +230,11 @@ static UINT32 process_rop(UINT32 src, UINT32 dst, UINT32 pat, const char* rop,
|
||||
switch (op)
|
||||
{
|
||||
case '0':
|
||||
stack[stackp++] = GetColor(format, 0, 0, 0, 0xFF);
|
||||
stack[stackp++] = FreeRDPGetColor(format, 0, 0, 0, 0xFF);
|
||||
break;
|
||||
|
||||
case '1':
|
||||
stack[stackp++] = GetColor(format, 0xFF, 0xFF, 0xFF, 0xFF);
|
||||
stack[stackp++] = FreeRDPGetColor(format, 0xFF, 0xFF, 0xFF, 0xFF);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
@ -303,7 +303,7 @@ static INLINE BOOL BitBlt_write(HGDI_DC hdcDest, HGDI_DC hdcSrc, UINT32 nXDest,
|
||||
}
|
||||
|
||||
colorC = ReadColor(srcp, hdcSrc->format);
|
||||
colorC = ConvertColor(colorC, hdcSrc->format, hdcDest->format, palette);
|
||||
colorC = FreeRDPConvertColor(colorC, hdcSrc->format, hdcDest->format, palette);
|
||||
}
|
||||
|
||||
if (usePat)
|
||||
|
@ -356,7 +356,7 @@ INLINE BOOL gdi_decode_color(rdpGdi* gdi, const UINT32 srcColor,
|
||||
if (format)
|
||||
*format = gdi->dstFormat;
|
||||
|
||||
*color = ConvertColor(srcColor, SrcFormat, gdi->dstFormat, &gdi->palette);
|
||||
*color = FreeRDPConvertColor(srcColor, SrcFormat, gdi->dstFormat, &gdi->palette);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -509,7 +509,7 @@ static BOOL gdi_palette_update(rdpContext* context,
|
||||
{
|
||||
const PALETTE_ENTRY* pe = &(palette->entries[index]);
|
||||
gdi->palette.palette[index] =
|
||||
GetColor(gdi->dstFormat, pe->red, pe->green, pe->blue, 0xFF);
|
||||
FreeRDPGetColor(gdi->dstFormat, pe->red, pe->green, pe->blue, 0xFF);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -1247,9 +1247,9 @@ BOOL gdi_init_ex(freerdp* instance, UINT32 format, UINT32 stride, BYTE* buffer,
|
||||
gdi->dstFormat = format;
|
||||
/* default internal buffer format */
|
||||
WLog_Print(gdi->log, WLOG_INFO, "Local framebuffer format %s",
|
||||
GetColorFormatName(gdi->dstFormat));
|
||||
FreeRDPGetColorFormatName(gdi->dstFormat));
|
||||
WLog_Print(gdi->log, WLOG_INFO, "Remote framebuffer format %s",
|
||||
GetColorFormatName(SrcFormat));
|
||||
FreeRDPGetColorFormatName(SrcFormat));
|
||||
|
||||
if (!(gdi->hdc = gdi_GetDC()))
|
||||
goto fail;
|
||||
|
@ -579,7 +579,7 @@ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context,
|
||||
|
||||
WLog_WARN(TAG, "TODO gdi_SurfaceCommand_Alpha: status: %"PRIu32"", status);
|
||||
/* fill with green for now to distinguish from the rest */
|
||||
color = GetColor(surface->format, 0x00, 0xFF, 0x00, 0xFF);
|
||||
color = FreeRDPGetColor(surface->format, 0x00, 0xFF, 0x00, 0xFF);
|
||||
|
||||
if (!freerdp_image_fill(surface->data, surface->format, surface->scanline,
|
||||
cmd->left, cmd->top, cmd->width, cmd->height, color))
|
||||
@ -690,7 +690,7 @@ static UINT gdi_SurfaceCommand(RdpgfxClientContext* context,
|
||||
"left=%"PRIu32", top=%"PRIu32", right=%"PRIu32", bottom=%"PRIu32", width=%"PRIu32", height=%"PRIu32" "
|
||||
"length=%"PRIu32", data=%p, extra=%p",
|
||||
cmd->surfaceId, cmd->codecId, cmd->contextId,
|
||||
GetColorFormatName(cmd->format), cmd->left, cmd->top, cmd->right,
|
||||
FreeRDPGetColorFormatName(cmd->format), cmd->left, cmd->top, cmd->right,
|
||||
cmd->bottom, cmd->width, cmd->height, cmd->length, (void*) cmd->data, (void*) cmd->extra);
|
||||
|
||||
switch (cmd->codecId)
|
||||
@ -868,7 +868,7 @@ static UINT gdi_SolidFill(RdpgfxClientContext* context,
|
||||
/* a = solidFill->fillPixel.XA;
|
||||
* Ignore alpha channel, this is a solid fill. */
|
||||
a = 0xFF;
|
||||
color = GetColor(surface->format, r, g, b, a);
|
||||
color = FreeRDPGetColor(surface->format, r, g, b, a);
|
||||
|
||||
for (index = 0; index < solidFill->fillRectCount; index++)
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ static BOOL gdi_rop_color(UINT32 rop, BYTE* pixelPtr, UINT32 pen, UINT32 format)
|
||||
switch (rop)
|
||||
{
|
||||
case GDI_R2_BLACK: /* LineTo_BLACK */
|
||||
dstPixel = GetColor(format, 0, 0, 0, 0xFF);
|
||||
dstPixel = FreeRDPGetColor(format, 0, 0, 0, 0xFF);
|
||||
break;
|
||||
|
||||
case GDI_R2_NOTMERGEPEN: /* LineTo_NOTMERGEPEN */
|
||||
@ -113,7 +113,7 @@ static BOOL gdi_rop_color(UINT32 rop, BYTE* pixelPtr, UINT32 pen, UINT32 format)
|
||||
break;
|
||||
|
||||
case GDI_R2_WHITE: /* LineTo_WHITE */
|
||||
dstPixel = GetColor(format, 0xFF, 0xFF, 0xFF, 0xFF);
|
||||
dstPixel = FreeRDPGetColor(format, 0xFF, 0xFF, 0xFF, 0xFF);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -58,5 +58,5 @@ HGDI_PEN gdi_CreatePen(UINT32 fnPenStyle, UINT32 nWidth, UINT32 crColor,
|
||||
|
||||
INLINE UINT32 gdi_GetPenColor(HGDI_PEN pen, UINT32 format)
|
||||
{
|
||||
return ConvertColor(pen->color, pen->format, format, pen->palette);
|
||||
return FreeRDPConvertColor(pen->color, pen->format, format, pen->palette);
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ BOOL gdi_FillRect(HGDI_DC hdc, const HGDI_RECT rect, HGDI_BRUSH hbr)
|
||||
else
|
||||
{
|
||||
dstColor = ReadColor(patp, hbr->pattern->format);
|
||||
dstColor = ConvertColor(dstColor, hbr->pattern->format, hdc->format, NULL);
|
||||
dstColor = FreeRDPConvertColor(dstColor, hbr->pattern->format, hdc->format, NULL);
|
||||
}
|
||||
|
||||
if (dstp)
|
||||
|
@ -500,7 +500,7 @@ static BOOL test_gdi_BitBlt(UINT32 SrcFormat, UINT32 DstFormat)
|
||||
g.format = DstFormat;
|
||||
|
||||
for (x = 0; x < 256; x++)
|
||||
g.palette[x] = GetColor(DstFormat, x, x, x, 0xFF);
|
||||
g.palette[x] = FreeRDPGetColor(DstFormat, x, x, x, 0xFF);
|
||||
|
||||
if (!(hdcSrc = gdi_GetDC()))
|
||||
{
|
||||
@ -605,8 +605,8 @@ int TestGdiBitBlt(int argc, char* argv[])
|
||||
if (!test_gdi_BitBlt(formatList[x], formatList[y]))
|
||||
{
|
||||
fprintf(stderr, "test_gdi_BitBlt(SrcFormat=%s, DstFormat=%s) failed!\n",
|
||||
GetColorFormatName(formatList[x]),
|
||||
GetColorFormatName(formatList[y]));
|
||||
FreeRDPGetColorFormatName(formatList[x]),
|
||||
FreeRDPGetColorFormatName(formatList[y]));
|
||||
rc = -y;
|
||||
}
|
||||
}
|
||||
|
@ -313,7 +313,7 @@ static BOOL test_gdi_GetPixel(void)
|
||||
for (j = 0; j < width; j++)
|
||||
{
|
||||
UINT32 pixel;
|
||||
const UINT32 color = GetColor(hBitmap->format, rand(), rand(), rand(), rand());
|
||||
const UINT32 color = FreeRDPGetColor(hBitmap->format, rand(), rand(), rand(), rand());
|
||||
WriteColor(&hBitmap->data[i * hBitmap->scanline + j * bpp], hBitmap->format,
|
||||
color);
|
||||
pixel = gdi_GetPixel(hdc, j, i);
|
||||
@ -365,7 +365,7 @@ static BOOL test_gdi_SetPixel(void)
|
||||
for (j = 0; j < width; j++)
|
||||
{
|
||||
UINT32 pixel;
|
||||
const UINT32 color = GetColor(hBitmap->format, rand(), rand(), rand(), rand());
|
||||
const UINT32 color = FreeRDPGetColor(hBitmap->format, rand(), rand(), rand(), rand());
|
||||
gdi_SetPixel(hdc, j, i, color);
|
||||
pixel = ReadColor(&hBitmap->data[i * hBitmap->scanline + j * bpp],
|
||||
hBitmap->format);
|
||||
|
@ -117,7 +117,7 @@ int TestGdiEllipse(int argc, char* argv[])
|
||||
g.format = format;
|
||||
|
||||
for (j = 0; j < 256; j++)
|
||||
g.palette[i] = GetColor(format, j, j, j, 0xFF);
|
||||
g.palette[i] = FreeRDPGetColor(format, j, j, j, 0xFF);
|
||||
|
||||
rc = -1;
|
||||
|
||||
|
@ -700,7 +700,7 @@ int TestGdiLine(int argc, char* argv[])
|
||||
g.format = format;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
g.palette[i] = GetColor(format, i, i, i, 0xFF);
|
||||
g.palette[i] = FreeRDPGetColor(format, i, i, i, 0xFF);
|
||||
|
||||
rc = -1;
|
||||
|
||||
@ -712,7 +712,7 @@ int TestGdiLine(int argc, char* argv[])
|
||||
|
||||
hdc->format = format;
|
||||
gdi_SetNullClipRgn(hdc);
|
||||
penColor = GetColor(format, 0xFF, 0xFF, 0xFF, 0xFF);
|
||||
penColor = FreeRDPGetColor(format, 0xFF, 0xFF, 0xFF, 0xFF);
|
||||
|
||||
if (!(pen = gdi_CreatePen(1, 1, penColor, format, hPalette)))
|
||||
{
|
||||
@ -780,7 +780,7 @@ int TestGdiLine(int argc, char* argv[])
|
||||
{
|
||||
char name[1024];
|
||||
_snprintf(name, sizeof(name), "%s [%s]", gdi_rop_to_string(rop_map[x].rop),
|
||||
GetColorFormatName(hdc->format));
|
||||
FreeRDPGetColorFormatName(hdc->format));
|
||||
|
||||
/* Test Case 13: (0,0) -> (16,16), R2_NOTMERGEPEN */
|
||||
if (!gdi_BitBlt(hdc, 0, 0, 16, 16, hdc, 0, 0, GDI_WHITENESS, hPalette))
|
||||
|
@ -95,7 +95,7 @@ int test_gdi_FillRect(void)
|
||||
hBitmap = gdi_CreateCompatibleBitmap(hdc, width, height);
|
||||
ZeroMemory(hBitmap->data, width * height * GetBytesPerPixel(hdc->format));
|
||||
gdi_SelectObject(hdc, (HGDIOBJECT) hBitmap);
|
||||
color = GetColor(PIXEL_FORMAT_ARGB32, 0xAA, 0xBB, 0xCC, 0xFF);
|
||||
color = FreeRDPGetColor(PIXEL_FORMAT_ARGB32, 0xAA, 0xBB, 0xCC, 0xFF);
|
||||
hBrush = gdi_CreateSolidBrush(color);
|
||||
gdi_FillRect(hdc, hRect, hBrush);
|
||||
badPixels = 0;
|
||||
@ -106,7 +106,7 @@ int test_gdi_FillRect(void)
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
rawPixel = gdi_GetPixel(hdc, x, y);
|
||||
pixel = ConvertColor(rawPixel, hdc->format, PIXEL_FORMAT_ARGB32, NULL);
|
||||
pixel = FreeRDPConvertColor(rawPixel, hdc->format, PIXEL_FORMAT_ARGB32, NULL);
|
||||
|
||||
if (gdi_PtInRect(hRect, x, y))
|
||||
{
|
||||
|
@ -111,7 +111,7 @@ static BOOL CompareBitmaps(HGDI_BITMAP hBmp1, HGDI_BITMAP hBmp2,
|
||||
p2 += GetBytesPerPixel(hBmp2->format);
|
||||
|
||||
if (hBmp1->format != hBmp2->format)
|
||||
colorB = ConvertColor(colorB, hBmp2->format, hBmp1->format, palette);
|
||||
colorB = FreeRDPConvertColor(colorB, hBmp2->format, hBmp1->format, palette);
|
||||
|
||||
if (colorA != colorB)
|
||||
return FALSE;
|
||||
|
@ -82,7 +82,7 @@ static INLINE BYTE* writePixelXRGB(BYTE* dst, DWORD formatSize, UINT32 format,
|
||||
static INLINE BYTE* writePixelGeneric(BYTE* dst, DWORD formatSize, UINT32 format,
|
||||
BYTE R, BYTE G, BYTE B, BYTE A)
|
||||
{
|
||||
UINT32 color = GetColor(format, R, G, B, A);
|
||||
UINT32 color = FreeRDPGetColor(format, R, G, B, A);
|
||||
WriteColor(dst, format, color);
|
||||
return dst + formatSize;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ static BOOL test_RGBToRGB_16s8u_P3AC4R_func(prim_size_t roi, DWORD DstFormat)
|
||||
}
|
||||
}
|
||||
|
||||
printf("Results for %"PRIu32"x%"PRIu32" [%s]", roi.width, roi.height, GetColorFormatName(DstFormat));
|
||||
printf("Results for %"PRIu32"x%"PRIu32" [%s]", roi.width, roi.height, FreeRDPGetColorFormatName(DstFormat));
|
||||
PROFILER_PRINT_HEADER;
|
||||
PROFILER_PRINT(genericProf);
|
||||
PROFILER_PRINT(optProf);
|
||||
|
@ -2329,23 +2329,23 @@ int TestPrimitivesYCbCr(int argc, char* argv[])
|
||||
prim_size_t roi = { 64, 64 };
|
||||
int rc;
|
||||
printf("----------------------- GENERIC %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n",
|
||||
GetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
rc = test_PrimitivesYCbCr(generics, formats[x], roi, TRUE);
|
||||
|
||||
if (rc != PRIMITIVES_SUCCESS)
|
||||
return rc;
|
||||
|
||||
printf("------------------------- END %s ----------------------\n",
|
||||
GetColorFormatName(formats[x]));
|
||||
FreeRDPGetColorFormatName(formats[x]));
|
||||
printf("---------------------- OPTIMIZED %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n",
|
||||
GetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
rc = test_PrimitivesYCbCr(prims, formats[x], roi, TRUE);
|
||||
|
||||
if (rc != PRIMITIVES_SUCCESS)
|
||||
return rc;
|
||||
|
||||
printf("------------------------- END %s ----------------------\n",
|
||||
GetColorFormatName(formats[x]));
|
||||
FreeRDPGetColorFormatName(formats[x]));
|
||||
}
|
||||
}
|
||||
/* Do random data conversion with random sizes */
|
||||
@ -2370,23 +2370,23 @@ int TestPrimitivesYCbCr(int argc, char* argv[])
|
||||
{
|
||||
int rc;
|
||||
printf("----------------------- GENERIC %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n",
|
||||
GetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
rc = test_PrimitivesYCbCr(generics, formats[x], roi, FALSE);
|
||||
|
||||
if (rc != PRIMITIVES_SUCCESS)
|
||||
return rc;
|
||||
|
||||
printf("------------------------- END %s ----------------------\n",
|
||||
GetColorFormatName(formats[x]));
|
||||
FreeRDPGetColorFormatName(formats[x]));
|
||||
printf("---------------------- OPTIMIZED %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n",
|
||||
GetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
rc = test_PrimitivesYCbCr(prims, formats[x], roi, FALSE);
|
||||
|
||||
if (rc != PRIMITIVES_SUCCESS)
|
||||
return rc;
|
||||
|
||||
printf("------------------------- END %s ----------------------\n",
|
||||
GetColorFormatName(formats[x]));
|
||||
FreeRDPGetColorFormatName(formats[x]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2399,23 +2399,23 @@ int TestPrimitivesYCbCr(int argc, char* argv[])
|
||||
{
|
||||
int rc;
|
||||
printf("----------------------- GENERIC %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n",
|
||||
GetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
rc = test_PrimitivesYCbCr(generics, formats[x], roi, FALSE);
|
||||
|
||||
if (rc != PRIMITIVES_SUCCESS)
|
||||
return rc;
|
||||
|
||||
printf("------------------------- END %s ----------------------\n",
|
||||
GetColorFormatName(formats[x]));
|
||||
FreeRDPGetColorFormatName(formats[x]));
|
||||
printf("---------------------- OPTIMIZED %s [%"PRIu32"x%"PRIu32"] COMPARE CONTENT ----\n",
|
||||
GetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
FreeRDPGetColorFormatName(formats[x]), roi.width, roi.height);
|
||||
rc = test_PrimitivesYCbCr(prims, formats[x], roi, FALSE);
|
||||
|
||||
if (rc != PRIMITIVES_SUCCESS)
|
||||
return rc;
|
||||
|
||||
printf("------------------------- END %s ----------------------\n",
|
||||
GetColorFormatName(formats[x]));
|
||||
FreeRDPGetColorFormatName(formats[x]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ static BOOL test_YCoCgRToRGB_8u_AC4R_func(UINT32 width, UINT32 height)
|
||||
{
|
||||
const UINT32 format = formats[x];
|
||||
const UINT32 dstStride = width * GetBytesPerPixel(format);
|
||||
const char* formatName = GetColorFormatName(format);
|
||||
const char* formatName = FreeRDPGetColorFormatName(format);
|
||||
PROFILER_CREATE(genericProf, "YCoCgRToRGB_8u_AC4R-GENERIC");
|
||||
PROFILER_CREATE(optProf, "YCoCgRToRGB_8u_AC4R-OPT");
|
||||
PROFILER_ENTER(genericProf);
|
||||
|
@ -456,7 +456,7 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444)
|
||||
{
|
||||
pstatus_t rc;
|
||||
const UINT32 DstFormat = formats[x];
|
||||
printf("Testing destination color format %s\n", GetColorFormatName(DstFormat));
|
||||
printf("Testing destination color format %s\n", FreeRDPGetColorFormatName(DstFormat));
|
||||
PROFILER_CREATE(rgbToYUV420, "RGBToYUV420");
|
||||
PROFILER_CREATE(rgbToYUV444, "RGBToYUV444");
|
||||
PROFILER_CREATE(yuv420ToRGB, "YUV420ToRGB");
|
||||
|
@ -333,7 +333,7 @@ static int freerdp_image_copy_from_retina(BYTE* pDstData, DWORD DstFormat,
|
||||
R = pSrcPixel[2] + pSrcPixel[6] + pSrcPixel[nSrcStep + 2] + pSrcPixel[nSrcStep +
|
||||
6];
|
||||
pSrcPixel += 8;
|
||||
color = GetColor(DstFormat, R >> 2, G >> 2, B >> 2, 0xFF);
|
||||
color = FreeRDPGetColor(DstFormat, R >> 2, G >> 2, B >> 2, 0xFF);
|
||||
WriteColor(pDstPixel, DstFormat, color);
|
||||
pDstPixel += dstBytesPerPixel;
|
||||
}
|
||||
@ -457,7 +457,6 @@ static int mac_shadow_capture_init(macShadowSubsystem* subsystem)
|
||||
CFDictionaryRef opts;
|
||||
CGDirectDisplayID displayId;
|
||||
displayId = CGMainDisplayID();
|
||||
|
||||
subsystem->captureQueue = dispatch_queue_create("mac.shadow.capture", NULL);
|
||||
keys[0] = (void*) kCGDisplayStreamShowCursor;
|
||||
values[0] = (void*) kCFBooleanFalse;
|
||||
|
Loading…
Reference in New Issue
Block a user