Merge pull request #4329 from akallabeth/sw_gdi_fix

Sw gdi fix drawing problems
This commit is contained in:
David Fort 2017-12-28 19:53:15 +01:00 committed by GitHub
commit 4e421793bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 375 additions and 288 deletions

View File

@ -528,6 +528,9 @@ extern "C" {
#endif
FREERDP_API DWORD gdi_rop3_code(BYTE code);
FREERDP_API const char* gdi_rop3_code_string(BYTE code);
FREERDP_API const char* gdi_rop3_string(DWORD rop);
FREERDP_API UINT32 gdi_get_pixel_format(UINT32 bitsPerPixel);
FREERDP_API BOOL gdi_decode_color(rdpGdi* gdi, const UINT32 srcColor,
UINT32* color, UINT32* format);

View File

@ -26,43 +26,43 @@
#include <freerdp/gdi/gdi.h>
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
FREERDP_API HGDI_RGN gdi_CreateRectRgn(UINT32 nLeftRect, UINT32 nTopRect,
UINT32 nRightRect, UINT32 nBottomRect);
UINT32 nRightRect, UINT32 nBottomRect);
FREERDP_API HGDI_RECT gdi_CreateRect(UINT32 xLeft, UINT32 yTop,
UINT32 xRight, UINT32 yBottom);
UINT32 xRight, UINT32 yBottom);
FREERDP_API void gdi_RectToRgn(HGDI_RECT rect, HGDI_RGN rgn);
FREERDP_API void gdi_CRectToRgn(UINT32 left, UINT32 top,
UINT32 right, UINT32 bottom, HGDI_RGN rgn);
FREERDP_API void gdi_RectToCRgn(const HGDI_RECT rect, UINT32 *x, UINT32 *y,
UINT32 *w, UINT32 *h);
UINT32 right, UINT32 bottom, HGDI_RGN rgn);
FREERDP_API void gdi_RectToCRgn(const HGDI_RECT rect, UINT32* x, UINT32* y,
UINT32* w, UINT32* h);
FREERDP_API void gdi_CRectToCRgn(UINT32 left, UINT32 top,
UINT32 right, UINT32 bottom,
UINT32 *x, UINT32 *y, UINT32 *w, UINT32 *h);
UINT32 right, UINT32 bottom,
UINT32* x, UINT32* y, UINT32* w, UINT32* h);
FREERDP_API void gdi_RgnToRect(HGDI_RGN rgn, HGDI_RECT rect);
FREERDP_API void gdi_CRgnToRect(UINT32 x, UINT32 y, UINT32 w, UINT32 h, HGDI_RECT rect);
FREERDP_API void gdi_RgnToCRect(HGDI_RGN rgn, UINT32 *left,
UINT32 *top, UINT32 *right, UINT32 *bottom);
FREERDP_API void gdi_CRgnToRect(INT64 x, INT64 y, UINT32 w, UINT32 h, HGDI_RECT rect);
FREERDP_API void gdi_RgnToCRect(HGDI_RGN rgn, UINT32* left,
UINT32* top, UINT32* right, UINT32* bottom);
FREERDP_API void gdi_CRgnToCRect(UINT32 x, UINT32 y, UINT32 w, UINT32 h,
UINT32 *left, UINT32 *top, UINT32 *right, UINT32 *bottom);
UINT32* left, UINT32* top, UINT32* right, UINT32* bottom);
FREERDP_API BOOL gdi_CopyOverlap(UINT32 x, UINT32 y, UINT32 width, UINT32 height,
UINT32 srcx, UINT32 srcy);
UINT32 srcx, UINT32 srcy);
FREERDP_API BOOL gdi_SetRect(HGDI_RECT rc, UINT32 xLeft, UINT32 yTop,
UINT32 xRight, UINT32 yBottom);
UINT32 xRight, UINT32 yBottom);
FREERDP_API BOOL gdi_SetRgn(HGDI_RGN hRgn, UINT32 nXLeft, UINT32 nYLeft,
UINT32 nWidth, UINT32 nHeight);
UINT32 nWidth, UINT32 nHeight);
FREERDP_API BOOL gdi_SetRectRgn(HGDI_RGN hRgn, UINT32 nLeftRect, UINT32 nTopRect,
UINT32 nRightRect, UINT32 nBottomRect);
UINT32 nRightRect, UINT32 nBottomRect);
FREERDP_API BOOL gdi_EqualRgn(HGDI_RGN hSrcRgn1, HGDI_RGN hSrcRgn2);
FREERDP_API BOOL gdi_CopyRect(HGDI_RECT dst, HGDI_RECT src);
FREERDP_API BOOL gdi_PtInRect(HGDI_RECT rc, UINT32 x, UINT32 y);
FREERDP_API BOOL gdi_InvalidateRegion(HGDI_DC hdc, UINT32 x, UINT32 y,
UINT32 w, UINT32 h);
UINT32 w, UINT32 h);
#ifdef __cplusplus
}
}
#endif
#endif /* FREERDP_GDI_REGION_H */

View File

@ -31,6 +31,7 @@
#include <freerdp/log.h>
#include <freerdp/graphics.h>
#include <freerdp/codec/bitmap.h>
#include <freerdp/gdi/gdi.h>
#include "orders.h"
@ -2943,8 +2944,6 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
}
orderInfo->deltaCoordinates = (flags & ORDER_DELTA_COORDINATES) ? TRUE : FALSE;
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
switch (orderInfo->orderType)
{
@ -2955,6 +2954,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG,
"%s Primary Drawing Order (0x%08"PRIX32") rop=%s [0x%08"PRIx32"]",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType,
gdi_rop3_code_string(primary->dstblt.bRop), gdi_rop3_code(primary->dstblt.bRop));
IFCALL(primary->DstBlt, context, &primary->dstblt);
break;
@ -2965,6 +2968,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG,
"%s Primary Drawing Order (0x%08"PRIX32") rop=%s [0x%08"PRIx32"]",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType,
gdi_rop3_code_string(primary->patblt.bRop), gdi_rop3_code(primary->patblt.bRop));
IFCALL(primary->PatBlt, context, &primary->patblt);
break;
@ -2975,6 +2982,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG,
"%s Primary Drawing Order (0x%08"PRIX32") rop=%s [0x%08"PRIx32"]",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType,
gdi_rop3_code_string(primary->scrblt.bRop), gdi_rop3_code(primary->scrblt.bRop));
IFCALL(primary->ScrBlt, context, &primary->scrblt);
break;
@ -2986,6 +2997,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->OpaqueRect, context, &primary->opaque_rect);
break;
@ -2997,6 +3010,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->DrawNineGrid, context, &primary->draw_nine_grid);
break;
@ -3008,6 +3023,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG,
"%s Primary Drawing Order (0x%08"PRIX32") rop=%s [0x%08"PRIx32"]",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType,
gdi_rop3_code_string(primary->multi_dstblt.bRop), gdi_rop3_code(primary->multi_dstblt.bRop));
IFCALL(primary->MultiDstBlt, context, &primary->multi_dstblt);
break;
@ -3019,6 +3038,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG,
"%s Primary Drawing Order (0x%08"PRIX32") rop=%s [0x%08"PRIx32"]",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType,
gdi_rop3_code_string(primary->multi_patblt.bRop), gdi_rop3_code(primary->multi_patblt.bRop));
IFCALL(primary->MultiPatBlt, context, &primary->multi_patblt);
break;
@ -3030,6 +3053,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG,
"%s Primary Drawing Order (0x%08"PRIX32") rop=%s [0x%08"PRIx32"]",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType,
gdi_rop3_code_string(primary->multi_scrblt.bRop), gdi_rop3_code(primary->multi_scrblt.bRop));
IFCALL(primary->MultiScrBlt, context, &primary->multi_scrblt);
break;
@ -3042,6 +3069,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->MultiOpaqueRect, context, &primary->multi_opaque_rect);
break;
@ -3054,6 +3083,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->MultiDrawNineGrid, context, &primary->multi_draw_nine_grid);
break;
@ -3064,6 +3095,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->LineTo, context, &primary->line_to);
break;
@ -3074,6 +3107,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->Polyline, context, &primary->polyline);
break;
@ -3084,6 +3119,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG,
"%s Primary Drawing Order (0x%08"PRIX32") rop=%s [0x%08"PRIx32"]",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType,
gdi_rop3_code_string(primary->memblt.bRop), gdi_rop3_code(primary->memblt.bRop));
IFCALL(primary->MemBlt, context, &primary->memblt);
break;
@ -3094,6 +3133,10 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG,
"%s Primary Drawing Order (0x%08"PRIX32") rop=%s [0x%08"PRIx32"]",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType,
gdi_rop3_code_string(primary->mem3blt.bRop), gdi_rop3_code(primary->mem3blt.bRop));
IFCALL(primary->Mem3Blt, context, &primary->mem3blt);
break;
@ -3105,6 +3148,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->SaveBitmap, context, &primary->save_bitmap);
break;
@ -3116,6 +3161,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->GlyphIndex, context, &primary->glyph_index);
break;
@ -3126,6 +3173,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->FastIndex, context, &primary->fast_index);
break;
@ -3136,6 +3185,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->FastGlyph, context, &primary->fast_glyph);
break;
@ -3146,6 +3197,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->PolygonSC, context, &primary->polygon_sc);
break;
@ -3156,6 +3209,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->PolygonCB, context, &primary->polygon_cb);
break;
@ -3166,6 +3221,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->EllipseSC, context, &primary->ellipse_sc);
break;
@ -3176,6 +3233,8 @@ static BOOL update_recv_primary_order(rdpUpdate* update, wStream* s, BYTE flags)
return FALSE;
}
WLog_Print(update->log, WLOG_DEBUG, "%s Primary Drawing Order (0x%08"PRIX32")",
PRIMARY_DRAWING_ORDER_STRINGS[orderInfo->orderType], orderInfo->orderType);
IFCALL(primary->EllipseCB, context, &primary->ellipse_cb);
break;

View File

@ -48,264 +48,270 @@
#define TAG FREERDP_TAG("gdi")
/* Ternary Raster Operation Table */
static const DWORD rop3_code_table[] =
typedef struct
{
0x00000042, /* 0 */
0x00010289, /* DPSoon */
0x00020C89, /* DPSona */
0x000300AA, /* PSon */
0x00040C88, /* SDPona */
0x000500A9, /* DPon */
0x00060865, /* PDSxnon */
0x000702C5, /* PDSaon */
0x00080F08, /* SDPnaa */
0x00090245, /* PDSxon */
0x000A0329, /* DPna */
0x000B0B2A, /* PSDnaon */
0x000C0324, /* SPna */
0x000D0B25, /* PDSnaon */
0x000E08A5, /* PDSonon */
0x000F0001, /* Pn */
0x00100C85, /* PDSona */
0x001100A6, /* DSon */
0x00120868, /* SDPxnon */
0x001302C8, /* SDPaon */
0x00140869, /* DPSxnon */
0x001502C9, /* DPSaon */
0x00165CCA, /* PSDPSanaxx */
0x00171D54, /* SSPxDSxaxn */
0x00180D59, /* SPxPDxa */
0x00191CC8, /* SDPSanaxn */
0x001A06C5, /* PDSPaox */
0x001B0768, /* SDPSxaxn */
0x001C06CA, /* PSDPaox */
0x001D0766, /* DSPDxaxn */
0x001E01A5, /* PDSox */
0x001F0385, /* PDSoan */
0x00200F09, /* DPSnaa */
0x00210248, /* SDPxon */
0x00220326, /* DSna */
0x00230B24, /* SPDnaon */
0x00240D55, /* SPxDSxa */
0x00251CC5, /* PDSPanaxn */
0x002606C8, /* SDPSaox */
0x00271868, /* SDPSxnox */
0x00280369, /* DPSxa */
0x002916CA, /* PSDPSaoxxn */
0x002A0CC9, /* DPSana */
0x002B1D58, /* SSPxPDxaxn */
0x002C0784, /* SPDSoax */
0x002D060A, /* PSDnox */
0x002E064A, /* PSDPxox */
0x002F0E2A, /* PSDnoan */
0x0030032A, /* PSna */
0x00310B28, /* SDPnaon */
0x00320688, /* SDPSoox */
0x00330008, /* Sn */
0x003406C4, /* SPDSaox */
0x00351864, /* SPDSxnox */
0x003601A8, /* SDPox */
0x00370388, /* SDPoan */
0x0038078A, /* PSDPoax */
0x00390604, /* SPDnox */
0x003A0644, /* SPDSxox */
0x003B0E24, /* SPDnoan */
0x003C004A, /* PSx */
0x003D18A4, /* SPDSonox */
0x003E1B24, /* SPDSnaox */
0x003F00EA, /* PSan */
0x00400F0A, /* PSDnaa */
0x00410249, /* DPSxon */
0x00420D5D, /* SDxPDxa */
0x00431CC4, /* SPDSanaxn */
0x00440328, /* SDna */
0x00450B29, /* DPSnaon */
0x004606C6, /* DSPDaox */
0x0047076A, /* PSDPxaxn */
0x00480368, /* SDPxa */
0x004916C5, /* PDSPDaoxxn */
0x004A0789, /* DPSDoax */
0x004B0605, /* PDSnox */
0x004C0CC8, /* SDPana */
0x004D1954, /* SSPxDSxoxn */
0x004E0645, /* PDSPxox */
0x004F0E25, /* PDSnoan */
0x00500325, /* PDna */
0x00510B26, /* DSPnaon */
0x005206C9, /* DPSDaox */
0x00530764, /* SPDSxaxn */
0x005408A9, /* DPSonon */
0x00550009, /* Dn */
0x005601A9, /* DPSox */
0x00570389, /* DPSoan */
0x00580785, /* PDSPoax */
0x00590609, /* DPSnox */
0x005A0049, /* DPx */
0x005B18A9, /* DPSDonox */
0x005C0649, /* DPSDxox */
0x005D0E29, /* DPSnoan */
0x005E1B29, /* DPSDnaox */
0x005F00E9, /* DPan */
0x00600365, /* PDSxa */
0x006116C6, /* DSPDSaoxxn */
0x00620786, /* DSPDoax */
0x00630608, /* SDPnox */
0x00640788, /* SDPSoax */
0x00650606, /* DSPnox */
0x00660046, /* DSx */
0x006718A8, /* SDPSonox */
0x006858A6, /* DSPDSonoxxn */
0x00690145, /* PDSxxn */
0x006A01E9, /* DPSax */
0x006B178A, /* PSDPSoaxxn */
0x006C01E8, /* SDPax */
0x006D1785, /* PDSPDoaxxn */
0x006E1E28, /* SDPSnoax */
0x006F0C65, /* PDSxnan */
0x00700CC5, /* PDSana */
0x00711D5C, /* SSDxPDxaxn */
0x00720648, /* SDPSxox */
0x00730E28, /* SDPnoan */
0x00740646, /* DSPDxox */
0x00750E26, /* DSPnoan */
0x00761B28, /* SDPSnaox */
0x007700E6, /* DSan */
0x007801E5, /* PDSax */
0x00791786, /* DSPDSoaxxn */
0x007A1E29, /* DPSDnoax */
0x007B0C68, /* SDPxnan */
0x007C1E24, /* SPDSnoax */
0x007D0C69, /* DPSxnan */
0x007E0955, /* SPxDSxo */
0x007F03C9, /* DPSaan */
0x008003E9, /* DPSaa */
0x00810975, /* SPxDSxon */
0x00820C49, /* DPSxna */
0x00831E04, /* SPDSnoaxn */
0x00840C48, /* SDPxna */
0x00851E05, /* PDSPnoaxn */
0x008617A6, /* DSPDSoaxx */
0x008701C5, /* PDSaxn */
0x008800C6, /* DSa */
0x00891B08, /* SDPSnaoxn */
0x008A0E06, /* DSPnoa */
0x008B0666, /* DSPDxoxn */
0x008C0E08, /* SDPnoa */
0x008D0668, /* SDPSxoxn */
0x008E1D7C, /* SSDxPDxax */
0x008F0CE5, /* PDSanan */
0x00900C45, /* PDSxna */
0x00911E08, /* SDPSnoaxn */
0x009217A9, /* DPSDPoaxx */
0x009301C4, /* SPDaxn */
0x009417AA, /* PSDPSoaxx */
0x009501C9, /* DPSaxn */
0x00960169, /* DPSxx */
0x0097588A, /* PSDPSonoxx */
0x00981888, /* SDPSonoxn */
0x00990066, /* DSxn */
0x009A0709, /* DPSnax */
0x009B07A8, /* SDPSoaxn */
0x009C0704, /* SPDnax */
0x009D07A6, /* DSPDoaxn */
0x009E16E6, /* DSPDSaoxx */
0x009F0345, /* PDSxan */
0x00A000C9, /* DPa */
0x00A11B05, /* PDSPnaoxn */
0x00A20E09, /* DPSnoa */
0x00A30669, /* DPSDxoxn */
0x00A41885, /* PDSPonoxn */
0x00A50065, /* PDxn */
0x00A60706, /* DSPnax */
0x00A707A5, /* PDSPoaxn */
0x00A803A9, /* DPSoa */
0x00A90189, /* DPSoxn */
0x00AA0029, /* D */
0x00AB0889, /* DPSono */
0x00AC0744, /* SPDSxax */
0x00AD06E9, /* DPSDaoxn */
0x00AE0B06, /* DSPnao */
0x00AF0229, /* DPno */
0x00B00E05, /* PDSnoa */
0x00B10665, /* PDSPxoxn */
0x00B21974, /* SSPxDSxox */
0x00B30CE8, /* SDPanan */
0x00B4070A, /* PSDnax */
0x00B507A9, /* DPSDoaxn */
0x00B616E9, /* DPSDPaoxx */
0x00B70348, /* SDPxan */
0x00B8074A, /* PSDPxax */
0x00B906E6, /* DSPDaoxn */
0x00BA0B09, /* DPSnao */
0x00BB0226, /* DSno */
0x00BC1CE4, /* SPDSanax */
0x00BD0D7D, /* SDxPDxan */
0x00BE0269, /* DPSxo */
0x00BF08C9, /* DPSano */
0x00C000CA, /* PSa */
0x00C11B04, /* SPDSnaoxn */
0x00C21884, /* SPDSonoxn */
0x00C3006A, /* PSxn */
0x00C40E04, /* SPDnoa */
0x00C50664, /* SPDSxoxn */
0x00C60708, /* SDPnax */
0x00C707AA, /* PSDPoaxn */
0x00C803A8, /* SDPoa */
0x00C90184, /* SPDoxn */
0x00CA0749, /* DPSDxax */
0x00CB06E4, /* SPDSaoxn */
0x00CC0020, /* S */
0x00CD0888, /* SDPono */
0x00CE0B08, /* SDPnao */
0x00CF0224, /* SPno */
0x00D00E0A, /* PSDnoa */
0x00D1066A, /* PSDPxoxn */
0x00D20705, /* PDSnax */
0x00D307A4, /* SPDSoaxn */
0x00D41D78, /* SSPxPDxax */
0x00D50CE9, /* DPSanan */
0x00D616EA, /* PSDPSaoxx */
0x00D70349, /* DPSxan */
0x00D80745, /* PDSPxax */
0x00D906E8, /* SDPSaoxn */
0x00DA1CE9, /* DPSDanax */
0x00DB0D75, /* SPxDSxan */
0x00DC0B04, /* SPDnao */
0x00DD0228, /* SDno */
0x00DE0268, /* SDPxo */
0x00DF08C8, /* SDPano */
0x00E003A5, /* PDSoa */
0x00E10185, /* PDSoxn */
0x00E20746, /* DSPDxax */
0x00E306EA, /* PSDPaoxn */
0x00E40748, /* SDPSxax */
0x00E506E5, /* PDSPaoxn */
0x00E61CE8, /* SDPSanax */
0x00E70D79, /* SPxPDxan */
0x00E81D74, /* SSPxDSxax */
0x00E95CE6, /* DSPDSanaxxn */
0x00EA02E9, /* DPSao */
0x00EB0849, /* DPSxno */
0x00EC02E8, /* SDPao */
0x00ED0848, /* SDPxno */
0x00EE0086, /* DSo */
0x00EF0A08, /* SDPnoo */
0x00F00021, /* P */
0x00F10885, /* PDSono */
0x00F20B05, /* PDSnao */
0x00F3022A, /* PSno */
0x00F40B0A, /* PSDnao */
0x00F50225, /* PDno */
0x00F60265, /* PDSxo */
0x00F708C5, /* PDSano */
0x00F802E5, /* PDSao */
0x00F90845, /* PDSxno */
0x00FA0089, /* DPo */
0x00FB0A09, /* DPSnoo */
0x00FC008A, /* PSo */
0x00FD0A0A, /* PSDnoo */
0x00FE02A9, /* DPSoo */
0x00FF0062 /* 1 */
DWORD code;
const char* name;
} rop_table_entry;
static const rop_table_entry rop3_code_table[] =
{
{ GDI_BLACKNESS, "0" },
{ GDI_DPSoon, "DPSoon" },
{ GDI_DPSona, "DPSona" },
{ GDI_PSon, "PSon" },
{ GDI_SDPona, "SDPona" },
{ GDI_DPon, "DPon" },
{ GDI_PDSxnon, "PDSxnon" },
{ GDI_PDSaon, "PDSaon" },
{ GDI_SDPnaa, "SDPnaa" },
{ GDI_PDSxon, "PDSxon" },
{ GDI_DPna, "DPna" },
{ GDI_PSDnaon, "PSDnaon" },
{ GDI_SPna, "SPna" },
{ GDI_PDSnaon, "PDSnaon" },
{ GDI_PDSonon, "PDSonon" },
{ GDI_Pn , "Pn" },
{ GDI_PDSona, "PDSona" },
{ GDI_NOTSRCERASE, "DSon" },
{ GDI_SDPxnon, "SDPxnon" },
{ GDI_SDPaon, "SDPaon" },
{ GDI_DPSxnon, "DPSxnon" },
{ GDI_DPSaon, "DPSaon" },
{ GDI_PSDPSanaxx, "PSDPSanaxx" },
{ GDI_SSPxDSxaxn, "SSPxDSxaxn" },
{ GDI_SPxPDxa, "SPxPDxa" },
{ GDI_SDPSanaxn, "SDPSanaxn" },
{ GDI_PDSPaox, "PDSPaox" },
{ GDI_SDPSxaxn, "SDPSxaxn" },
{ GDI_PSDPaox, "PSDPaox" },
{ GDI_DSPDxaxn, "DSPDxaxn" },
{ GDI_PDSox, "PDSox" },
{ GDI_PDSoan, "PDSoan" },
{ GDI_DPSnaa, "DPSnaa" },
{ GDI_SDPxon, "SDPxon" },
{ GDI_DSna, "DSna" },
{ GDI_SPDnaon, "SPDnaon" },
{ GDI_SPxDSxa, "SPxDSxa" },
{ GDI_PDSPanaxn, "PDSPanaxn" },
{ GDI_SDPSaox, "SDPSaox" },
{ GDI_SDPSxnox, "SDPSxnox" },
{ GDI_DPSxa, "DPSxa" },
{ GDI_PSDPSaoxxn, "PSDPSaoxxn" },
{ GDI_DPSana, "DPSana" },
{ GDI_SSPxPDxaxn, "SSPxPDxaxn" },
{ GDI_SPDSoax, "SPDSoax" },
{ GDI_PSDnox, "PSDnox" },
{ GDI_PSDPxox, "PSDPxox" },
{ GDI_PSDnoan, "PSDnoan" },
{ GDI_PSna, "PSna" },
{ GDI_SDPnaon, "SDPnaon" },
{ GDI_SDPSoox, "SDPSoox" },
{ GDI_NOTSRCCOPY, "Sn" },
{ GDI_SPDSaox, "SPDSaox" },
{ GDI_SPDSxnox, "SPDSxnox" },
{ GDI_SDPox, "SDPox" },
{ GDI_SDPoan, "SDPoan" },
{ GDI_PSDPoax, "PSDPoax" },
{ GDI_SPDnox, "SPDnox" },
{ GDI_SPDSxox, "SPDSxox" },
{ GDI_SPDnoan, "SPDnoan" },
{ GDI_PSx , "PSx" },
{ GDI_SPDSonox, "SPDSonox" },
{ GDI_SPDSnaox, "SPDSnaox" },
{ GDI_PSan, "PSan" },
{ GDI_PSDnaa, "PSDnaa" },
{ GDI_DPSxon, "DPSxon" },
{ GDI_SDxPDxa, "SDxPDxa" },
{ GDI_SPDSanaxn, "SPDSanaxn" },
{ GDI_SRCERASE, "SDna" },
{ GDI_DPSnaon, "DPSnaon" },
{ GDI_DSPDaox, "DSPDaox" },
{ GDI_PSDPxaxn, "PSDPxaxn" },
{ GDI_SDPxa, "SDPxa" },
{ GDI_PDSPDaoxxn, "PDSPDaoxxn" },
{ GDI_DPSDoax, "DPSDoax" },
{ GDI_PDSnox, "PDSnox" },
{ GDI_SDPana, "SDPana" },
{ GDI_SSPxDSxoxn, "SSPxDSxoxn" },
{ GDI_PDSPxox, "PDSPxox" },
{ GDI_PDSnoan, "PDSnoan" },
{ GDI_PDna, "PDna" },
{ GDI_DSPnaon, "DSPnaon" },
{ GDI_DPSDaox, "DPSDaox" },
{ GDI_SPDSxaxn, "SPDSxaxn" },
{ GDI_DPSonon, "DPSonon" },
{ GDI_DSTINVERT, "Dn" },
{ GDI_DPSox, "DPSox" },
{ GDI_DPSoan, "DPSoan" },
{ GDI_PDSPoax, "PDSPoax" },
{ GDI_DPSnox, "DPSnox" },
{ GDI_PATINVERT, "DPx" },
{ GDI_DPSDonox, "DPSDonox" },
{ GDI_DPSDxox, "DPSDxox" },
{ GDI_DPSnoan, "DPSnoan" },
{ GDI_DPSDnaox, "DPSDnaox" },
{ GDI_DPan, "DPan" },
{ GDI_PDSxa, "PDSxa" },
{ GDI_DSPDSaoxxn, "DSPDSaoxxn" },
{ GDI_DSPDoax, "DSPDoax" },
{ GDI_SDPnox, "SDPnox" },
{ GDI_SDPSoax, "SDPSoax" },
{ GDI_DSPnox, "DSPnox" },
{ GDI_SRCINVERT, "DSx" },
{ GDI_SDPSonox, "SDPSonox" },
{ GDI_DSPDSonoxxn, "DSPDSonoxxn" },
{ GDI_PDSxxn, "PDSxxn" },
{ GDI_DPSax, "DPSax" },
{ GDI_PSDPSoaxxn, "PSDPSoaxxn" },
{ GDI_SDPax, "SDPax" },
{ GDI_PDSPDoaxxn, "PDSPDoaxxn" },
{ GDI_SDPSnoax, "SDPSnoax" },
{ GDI_PDSxnan, "PDSxnan" },
{ GDI_PDSana, "PDSana" },
{ GDI_SSDxPDxaxn, "SSDxPDxaxn" },
{ GDI_SDPSxox, "SDPSxox" },
{ GDI_SDPnoan, "SDPnoan" },
{ GDI_DSPDxox, "DSPDxox" },
{ GDI_DSPnoan, "DSPnoan" },
{ GDI_SDPSnaox, "SDPSnaox" },
{ GDI_DSan, "DSan" },
{ GDI_PDSax, "PDSax" },
{ GDI_DSPDSoaxxn, "DSPDSoaxxn" },
{ GDI_DPSDnoax, "DPSDnoax" },
{ GDI_SDPxnan, "SDPxnan" },
{ GDI_SPDSnoax, "SPDSnoax" },
{ GDI_DPSxnan, "DPSxnan" },
{ GDI_SPxDSxo, "SPxDSxo" },
{ GDI_DPSaan, "DPSaan" },
{ GDI_DPSaa, "DPSaa" },
{ GDI_SPxDSxon, "SPxDSxon" },
{ GDI_DPSxna, "DPSxna" },
{ GDI_SPDSnoaxn, "SPDSnoaxn" },
{ GDI_SDPxna, "SDPxna" },
{ GDI_PDSPnoaxn, "PDSPnoaxn" },
{ GDI_DSPDSoaxx, "DSPDSoaxx" },
{ GDI_PDSaxn, "PDSaxn" },
{ GDI_SRCAND, "DSa" },
{ GDI_SDPSnaoxn, "SDPSnaoxn" },
{ GDI_DSPnoa, "DSPnoa" },
{ GDI_DSPDxoxn, "DSPDxoxn" },
{ GDI_SDPnoa, "SDPnoa" },
{ GDI_SDPSxoxn, "SDPSxoxn" },
{ GDI_SSDxPDxax, "SSDxPDxax" },
{ GDI_PDSanan, "PDSanan" },
{ GDI_PDSxna, "PDSxna" },
{ GDI_SDPSnoaxn, "SDPSnoaxn" },
{ GDI_DPSDPoaxx, "DPSDPoaxx" },
{ GDI_SPDaxn, "SPDaxn" },
{ GDI_PSDPSoaxx, "PSDPSoaxx" },
{ GDI_DPSaxn, "DPSaxn" },
{ GDI_DPSxx, "DPSxx" },
{ GDI_PSDPSonoxx, "PSDPSonoxx" },
{ GDI_SDPSonoxn, "SDPSonoxn" },
{ GDI_DSxn, "DSxn" },
{ GDI_DPSnax, "DPSnax" },
{ GDI_SDPSoaxn, "SDPSoaxn" },
{ GDI_SPDnax, "SPDnax" },
{ GDI_DSPDoaxn, "DSPDoaxn" },
{ GDI_DSPDSaoxx, "DSPDSaoxx" },
{ GDI_PDSxan, "PDSxan" },
{ GDI_DPa , "DPa" },
{ GDI_PDSPnaoxn, "PDSPnaoxn" },
{ GDI_DPSnoa, "DPSnoa" },
{ GDI_DPSDxoxn, "DPSDxoxn" },
{ GDI_PDSPonoxn, "PDSPonoxn" },
{ GDI_PDxn, "PDxn" },
{ GDI_DSPnax, "DSPnax" },
{ GDI_PDSPoaxn, "PDSPoaxn" },
{ GDI_DPSoa, "DPSoa" },
{ GDI_DPSoxn, "DPSoxn" },
{ GDI_DSTCOPY, "D" },
{ GDI_DPSono, "DPSono" },
{ GDI_SPDSxax, "SPDSxax" },
{ GDI_DPSDaoxn, "DPSDaoxn" },
{ GDI_DSPnao, "DSPnao" },
{ GDI_DPno, "DPno" },
{ GDI_PDSnoa, "PDSnoa" },
{ GDI_PDSPxoxn, "PDSPxoxn" },
{ GDI_SSPxDSxox, "SSPxDSxox" },
{ GDI_SDPanan, "SDPanan" },
{ GDI_PSDnax, "PSDnax" },
{ GDI_DPSDoaxn, "DPSDoaxn" },
{ GDI_DPSDPaoxx, "DPSDPaoxx" },
{ GDI_SDPxan, "SDPxan" },
{ GDI_PSDPxax, "PSDPxax" },
{ GDI_DSPDaoxn, "DSPDaoxn" },
{ GDI_DPSnao, "DPSnao" },
{ GDI_MERGEPAINT, "DSno" },
{ GDI_SPDSanax, "SPDSanax" },
{ GDI_SDxPDxan, "SDxPDxan" },
{ GDI_DPSxo, "DPSxo" },
{ GDI_DPSano, "DPSano" },
{ GDI_MERGECOPY, "PSa" },
{ GDI_SPDSnaoxn, "SPDSnaoxn" },
{ GDI_SPDSonoxn, "SPDSonoxn" },
{ GDI_PSxn, "PSxn" },
{ GDI_SPDnoa, "SPDnoa" },
{ GDI_SPDSxoxn, "SPDSxoxn" },
{ GDI_SDPnax, "SDPnax" },
{ GDI_PSDPoaxn, "PSDPoaxn" },
{ GDI_SDPoa, "SDPoa" },
{ GDI_SPDoxn, "SPDoxn" },
{ GDI_DPSDxax, "DPSDxax" },
{ GDI_SPDSaoxn, "SPDSaoxn" },
{ GDI_SRCCOPY, "S" },
{ GDI_SDPono, "SDPono" },
{ GDI_SDPnao, "SDPnao" },
{ GDI_SPno, "SPno" },
{ GDI_PSDnoa, "PSDnoa" },
{ GDI_PSDPxoxn, "PSDPxoxn" },
{ GDI_PDSnax, "PDSnax" },
{ GDI_SPDSoaxn, "SPDSoaxn" },
{ GDI_SSPxPDxax, "SSPxPDxax" },
{ GDI_DPSanan, "DPSanan" },
{ GDI_PSDPSaoxx, "PSDPSaoxx" },
{ GDI_DPSxan, "DPSxan" },
{ GDI_PDSPxax, "PDSPxax" },
{ GDI_SDPSaoxn, "SDPSaoxn" },
{ GDI_DPSDanax, "DPSDanax" },
{ GDI_SPxDSxan, "SPxDSxan" },
{ GDI_SPDnao, "SPDnao" },
{ GDI_SDno, "SDno" },
{ GDI_SDPxo, "SDPxo" },
{ GDI_SDPano, "SDPano" },
{ GDI_PDSoa, "PDSoa" },
{ GDI_PDSoxn, "PDSoxn" },
{ GDI_DSPDxax, "DSPDxax" },
{ GDI_PSDPaoxn, "PSDPaoxn" },
{ GDI_SDPSxax, "SDPSxax" },
{ GDI_PDSPaoxn, "PDSPaoxn" },
{ GDI_SDPSanax, "SDPSanax" },
{ GDI_SPxPDxan, "SPxPDxan" },
{ GDI_SSPxDSxax, "SSPxDSxax" },
{ GDI_DSPDSanaxxn, "DSPDSanaxxn" },
{ GDI_DPSao, "DPSao" },
{ GDI_DPSxno, "DPSxno" },
{ GDI_SDPao, "SDPao" },
{ GDI_SDPxno, "SDPxno" },
{ GDI_SRCPAINT, "DSo" },
{ GDI_SDPnoo, "SDPnoo" },
{ GDI_PATCOPY, "P" },
{ GDI_PDSono, "PDSono" },
{ GDI_PDSnao, "PDSnao" },
{ GDI_PSno, "PSno" },
{ GDI_PSDnao, "PSDnao" },
{ GDI_PDno, "PDno" },
{ GDI_PDSxo, "PDSxo" },
{ GDI_PDSano, "PDSano" },
{ GDI_PDSao, "PDSao" },
{ GDI_PDSxno, "PDSxno" },
{ GDI_DPo , "DPo" },
{ GDI_PATPAINT, "DPSnoo" },
{ GDI_PSo , "PSo" },
{ GDI_PSDnoo, "PSDnoo" },
{ GDI_DPSoo, "DPSoo" },
{ GDI_WHITENESS, "1" }
};
/* Hatch Patterns as monochrome data */
@ -361,9 +367,28 @@ INLINE BOOL gdi_decode_color(rdpGdi* gdi, const UINT32 srcColor,
}
/* GDI Helper Functions */
INLINE DWORD gdi_rop3_code(BYTE code)
DWORD gdi_rop3_code(BYTE code)
{
return rop3_code_table[code];
return rop3_code_table[code].code;
}
const char* gdi_rop3_code_string(BYTE code)
{
return rop3_code_table[code].name;
}
const char* gdi_rop3_string(DWORD rop)
{
const size_t count = sizeof(rop3_code_table) / sizeof(rop3_code_table[0]);
size_t x;
for (x = 0; x < count; x++)
{
if (rop3_code_table[x].code == rop)
return rop3_code_table[x].name;
}
return "UNKNOWN";
}
UINT32 gdi_get_pixel_format(UINT32 bitsPerPixel)
@ -1153,7 +1178,6 @@ static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, UINT32 format,
goto fail_bitmap;
gdi->stride = gdi->primary->bitmap->scanline;
gdi_SelectObject(gdi->primary->hdc, (HGDIOBJECT) gdi->primary->bitmap);
gdi->primary->org_bitmap = NULL;
gdi->primary_buffer = gdi->primary->bitmap->data;

View File

@ -184,20 +184,21 @@ INLINE void gdi_RgnToRect(HGDI_RGN rgn, HGDI_RECT rect)
* @param rect destination rectangle
*/
INLINE void gdi_CRgnToRect(UINT32 x, UINT32 y, UINT32 w, UINT32 h,
INLINE void gdi_CRgnToRect(INT64 x, INT64 y, UINT32 w, UINT32 h,
HGDI_RECT rect)
{
memset(rect, 0, sizeof(GDI_RECT));
rect->left = x;
rect->top = y;
const INT64 r = x + w - 1;
const INT64 b = y + h - 1;
rect->left = (x > 0) ? x : 0;
rect->top = (y > 0) ? y : 0;
if (w > 0)
rect->right = x + w - 1;
if (r > 0)
rect->right = r;
else
WLog_ERR(TAG, "Invalid width");
if (h > 0)
rect->bottom = y + h - 1;
if (b > 0)
rect->bottom = b;
else
WLog_ERR(TAG, "Invalid height");
}