Unified RDPGFX_RECT16 and RECTANGLE_16

This commit is contained in:
Armin Novak 2016-03-02 14:39:36 +01:00
parent 0c99d6a4fe
commit 3a3ec85898
9 changed files with 22 additions and 31 deletions

View File

@ -41,7 +41,7 @@
static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, RDPGFX_H264_METABLOCK* meta)
{
UINT32 index;
RDPGFX_RECT16* regionRect;
RECTANGLE_16* regionRect;
RDPGFX_H264_QUANT_QUALITY* quantQualityVal;
UINT error = ERROR_INVALID_DATA;
@ -62,7 +62,7 @@ static UINT rdpgfx_read_h264_metablock(RDPGFX_PLUGIN* gfx, wStream* s, RDPGFX_H2
goto error_out;
}
meta->regionRects = (RDPGFX_RECT16*) malloc(meta->numRegionRects * sizeof(RDPGFX_RECT16));
meta->regionRects = (RECTANGLE_16*) malloc(meta->numRegionRects * sizeof(RECTANGLE_16));
if (!meta->regionRects)
{

View File

@ -161,7 +161,7 @@ UINT rdpgfx_write_point16(wStream* s, RDPGFX_POINT16* point16)
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT rdpgfx_read_rect16(wStream* s, RDPGFX_RECT16* rect16)
UINT rdpgfx_read_rect16(wStream* s, RECTANGLE_16* rect16)
{
if (Stream_GetRemainingLength(s) < 8)
{
@ -182,7 +182,7 @@ UINT rdpgfx_read_rect16(wStream* s, RDPGFX_RECT16* rect16)
*
* @return 0 on success, otherwise a Win32 error code
*/
UINT rdpgfx_write_rect16(wStream* s, RDPGFX_RECT16* rect16)
UINT rdpgfx_write_rect16(wStream* s, RECTANGLE_16* rect16)
{
Stream_Write_UINT16(s, rect16->left); /* left (2 bytes) */
Stream_Write_UINT16(s, rect16->top); /* top (2 bytes) */

View File

@ -36,8 +36,8 @@ UINT rdpgfx_write_header(wStream* s, RDPGFX_HEADER* header);
UINT rdpgfx_read_point16(wStream* s, RDPGFX_POINT16* pt16);
UINT rdpgfx_write_point16(wStream* s, RDPGFX_POINT16* point16);
UINT rdpgfx_read_rect16(wStream* s, RDPGFX_RECT16* rect16);
UINT rdpgfx_write_rect16(wStream* s, RDPGFX_RECT16* rect16);
UINT rdpgfx_read_rect16(wStream* s, RECTANGLE_16* rect16);
UINT rdpgfx_write_rect16(wStream* s, RECTANGLE_16* rect16);
UINT rdpgfx_read_color32(wStream* s, RDPGFX_COLOR32* color32);
UINT rdpgfx_write_color32(wStream* s, RDPGFX_COLOR32* color32);

View File

@ -688,7 +688,7 @@ static UINT rdpgfx_recv_delete_encoding_context_pdu(RDPGFX_CHANNEL_CALLBACK* cal
UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
{
UINT16 index;
RDPGFX_RECT16* fillRect;
RECTANGLE_16* fillRect;
RDPGFX_SOLID_FILL_PDU pdu;
RDPGFX_PLUGIN* gfx = (RDPGFX_PLUGIN*) callback->plugin;
RdpgfxClientContext* context = (RdpgfxClientContext*) gfx->iface.pInterface;
@ -714,7 +714,7 @@ UINT rdpgfx_recv_solid_fill_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s)
return ERROR_INVALID_DATA;
}
pdu.fillRects = (RDPGFX_RECT16*) calloc(pdu.fillRectCount, sizeof(RDPGFX_RECT16));
pdu.fillRects = (RECTANGLE_16*) calloc(pdu.fillRectCount, sizeof(RECTANGLE_16));
if (!pdu.fillRects)
{

View File

@ -833,7 +833,7 @@ UINT xf_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFill
UINT32 color;
BYTE a, r, g, b;
int nWidth, nHeight;
RDPGFX_RECT16* rect;
RECTANGLE_16* rect;
xfGfxSurface* surface;
RECTANGLE_16 invalidRect;
xfContext* xfc = (xfContext*) context->custom;
@ -884,7 +884,7 @@ UINT xf_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFACE
UINT16 index;
BOOL sameSurface;
int nWidth, nHeight;
RDPGFX_RECT16* rectSrc;
RECTANGLE_16* rectSrc;
RDPGFX_POINT16* destPt;
RECTANGLE_16 invalidRect;
xfGfxSurface* surfaceSrc;
@ -947,7 +947,7 @@ UINT xf_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFACE
UINT xf_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache)
{
size_t size;
RDPGFX_RECT16* rect;
RECTANGLE_16* rect;
xfGfxSurface* surface;
xfGfxCacheEntry* cacheEntry;
xfContext* xfc = (xfContext*) context->custom;

View File

@ -37,15 +37,6 @@ struct _RDPGFX_POINT16
};
typedef struct _RDPGFX_POINT16 RDPGFX_POINT16;
struct _RDPGFX_RECT16
{
UINT16 left;
UINT16 top;
UINT16 right;
UINT16 bottom;
};
typedef struct _RDPGFX_RECT16 RDPGFX_RECT16;
struct _RDPGFX_COLOR32
{
BYTE B;
@ -145,7 +136,7 @@ struct _RDPGFX_WIRE_TO_SURFACE_PDU_1
UINT16 surfaceId;
UINT16 codecId;
RDPGFX_PIXELFORMAT pixelFormat;
RDPGFX_RECT16 destRect;
RECTANGLE_16 destRect;
UINT32 bitmapDataLength;
BYTE* bitmapData;
};
@ -195,7 +186,7 @@ struct _RDPGFX_SOLID_FILL_PDU
UINT16 surfaceId;
RDPGFX_COLOR32 fillPixel;
UINT16 fillRectCount;
RDPGFX_RECT16* fillRects;
RECTANGLE_16* fillRects;
};
typedef struct _RDPGFX_SOLID_FILL_PDU RDPGFX_SOLID_FILL_PDU;
@ -203,7 +194,7 @@ struct _RDPGFX_SURFACE_TO_SURFACE_PDU
{
UINT16 surfaceIdSrc;
UINT16 surfaceIdDest;
RDPGFX_RECT16 rectSrc;
RECTANGLE_16 rectSrc;
UINT16 destPtsCount;
RDPGFX_POINT16* destPts;
};
@ -214,7 +205,7 @@ struct _RDPGFX_SURFACE_TO_CACHE_PDU
UINT16 surfaceId;
UINT64 cacheKey;
UINT16 cacheSlot;
RDPGFX_RECT16 rectSrc;
RECTANGLE_16 rectSrc;
};
typedef struct _RDPGFX_SURFACE_TO_CACHE_PDU RDPGFX_SURFACE_TO_CACHE_PDU;
@ -349,7 +340,7 @@ typedef struct _RDPGFX_H264_QUANT_QUALITY RDPGFX_H264_QUANT_QUALITY;
struct _RDPGFX_H264_METABLOCK
{
UINT32 numRegionRects;
RDPGFX_RECT16* regionRects;
RECTANGLE_16* regionRects;
RDPGFX_H264_QUANT_QUALITY* quantQualityVals;
};
typedef struct _RDPGFX_H264_METABLOCK RDPGFX_H264_METABLOCK;

View File

@ -78,7 +78,7 @@ FREERDP_API int h264_compress(H264_CONTEXT* h264, BYTE* pSrcData, DWORD SrcForma
FREERDP_API int h264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize,
BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nDstWidth, int nDstHeight,
RDPGFX_RECT16* regionRects, int numRegionRect);
RECTANGLE_16* regionRects, int numRegionRect);
FREERDP_API BOOL h264_context_reset(H264_CONTEXT* h264, UINT32 width, UINT32 height);

View File

@ -1353,7 +1353,7 @@ static H264_CONTEXT_SUBSYSTEM g_Subsystem_libavcodec =
int h264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize,
BYTE** ppDstData, DWORD DstFormat, int nDstStep, int nDstWidth,
int nDstHeight, RDPGFX_RECT16* regionRects, int numRegionRects)
int nDstHeight, RECTANGLE_16* regionRects, int numRegionRects)
{
int index;
int status;
@ -1364,7 +1364,7 @@ int h264_decompress(H264_CONTEXT* h264, BYTE* pSrcData, UINT32 SrcSize,
BYTE** pYUVData;
int width, height;
BYTE* pYUVPoint[3];
RDPGFX_RECT16* rect;
RECTANGLE_16* rect;
primitives_t* prims = primitives_get();
if (!h264)

View File

@ -807,7 +807,7 @@ UINT gdi_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFil
UINT32 color;
BYTE a, r, g, b;
int nWidth, nHeight;
RDPGFX_RECT16* rect;
RECTANGLE_16* rect;
gdiGfxSurface* surface;
RECTANGLE_16 invalidRect;
rdpGdi* gdi = (rdpGdi*) context->custom;
@ -861,7 +861,7 @@ UINT gdi_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFAC
UINT16 index;
BOOL sameSurface;
int nWidth, nHeight;
RDPGFX_RECT16* rectSrc;
RECTANGLE_16* rectSrc;
RDPGFX_POINT16* destPt;
RECTANGLE_16 invalidRect;
gdiGfxSurface* surfaceSrc;
@ -922,7 +922,7 @@ UINT gdi_SurfaceToSurface(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_SURFAC
*/
UINT gdi_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU* surfaceToCache)
{
RDPGFX_RECT16* rect;
RECTANGLE_16* rect;
gdiGfxSurface* surface;
gdiGfxCacheEntry* cacheEntry;
rdpGdi* gdi = (rdpGdi*) context->custom;