Added more GDI orders.

This commit is contained in:
Armin Novak 2016-08-03 11:31:42 +02:00
parent 9af71b9878
commit bc5aa1be0c
4 changed files with 238 additions and 1 deletions

View File

@ -78,6 +78,9 @@
#define GDI_DSxn 0x00990066 /* D = ~(D ^ S) */
#define GDI_PSDnox 0x002D060A /* D = P ^ (S | ~D) */
#define GDI_PSDPxox 0x002E064A
#define GDI_PSDPxoxn 0x00D1066A
#define GDI_PSDPaox 0x001C06CA
#define GDI_PDSona 0x00100C85 /* D = P & ~(D | S) */
#define GDI_DSPDxox 0x00740646 /* D = D ^ (S | ( P ^ D)) */
#define GDI_DPSDonox 0x005B18A9 /* D = D ^ (P | ~(S | D)) */

View File

@ -1061,6 +1061,216 @@ static BOOL BitBlt_DSPDxox(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
return TRUE;
}
static BOOL BitBlt_PSDPxox(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette)
{
UINT32 x, y, colorC;
if (!hdcDest || !hdcSrc)
return FALSE;
switch (gdi_GetBrushStyle(hdcDest))
{
case GDI_BS_SOLID:
colorC = hdcDest->brush->color;
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth; x++)
{
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 color;
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
color = (colorA ^ colorC) | (colorB ^ colorC);
WriteColor(dstp, hdcDest->format, color);
}
}
}
break;
default:
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth; x++)
{
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
const BYTE* patp = gdi_get_brush_pointer(
hdcDest, nXDest + x, nYDest + y);
BYTE* dstp = gdi_get_bitmap_pointer(
hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 color;
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
UINT32 colorB = ReadColor(dstp, hdcDest->format);
UINT32 colorC = ReadColor(patp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
color = (colorA ^ colorC) | (colorB ^ colorC);
WriteColor(dstp, hdcDest->format, color);
}
}
}
break;
}
return TRUE;
}
static BOOL BitBlt_PSDPaox(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette)
{
UINT32 x, y, colorC;
if (!hdcDest || !hdcSrc)
return FALSE;
switch (gdi_GetBrushStyle(hdcDest))
{
case GDI_BS_SOLID:
colorC = hdcDest->brush->color;
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth; x++)
{
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 color;
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
color = (colorA & colorC) | (colorB ^ colorC);
WriteColor(dstp, hdcDest->format, color);
}
}
}
break;
default:
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth; x++)
{
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
const BYTE* patp = gdi_get_brush_pointer(
hdcDest, nXDest + x, nYDest + y);
BYTE* dstp = gdi_get_bitmap_pointer(
hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 color;
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
UINT32 colorB = ReadColor(dstp, hdcDest->format);
UINT32 colorC = ReadColor(patp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
color = (colorA & colorC) | (colorB ^ colorC);
WriteColor(dstp, hdcDest->format, color);
}
}
}
break;
}
return TRUE;
}
static BOOL BitBlt_PSDPxoxn(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette)
{
UINT32 x, y, colorC;
if (!hdcDest || !hdcSrc)
return FALSE;
switch (gdi_GetBrushStyle(hdcDest))
{
case GDI_BS_SOLID:
colorC = hdcDest->brush->color;
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth; x++)
{
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 color;
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
color = (colorA ^ colorC) | (colorB ^ ~colorC);
WriteColor(dstp, hdcDest->format, color);
}
}
}
break;
default:
for (y = 0; y < nHeight; y++)
{
for (x = 0; x < nWidth; x++)
{
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
const BYTE* patp = gdi_get_brush_pointer(
hdcDest, nXDest + x, nYDest + y);
BYTE* dstp = gdi_get_bitmap_pointer(
hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 color;
UINT32 colorA = ReadColor(srcp, hdcSrc->format);
UINT32 colorB = ReadColor(dstp, hdcDest->format);
UINT32 colorC = ReadColor(patp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
hdcDest->format, palette);
color = (colorA ^ colorC) | (colorB ^ ~colorC);
WriteColor(dstp, hdcDest->format, color);
}
}
}
break;
}
return TRUE;
}
static BOOL BitBlt_PSDPxax(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
UINT32 nXSrc, UINT32 nYSrc, const gdiPalette* palette)
@ -1771,6 +1981,18 @@ BOOL gdi_BitBlt(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
return BitBlt_DSPDxox(hdcDest, nXDest, nYDest, nWidth, nHeight,
hdcSrc, nXSrc, nYSrc, palette);
case GDI_PSDPxox:
return BitBlt_PSDPxox(hdcDest, nXDest, nYDest, nWidth, nHeight,
hdcSrc, nXSrc, nYSrc, palette);
case GDI_PSDPaox:
return BitBlt_PSDPaox(hdcDest, nXDest, nYDest, nWidth, nHeight,
hdcSrc, nXSrc, nYSrc, palette);
case GDI_PSDPxoxn:
return BitBlt_PSDPxoxn(hdcDest, nXDest, nYDest, nWidth, nHeight,
hdcSrc, nXSrc, nYSrc, palette);
case GDI_PSDPxax:
return BitBlt_PSDPxax(hdcDest, nXDest, nYDest, nWidth, nHeight,
hdcSrc, nXSrc, nYSrc, palette);

View File

@ -205,6 +205,18 @@ const char* gdi_rop_to_string(UINT32 code)
_snprintf(buffer, sizeof(buffer), "GDI_PDSona [%08X]", code);
break;
case GDI_PSDPaox:
_snprintf(buffer, sizeof(buffer), "GDI_PSDPaox [%08X]", code);
break;
case GDI_PSDPxox:
_snprintf(buffer, sizeof(buffer), "GDI_PSDPxox [%08X]", code);
break;
case GDI_PSDPxoxn:
_snprintf(buffer, sizeof(buffer), "GDI_PSDPxoxn [%08X]", code);
break;
case GDI_DSPDxox:
_snprintf(buffer, sizeof(buffer), "GDI_DSPDxox [%08X]", code);
break;