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 #endif
FREERDP_API DWORD gdi_rop3_code(BYTE code); 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 UINT32 gdi_get_pixel_format(UINT32 bitsPerPixel);
FREERDP_API BOOL gdi_decode_color(rdpGdi* gdi, const UINT32 srcColor, FREERDP_API BOOL gdi_decode_color(rdpGdi* gdi, const UINT32 srcColor,
UINT32* color, UINT32* format); UINT32* color, UINT32* format);

View File

@ -26,43 +26,43 @@
#include <freerdp/gdi/gdi.h> #include <freerdp/gdi/gdi.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
FREERDP_API HGDI_RGN gdi_CreateRectRgn(UINT32 nLeftRect, UINT32 nTopRect, 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, 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_RectToRgn(HGDI_RECT rect, HGDI_RGN rgn);
FREERDP_API void gdi_CRectToRgn(UINT32 left, UINT32 top, FREERDP_API void gdi_CRectToRgn(UINT32 left, UINT32 top,
UINT32 right, UINT32 bottom, HGDI_RGN rgn); UINT32 right, UINT32 bottom, HGDI_RGN rgn);
FREERDP_API void gdi_RectToCRgn(const HGDI_RECT rect, UINT32 *x, UINT32 *y, FREERDP_API void gdi_RectToCRgn(const HGDI_RECT rect, UINT32* x, UINT32* y,
UINT32 *w, UINT32 *h); UINT32* w, UINT32* h);
FREERDP_API void gdi_CRectToCRgn(UINT32 left, UINT32 top, FREERDP_API void gdi_CRectToCRgn(UINT32 left, UINT32 top,
UINT32 right, UINT32 bottom, UINT32 right, UINT32 bottom,
UINT32 *x, UINT32 *y, UINT32 *w, UINT32 *h); UINT32* x, UINT32* y, UINT32* w, UINT32* h);
FREERDP_API void gdi_RgnToRect(HGDI_RGN rgn, HGDI_RECT rect); 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_CRgnToRect(INT64 x, INT64 y, UINT32 w, UINT32 h, HGDI_RECT rect);
FREERDP_API void gdi_RgnToCRect(HGDI_RGN rgn, UINT32 *left, FREERDP_API void gdi_RgnToCRect(HGDI_RGN rgn, UINT32* left,
UINT32 *top, UINT32 *right, UINT32 *bottom); UINT32* top, UINT32* right, UINT32* bottom);
FREERDP_API void gdi_CRgnToCRect(UINT32 x, UINT32 y, UINT32 w, UINT32 h, 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, 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, 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, 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, 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_EqualRgn(HGDI_RGN hSrcRgn1, HGDI_RGN hSrcRgn2);
FREERDP_API BOOL gdi_CopyRect(HGDI_RECT dst, HGDI_RECT src); 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_PtInRect(HGDI_RECT rc, UINT32 x, UINT32 y);
FREERDP_API BOOL gdi_InvalidateRegion(HGDI_DC hdc, 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 #ifdef __cplusplus
} }
#endif #endif
#endif /* FREERDP_GDI_REGION_H */ #endif /* FREERDP_GDI_REGION_H */

View File

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

View File

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