return format;
}
-INLINE BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, int x, int y)
+BYTE* gdi_get_bitmap_pointer(HGDI_DC hdcBmp, UINT32 x, UINT32 y)
{
BYTE* p;
HGDI_BITMAP hBmp = (HGDI_BITMAP) hdcBmp->selectedObject;
else
{
WLog_ERR(TAG,
- "gdi_get_bitmap_pointer: requesting invalid pointer: (%d,%d) in %dx%d",
- x, y, hBmp->width, hBmp->height);
+ "gdi_get_bitmap_pointer: requesting invalid pointer: (%d,%d) in %dx%d",
+ x, y, hBmp->width, hBmp->height);
return 0;
}
}
* @param y dest y-coordinate
* @return color
*/
-INLINE BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, int x, int y)
+BYTE* gdi_get_brush_pointer(HGDI_DC hdcBrush, UINT32 x, UINT32 y)
{
BYTE* p;
y = (y + hBmpBrush->height - (hdcBrush->brush->nYOrg % hBmpBrush->height)) %
hBmpBrush->height;
p = hBmpBrush->data + (y * hBmpBrush->scanline) + (x * GetBytesPerPixel(
- hBmpBrush->format));
+ hBmpBrush->format));
return p;
}
}
}
gdiBitmap* gdi_bitmap_new_ex(rdpGdi* gdi, int width, int height, int bpp,
- BYTE* data)
+ BYTE* data)
{
gdiBitmap* bitmap;
bitmap = (gdiBitmap*) calloc(1, sizeof(gdiBitmap));
}
static BOOL gdi_bitmap_update(rdpContext* context,
- const BITMAP_UPDATE* bitmapUpdate)
+ const BITMAP_UPDATE* bitmapUpdate)
{
int status;
UINT32 index;
if (bitsPerPixel < 32)
{
status = interleaved_decompress(codecs->interleaved,
- pSrcData, SrcSize,
- bitsPerPixel,
- gdi->primary_buffer,
- gdi->dstFormat,
- gdi->stride, nXDst, nYDst,
- nWidth, nHeight,
- &gdi->palette);
+ pSrcData, SrcSize,
+ bitsPerPixel,
+ gdi->primary_buffer,
+ gdi->dstFormat,
+ gdi->stride, nXDst, nYDst,
+ nWidth, nHeight,
+ &gdi->palette);
}
else
{
status = planar_decompress(codecs->planar, pSrcData,
- SrcSize, gdi->primary_buffer,
- gdi->dstFormat,
- gdi->stride,
- nXDst, nYDst, nWidth, nHeight, TRUE);
+ SrcSize, gdi->primary_buffer,
+ gdi->dstFormat,
+ gdi->stride,
+ nXDst, nYDst, nWidth, nHeight, TRUE);
}
if (status < 0)
UINT32 SrcFormat = gdi_get_pixel_format(bitsPerPixel, TRUE);
UINT32 nSrcStep = nWidth * GetBytesPerPixel(SrcFormat);
nWidth = MIN(bitmap->destRight,
- gdi->width - 1) - bitmap->destLeft + 1; /* clip width */
+ gdi->width - 1) - bitmap->destLeft + 1; /* clip width */
nHeight = MIN(bitmap->destBottom,
- gdi->height - 1) - bitmap->destTop + 1; /* clip height */
+ gdi->height - 1) - bitmap->destTop + 1; /* clip height */
if (!freerdp_image_copy(gdi->primary_buffer, gdi->dstFormat, gdi->stride,
- nXDst, nYDst, nWidth, nHeight,
- pSrcData, SrcFormat, nSrcStep,
- nXSrc, nYSrc, &gdi->palette))
+ nXDst, nYDst, nWidth, nHeight,
+ pSrcData, SrcFormat, nSrcStep,
+ nXSrc, nYSrc, &gdi->palette))
return FALSE;
}
if (!gdi_InvalidateRegion(gdi->primary->hdc, nXDst, nYDst,
- nWidth, nHeight))
+ nWidth, nHeight))
return FALSE;
}
}
static BOOL gdi_palette_update(rdpContext* context,
- const PALETTE_UPDATE* palette)
+ const PALETTE_UPDATE* palette)
{
int index;
const PALETTE_ENTRY* pe;
if (bounds)
{
gdi_SetClipRgn(gdi->drawing->hdc, bounds->left, bounds->top,
- bounds->right - bounds->left + 1, bounds->bottom - bounds->top + 1);
+ bounds->right - bounds->left + 1, bounds->bottom - bounds->top + 1);
}
else
{
{
rdpGdi* gdi = context->gdi;
return gdi_BitBlt(gdi->drawing->hdc, dstblt->nLeftRect, dstblt->nTopRect,
- dstblt->nWidth, dstblt->nHeight, NULL, 0, 0,
- gdi_rop3_code(dstblt->bRop), &gdi->palette);
+ dstblt->nWidth, dstblt->nHeight, NULL, 0, 0,
+ gdi_rop3_code(dstblt->bRop), &gdi->palette);
}
static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
BOOL ret = TRUE;
UINT32 SrcFormat = gdi_get_pixel_format(patblt->brush.bpp, FALSE);
foreColor = ConvertColor(patblt->foreColor, SrcFormat,
- gdi->dstFormat, &gdi->palette);
+ gdi->dstFormat, &gdi->palette);
backColor = ConvertColor(patblt->backColor, SrcFormat,
- gdi->dstFormat, &gdi->palette);
+ gdi->dstFormat, &gdi->palette);
originalColor = gdi_SetTextColor(gdi->drawing->hdc, foreColor);
if (brush->style == GDI_BS_SOLID)
}
if (!gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
- patblt->nWidth, patblt->nHeight, rop,
- gdi->primary->hdc, nXSrc, nYSrc))
+ patblt->nWidth, patblt->nHeight, rop,
+ gdi->primary->hdc, nXSrc, nYSrc))
{
ret = FALSE;
}
hatched = GDI_BS_HATCHED_PATTERNS + (8 * brush->hatch);
freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
- hatched, backColor, foreColor, &gdi->palette);
+ hatched, backColor, foreColor, &gdi->palette);
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
if (!hBmp)
gdi->drawing->hdc->brush->nYOrg = brush->y;
if (!gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
- patblt->nWidth, patblt->nHeight, rop,
- gdi->primary->hdc, nXSrc, nYSrc))
+ patblt->nWidth, patblt->nHeight, rop,
+ gdi->primary->hdc, nXSrc, nYSrc))
{
ret = FALSE;
}
}
if (!freerdp_image_copy(data, gdi->dstFormat, 0, 0, 0,
- 8, 8, brush->data, brushFormat, 0, 0, 0,
- &gdi->palette))
+ 8, 8, brush->data, brushFormat, 0, 0, 0,
+ &gdi->palette))
{
ret = FALSE;
goto out_error;
}
freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
- brush->data, backColor, foreColor, &gdi->palette);
+ brush->data, backColor, foreColor, &gdi->palette);
}
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
gdi->drawing->hdc->brush->nYOrg = brush->y;
if (!gdi_PatBlt(gdi->drawing->hdc, patblt->nLeftRect, patblt->nTopRect,
- patblt->nWidth, patblt->nHeight, rop,
- gdi->primary->hdc, nXSrc, nYSrc))
+ patblt->nWidth, patblt->nHeight, rop,
+ gdi->primary->hdc, nXSrc, nYSrc))
{
ret = FALSE;
}
{
rdpGdi* gdi = context->gdi;
return gdi_BitBlt(gdi->drawing->hdc, scrblt->nLeftRect, scrblt->nTopRect,
- scrblt->nWidth, scrblt->nHeight, gdi->primary->hdc,
- scrblt->nXSrc, scrblt->nYSrc, gdi_rop3_code(scrblt->bRop),
- &gdi->palette);
+ scrblt->nWidth, scrblt->nHeight, gdi->primary->hdc,
+ scrblt->nXSrc, scrblt->nYSrc, gdi_rop3_code(scrblt->bRop),
+ &gdi->palette);
}
static BOOL gdi_opaque_rect(rdpContext* context,
- const OPAQUE_RECT_ORDER* opaque_rect)
+ const OPAQUE_RECT_ORDER* opaque_rect)
{
GDI_RECT rect;
HGDI_BRUSH hBrush;
BOOL ret;
UINT32 SrcFormat = gdi_get_pixel_format(context->settings->ColorDepth, FALSE);
gdi_CRgnToRect(opaque_rect->nLeftRect, opaque_rect->nTopRect,
- opaque_rect->nWidth, opaque_rect->nHeight, &rect);
+ opaque_rect->nWidth, opaque_rect->nHeight, &rect);
brush_color = ConvertColor(opaque_rect->color, SrcFormat,
- gdi->dstFormat, &gdi->palette);
+ gdi->dstFormat, &gdi->palette);
if (!(hBrush = gdi_CreateSolidBrush(brush_color)))
return FALSE;
}
static BOOL gdi_multi_opaque_rect(rdpContext* context,
- const MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect)
+ const MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect)
{
UINT32 i;
GDI_RECT rect;
{
rectangle = &multi_opaque_rect->rectangles[i];
gdi_CRgnToRect(rectangle->left, rectangle->top,
- rectangle->width, rectangle->height, &rect);
+ rectangle->width, rectangle->height, &rect);
brush_color = ConvertColor(multi_opaque_rect->color, SrcFormat,
- gdi->dstFormat, &gdi->palette);
+ gdi->dstFormat, &gdi->palette);
hBrush = gdi_CreateSolidBrush(brush_color);
if (!hBrush)
UINT32 SrcFormat = gdi_get_pixel_format(context->settings->ColorDepth, FALSE);
if (!(hPen = gdi_CreatePen(lineTo->penStyle, lineTo->penWidth, color,
- SrcFormat, &gdi->palette)))
+ SrcFormat, &gdi->palette)))
return FALSE;
gdi_SelectObject(gdi->drawing->hdc, (HGDIOBJECT) hPen);
rdpGdi* gdi = context->gdi;
bitmap = (gdiBitmap*) memblt->bitmap;
return gdi_BitBlt(gdi->drawing->hdc, memblt->nLeftRect, memblt->nTopRect,
- memblt->nWidth, memblt->nHeight, bitmap->hdc,
- memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop),
- &gdi->palette);
+ memblt->nWidth, memblt->nHeight, bitmap->hdc,
+ memblt->nXSrc, memblt->nYSrc, gdi_rop3_code(memblt->bRop),
+ &gdi->palette);
}
static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
brush = &mem3blt->brush;
bitmap = (gdiBitmap*) mem3blt->bitmap;
foreColor = ConvertColor(mem3blt->foreColor, SrcFormat,
- gdi->dstFormat, &gdi->palette);
+ gdi->dstFormat, &gdi->palette);
backColor = ConvertColor(mem3blt->backColor, SrcFormat,
- gdi->dstFormat, &gdi->palette);
+ gdi->dstFormat, &gdi->palette);
originalColor = gdi_SetTextColor(gdi->drawing->hdc, foreColor);
if (brush->style == GDI_BS_SOLID)
}
gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect,
- mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
- mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
- &gdi->palette);
+ mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
+ mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
+ &gdi->palette);
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
gdi->drawing->hdc->brush = originalBrush;
}
}
if (!freerdp_image_copy(data, gdi->dstFormat, 0, 0, 0,
- 8, 8, brush->data, brushFormat, 0, 0, 0, &gdi->palette))
+ 8, 8, brush->data, brushFormat, 0, 0, 0, &gdi->palette))
{
ret = FALSE;
goto out_fail;
}
freerdp_image_copy_from_monochrome(data, gdi->dstFormat, 0, 0, 0, 8, 8,
- brush->data, backColor, foreColor, &gdi->palette);
+ brush->data, backColor, foreColor, &gdi->palette);
}
hBmp = gdi_CreateBitmap(8, 8, gdi->drawing->hdc->format, data);
gdi->drawing->hdc->brush->nXOrg = brush->x;
gdi->drawing->hdc->brush->nYOrg = brush->y;
gdi_BitBlt(gdi->drawing->hdc, mem3blt->nLeftRect, mem3blt->nTopRect,
- mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
- mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
- &gdi->palette);
+ mem3blt->nWidth, mem3blt->nHeight, bitmap->hdc,
+ mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
+ &gdi->palette);
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
gdi->drawing->hdc->brush = originalBrush;
}
}
static BOOL gdi_polygon_sc(rdpContext* context,
- const POLYGON_SC_ORDER* polygon_sc)
+ const POLYGON_SC_ORDER* polygon_sc)
{
WLog_VRB(TAG, "%s: not implemented", __FUNCTION__);
return TRUE;
}
static BOOL gdi_ellipse_sc(rdpContext* context,
- const ELLIPSE_SC_ORDER* ellipse_sc)
+ const ELLIPSE_SC_ORDER* ellipse_sc)
{
WLog_VRB(TAG, "%s: not implemented", __FUNCTION__);
return TRUE;
}
static BOOL gdi_ellipse_cb(rdpContext* context,
- const ELLIPSE_CB_ORDER* ellipse_cb)
+ const ELLIPSE_CB_ORDER* ellipse_cb)
{
WLog_VRB(TAG, "%s: not implemented", __FUNCTION__);
return TRUE;
}
static BOOL gdi_frame_marker(rdpContext* context,
- const FRAME_MARKER_ORDER* frameMarker)
+ const FRAME_MARKER_ORDER* frameMarker)
{
return TRUE;
}
BOOL gdi_surface_frame_marker(rdpContext* context,
- const SURFACE_FRAME_MARKER* surfaceFrameMarker)
+ const SURFACE_FRAME_MARKER* surfaceFrameMarker)
{
DEBUG_GDI("frameId %d frameAction %d",
- surfaceFrameMarker->frameId,
- surfaceFrameMarker->frameAction);
+ surfaceFrameMarker->frameId,
+ surfaceFrameMarker->frameAction);
switch (surfaceFrameMarker->frameAction)
{
}
static BOOL gdi_surface_bits(rdpContext* context,
- const SURFACE_BITS_COMMAND* cmd)
+ const SURFACE_BITS_COMMAND* cmd)
{
rdpGdi* gdi = context->gdi;
DEBUG_GDI("destLeft %d destTop %d destRight %d destBottom %d "
- "bpp %d codecID %d width %d height %d length %d",
- cmd->destLeft, cmd->destTop, cmd->destRight, cmd->destBottom,
- cmd->bpp, cmd->codecID, cmd->width, cmd->height, cmd->bitmapDataLength);
+ "bpp %d codecID %d width %d height %d length %d",
+ cmd->destLeft, cmd->destTop, cmd->destRight, cmd->destBottom,
+ cmd->bpp, cmd->codecID, cmd->width, cmd->height, cmd->bitmapDataLength);
switch (cmd->codecID)
{
case RDP_CODEC_ID_REMOTEFX:
{
if (!rfx_process_message(gdi->codecs->rfx, cmd->bitmapData,
- PIXEL_FORMAT_BGRX32,
- cmd->bitmapDataLength,
- 0, 0,
- gdi->bitmap_buffer, gdi->dstFormat,
- cmd->width * GetBytesPerPixel(gdi->dstFormat),
- cmd->height, NULL))
+ PIXEL_FORMAT_BGRX32,
+ cmd->bitmapDataLength,
+ 0, 0,
+ gdi->bitmap_buffer, gdi->dstFormat,
+ cmd->width * GetBytesPerPixel(gdi->dstFormat),
+ cmd->height, NULL))
{
WLog_ERR(TAG, "Failed to process RemoteFX message");
return FALSE;
case RDP_CODEC_ID_NSCODEC:
{
if (!nsc_process_message(gdi->codecs->nsc, cmd->bpp, cmd->width,
- cmd->height, cmd->bitmapData,
- cmd->bitmapDataLength, gdi->primary_buffer,
- gdi->dstFormat, gdi->stride, cmd->destLeft, cmd->destTop,
- cmd->width, cmd->height))
+ cmd->height, cmd->bitmapData,
+ cmd->bitmapDataLength, gdi->primary_buffer,
+ gdi->dstFormat, gdi->stride, cmd->destLeft, cmd->destTop,
+ cmd->width, cmd->height))
return FALSE;
}
break;
case RDP_CODEC_ID_NONE:
{
if (!freerdp_image_copy(gdi->primary_buffer, gdi->dstFormat, gdi->stride,
- cmd->destLeft, cmd->destTop, cmd->width, cmd->height,
- cmd->bitmapData, PIXEL_FORMAT_XRGB32_VF, 0, 0, 0,
- &gdi->palette))
+ cmd->destLeft, cmd->destTop, cmd->width, cmd->height,
+ cmd->bitmapData, PIXEL_FORMAT_XRGB32_VF, 0, 0, 0,
+ &gdi->palette))
return FALSE;
}
break;
}
static BOOL gdi_init_primary(rdpGdi* gdi, UINT32 stride, BYTE* buffer,
- void (*pfree)(void*))
+ void (*pfree)(void*))
{
gdi->primary = (gdiBitmap*) calloc(1, sizeof(gdiBitmap));
if (!buffer)
{
gdi->primary->bitmap = gdi_CreateCompatibleBitmap(
- gdi->hdc, gdi->width, gdi->height);
+ gdi->hdc, gdi->width, gdi->height);
}
else
{
gdi->primary->bitmap = gdi_CreateBitmapEx(gdi->width, gdi->height,
- gdi->dstFormat,
- gdi->stride,
- gdi->primary_buffer, pfree);
+ gdi->dstFormat,
+ gdi->stride,
+ gdi->primary_buffer, pfree);
}
gdi->stride = gdi->primary->bitmap->scanline;
gdi->primary->hdc->hwnd->count = 32;
if (!(gdi->primary->hdc->hwnd->cinvalid = (HGDI_RGN) calloc(
- gdi->primary->hdc->hwnd->count, sizeof(GDI_RGN))))
+ gdi->primary->hdc->hwnd->count, sizeof(GDI_RGN))))
goto fail_hwnd;
gdi->primary->hdc->hwnd->ninvalid = 0;
}
BOOL gdi_resize_ex(rdpGdi* gdi, UINT32 width, UINT32 height,
- INT32 stride, INT32 format, BYTE* buffer,
- void (*pfree)(void*))
+ INT32 stride, INT32 format, BYTE* buffer,
+ void (*pfree)(void*))
{
if (!gdi || !gdi->primary)
return FALSE;
}
BOOL gdi_init_ex(freerdp* instance, UINT32 format, UINT32 stride, BYTE* buffer,
- void (*pfree)(void*))
+ void (*pfree)(void*))
{
rdpGdi* gdi;
rdpCache* cache = NULL;
gdi->dstFormat = format;
/* default internal buffer format */
WLog_INFO(TAG, "Local framebuffer format %s",
- GetColorFormatName(gdi->dstFormat));
+ GetColorFormatName(gdi->dstFormat));
WLog_INFO(TAG, "Remote framebuffer format %s",
- GetColorFormatName(SrcFormat));
+ GetColorFormatName(SrcFormat));
if (!(gdi->hdc = gdi_GetDC()))
goto fail_get_hdc;
}
if (!freerdp_client_codecs_reset(gdi->codecs, FREERDP_CODEC_ALL, gdi->width,
- gdi->height))
+ gdi->height))
goto fail_register_graphics;
gdi_register_update_callbacks(instance->update);