{
XSetRegion(xfc->display, xfc->gc, reg1);
XFillRectangle(xfc->display, xfc->window->handle, xfc->gc, 0, 0,
- xfc->window->width, xfc->window->height);
+ xfc->window->width, xfc->window->height);
XSetClipMask(xfc->display, xfc->gc, None);
}
picFormat = XRenderFindVisualFormat(xfc->display, xfc->visual);
pa.subwindow_mode = IncludeInferiors;
primaryPicture = XRenderCreatePicture(xfc->display, xfc->primary, picFormat,
- CPSubwindowMode, &pa);
+ CPSubwindowMode, &pa);
windowPicture = XRenderCreatePicture(xfc->display, xfc->window->handle,
- picFormat, CPSubwindowMode, &pa);
+ picFormat, CPSubwindowMode, &pa);
XRenderSetPictureFilter(xfc->display, primaryPicture, FilterBilinear, 0, 0);
transform.matrix[0][0] = XDoubleToFixed(xScalingFactor);
transform.matrix[0][1] = XDoubleToFixed(0.0);
BOOL xf_picture_transform_required(xfContext* xfc)
{
if (xfc->offset_x || xfc->offset_y ||
- xfc->scaledWidth != xfc->sessionWidth ||
- xfc->scaledHeight != xfc->sessionHeight)
+ xfc->scaledWidth != xfc->sessionWidth ||
+ xfc->scaledHeight != xfc->sessionHeight)
{
return TRUE;
}
if (!xfc->fullscreen)
{
xf_ResizeDesktopWindow(xfc, xfc->window, settings->DesktopWidth,
- settings->DesktopHeight);
+ settings->DesktopHeight);
}
else
{
XSetFillStyle(xfc->display, xfc->gc, FillSolid);
XSetForeground(xfc->display, xfc->gc, 0);
XFillRectangle(xfc->display, xfc->drawable, xfc->gc, 0, 0, xfc->window->width,
- xfc->window->height);
+ xfc->window->height);
}
return TRUE;
else
{
windowTitle = malloc(1 + sizeof("FreeRDP: ") + strlen(settings->ServerHostname)
- + sizeof(":00000"));
+ + sizeof(":00000"));
sprintf(windowTitle, "FreeRDP: %s:%i", settings->ServerHostname,
settings->ServerPort);
}
if (!xfc->primary)
xfc->primary = XCreatePixmap(xfc->display, xfc->drawable, xfc->sessionWidth,
- xfc->sessionHeight, xfc->depth);
+ xfc->sessionHeight, xfc->depth);
xfc->drawing = xfc->primary;
XSetFillStyle(xfc->display, xfc->gc, FillSolid);
XSetForeground(xfc->display, xfc->gc, BlackPixelOfScreen(xfc->screen));
XFillRectangle(xfc->display, xfc->primary, xfc->gc, 0, 0, xfc->sessionWidth,
- xfc->sessionHeight);
+ xfc->sessionHeight);
XFlush(xfc->display);
if (!xfc->image)
* @return 0 on success, otherwise a Win32 error code
*/
UINT xf_encomsp_participant_created(EncomspClientContext* context,
- ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated)
+ ENCOMSP_PARTICIPANT_CREATED_PDU* participantCreated)
{
return CHANNEL_RC_OK;
}
}
vis = XGetVisualInfo(xfc->display, VisualClassMask | VisualScreenMask,
- &template, &vi_count);
+ &template, &vi_count);
if (!vis)
{
int xkb_minor = XkbMinorVersion;
if (XkbLibraryVersion(&xkb_major, &xkb_minor)
- && XkbQueryExtension(context->display, &xkb_opcode, &xkb_event,
+ && XkbQueryExtension(context->display, &xkb_opcode, &xkb_event,
&xkb_error, &xkb_major, &xkb_minor))
{
context->xkbAvailable = TRUE;
for (i = 0; i < num_devices; ++i)
{
if ((devices2[i].use == XISlavePointer) &&
- (strncmp(devices2[i].name, TEST_PTR_STR, TEST_PTR_LEN) != 0))
+ (strncmp(devices2[i].name, TEST_PTR_STR, TEST_PTR_LEN) != 0))
{
xid = devices2[i].deviceid;
break;
for (i = 0; i < num_devices; ++i)
{
if ((devices1[i].use == IsXExtensionPointer) &&
- (strncmp(devices1[i].name, TEST_PTR_STR, TEST_PTR_LEN) != 0))
+ (strncmp(devices1[i].name, TEST_PTR_STR, TEST_PTR_LEN) != 0))
{
xid = devices1[i].id;
break;
PubSub_SubscribeChannelConnected(instance->context->pubSub,
(pChannelConnectedEventHandler) xf_OnChannelConnectedEventHandler);
PubSub_SubscribeChannelDisconnected(instance->context->pubSub,
- (pChannelDisconnectedEventHandler) xf_OnChannelDisconnectedEventHandler);
+ (pChannelDisconnectedEventHandler) xf_OnChannelDisconnectedEventHandler);
if (!freerdp_client_load_addins(channels, instance->settings))
return FALSE;
* we run the session in the /smart-sizing dimensions scaled to full screen
*/
if (settings->Fullscreen && settings->SmartSizing &&
- settings->SmartSizingWidth && settings->SmartSizingHeight)
+ settings->SmartSizingWidth && settings->SmartSizingHeight)
{
settings->DesktopWidth = settings->SmartSizingWidth;
settings->DesktopHeight = settings->SmartSizingHeight;
if (!status)
{
if (freerdp_get_last_error(instance->context) ==
- FREERDP_ERROR_AUTHENTICATION_FAILED)
+ FREERDP_ERROR_AUTHENTICATION_FAILED)
exit_code = XF_EXIT_AUTH_FAILURE;
else
exit_code = XF_EXIT_CONN_FAILED;
exit_code = freerdp_error_info(instance);
if (freerdp_get_last_error(instance->context) ==
- FREERDP_ERROR_AUTHENTICATION_FAILED)
+ FREERDP_ERROR_AUTHENTICATION_FAILED)
exit_code = XF_EXIT_AUTH_FAILURE;
else
exit_code = XF_EXIT_CONN_FAILED;
DWORD xf_exit_code_from_disconnect_reason(DWORD reason)
{
if (reason == 0 || (reason >= XF_EXIT_PARSE_ARGUMENTS
- && reason <= XF_EXIT_AUTH_FAILURE))
- return reason;
+ && reason <= XF_EXIT_AUTH_FAILURE))
+ return reason;
/* License error set */
else if (reason >= 0x100 && reason <= 0x10A)
reason -= 0x100 + XF_EXIT_LICENSE_INTERNAL;
return;
if (w < 10)
- w = 10;
+ w = 10;
if (h < 10)
- h = 10;
+ h = 10;
if (w == xfc->scaledWidth && h == xfc->scaledHeight)
return;
(pTerminateEventHandler) xf_TerminateEventHandler);
#ifdef WITH_XRENDER
PubSub_SubscribeZoomingChange(context->pubSub,
- (pZoomingChangeEventHandler) xf_ZoomingChangeEventHandler);
+ (pZoomingChangeEventHandler) xf_ZoomingChangeEventHandler);
PubSub_SubscribePanningChange(context->pubSub,
- (pPanningChangeEventHandler) xf_PanningChangeEventHandler);
+ (pPanningChangeEventHandler) xf_PanningChangeEventHandler);
#endif
xfc->UseXThreads = TRUE;
//xfc->debug = TRUE;
xfc->_NET_WM_NAME = XInternAtom(xfc->display, "_NET_WM_NAME", False);
xfc->_NET_WM_PID = XInternAtom(xfc->display, "_NET_WM_PID", False);
xfc->_NET_WM_WINDOW_TYPE = XInternAtom(xfc->display, "_NET_WM_WINDOW_TYPE",
- False);
+ False);
xfc->_NET_WM_WINDOW_TYPE_NORMAL = XInternAtom(xfc->display,
"_NET_WM_WINDOW_TYPE_NORMAL", False);
xfc->_NET_WM_WINDOW_TYPE_DIALOG = XInternAtom(xfc->display,
xfc->_NET_WM_STATE_SKIP_PAGER = XInternAtom(xfc->display,
"_NET_WM_STATE_SKIP_PAGER", False);
xfc->_NET_WM_MOVERESIZE = XInternAtom(xfc->display, "_NET_WM_MOVERESIZE",
- False);
+ False);
xfc->_NET_MOVERESIZE_WINDOW = XInternAtom(xfc->display,
"_NET_MOVERESIZE_WINDOW", False);
xfc->UTF8_STRING = XInternAtom(xfc->display, "UTF8_STRING", FALSE);
xfc->format = PIXEL_FORMAT_RGBX32;
if (xfc->depth == 32)
- xfc->format = (!xfc->invert) ? PIXEL_FORMAT_RGBA32 : PIXEL_FORMAT_BGRA32;
+ xfc->format = (xfc->invert) ? PIXEL_FORMAT_RGBA32 : PIXEL_FORMAT_BGRA32;
else if (xfc->depth == 24)
- xfc->format = (!xfc->invert) ? PIXEL_FORMAT_RGBX32 : PIXEL_FORMAT_BGRX32;
+ xfc->format = (xfc->invert) ? PIXEL_FORMAT_RGBX32 : PIXEL_FORMAT_BGRX32;
else if (xfc->depth == 16)
- xfc->format = (!xfc->invert) ? PIXEL_FORMAT_RGB16 : PIXEL_FORMAT_BGR16;
+ xfc->format = (xfc->invert) ? PIXEL_FORMAT_RGB16 : PIXEL_FORMAT_BGR16;
else if (xfc->depth == 15)
- xfc->format = (!xfc->invert) ? PIXEL_FORMAT_RGB16 : PIXEL_FORMAT_BGR16;
+ xfc->format = (xfc->invert) ? PIXEL_FORMAT_RGB16 : PIXEL_FORMAT_BGR16;
else
xfc->format = PIXEL_FORMAT_RGBX32;
FREERDP_API INT32 planar_decompress(BITMAP_PLANAR_CONTEXT* planar,
const BYTE* pSrcData, UINT32 SrcSize,
BYTE* pDstData, UINT32 DstFormat,
- INT32 nDstStep, UINT32 nXDst, UINT32 nYDst,
+ UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst,
UINT32 nWidth, UINT32 nHeight, BOOL vFlip);
#ifdef __cplusplus
prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmapV2->cacheId, cacheBitmapV2->cacheIndex);
- if (bitmap->New(context, bitmap))
+ if (!bitmap->New(context, bitmap))
return FALSE;
if (prevBitmap)
bitmapData->bpp, bitmapData->length, compressed,
bitmapData->codecID);
- if (bitmap->New(context, bitmap))
+ if (!bitmap->New(context, bitmap))
return FALSE;
prevBitmap = bitmap_cache_get(cache->bitmap, cacheBitmapV3->cacheId, cacheBitmapV3->cacheIndex);
bitmap->Free(context, bitmap);
reused = TRUE;
- bitmap->New(context, bitmap);
+ if (!bitmap->New(context, bitmap))
+ return FALSE;
- bitmap->Paint(context, bitmap);
+ if (!bitmap->Paint(context, bitmap))
+ return FALSE;
}
return TRUE;
}
* Write a foreground/background image to a destination buffer.
*/
static BYTE* WRITEFGBGIMAGE(BYTE* pbDest, UINT32 rowDelta,
- BYTE bitmask, PIXEL fgPel, UINT32 cBits)
+ BYTE bitmask, PIXEL fgPel, INT32 cBits)
{
PIXEL xorPixel;
if (!interleaved)
return -1;
- if (nDstStep < 0)
+ if (nDstStep <= 0)
nDstStep = nWidth * dstBytesPerPixel;
switch(bpp)
{
case 24:
scanline = nWidth * 3;
- SrcFormat = PIXEL_FORMAT_RGB24_VF;
+ SrcFormat = PIXEL_FORMAT_BGR24_VF;
break;
case 16:
scanline = nWidth * 2;
INT32 planar_decompress(BITMAP_PLANAR_CONTEXT* planar,
const BYTE* pSrcData, UINT32 SrcSize,
BYTE* pDstData, UINT32 DstFormat,
- INT32 nDstStep, UINT32 nXDst, UINT32 nYDst,
+ UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst,
UINT32 nWidth, UINT32 nHeight, BOOL vFlip)
{
BOOL cs;
dstBitsPerPixel = GetBitsPerPixel(DstFormat);
dstBytesPerPixel = GetBytesPerPixel(DstFormat);
- if (nDstStep < 0)
+ if (nDstStep <= 0)
nDstStep = nWidth * GetBytesPerPixel(DstFormat);
srcp = pSrcData;
if (alpha)
{
status = planar_decompress_plane_rle(planes[3], rleSizes[3],
- pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 3,
+ pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 3,
vFlip); /* AlphaPlane */
status = planar_decompress_plane_rle(planes[0], rleSizes[0],
- pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 2,
+ pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 2,
vFlip); /* RedPlane */
status = planar_decompress_plane_rle(planes[1], rleSizes[1],
- pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 1,
+ pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 1,
vFlip); /* GreenPlane */
status = planar_decompress_plane_rle(planes[2], rleSizes[2],
- pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 0,
+ pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 0,
vFlip); /* BluePlane */
srcp += rleSizes[0] + rleSizes[1] + rleSizes[2] + rleSizes[3];
}
else /* NoAlpha */
{
status = planar_decompress_plane_rle(planes[0], rleSizes[0],
- pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 2,
+ pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 2,
vFlip); /* RedPlane */
status = planar_decompress_plane_rle(planes[1], rleSizes[1],
- pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 1,
+ pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 1,
vFlip); /* GreenPlane */
status = planar_decompress_plane_rle(planes[2], rleSizes[2],
- pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 0,
+ pTempData, nTempStep, nXDst, nYDst, nWidth, nHeight, 0,
vFlip); /* BluePlane */
srcp += rleSizes[0] + rleSizes[1] + rleSizes[2];
}
}
BITMAP_PLANAR_CONTEXT* freerdp_bitmap_planar_context_new(
- DWORD flags, UINT32 maxWidth, UINT32 maxHeight)
+ DWORD flags, UINT32 maxWidth, UINT32 maxHeight)
{
BITMAP_PLANAR_CONTEXT* context;
context = (BITMAP_PLANAR_CONTEXT*) calloc(1, sizeof(BITMAP_PLANAR_CONTEXT));
BOOL Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y)
{
return IFCALLRESULT(TRUE, context->graphics->Pointer_Prototype->SetPosition,
- context, x, y);
+ context, x, y);
}
void graphics_register_pointer(rdpGraphics* graphics, rdpPointer* pointer)
}
BOOL Glyph_BeginDraw(rdpContext* context, int x, int y, int width, int height,
- UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant)
+ UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant)
{
return context->graphics->Glyph_Prototype->BeginDraw(context, x, y, width,
height, bgcolor, fgcolor, fOpRedundant);
return TRUE;
if ((hdcDest->selectedObject != hdcSrc->selectedObject) ||
- !gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc))
+ !gdi_CopyOverlap(nXDest, nYDest, nWidth, nHeight, nXSrc, nYSrc))
{
for (y = 0; y < nHeight; y++)
{
}
static BOOL BitBlt_NOTSRCCOPY(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
- UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
- UINT32 nXSrc, UINT32 nYSrc)
+ UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
+ UINT32 nXSrc, UINT32 nYSrc)
{
UINT32 x, y;
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
}
static BOOL BitBlt_SRCERASE(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
- UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
- UINT32 nXSrc, UINT32 nYSrc)
+ UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
+ UINT32 nXSrc, UINT32 nYSrc)
{
UINT32 x, y;
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
}
static BOOL BitBlt_NOTSRCERASE(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
- UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
- UINT32 nXSrc, UINT32 nYSrc)
+ UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
+ UINT32 nXSrc, UINT32 nYSrc)
{
UINT32 x, y;
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = ~colorA & ~colorB;
WriteColor(dstp, hdcDest->format, color);
}
static BOOL BitBlt_SRCINVERT(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
- UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
- UINT32 nXSrc, UINT32 nYSrc)
+ UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
+ UINT32 nXSrc, UINT32 nYSrc)
{
UINT32 x, y;
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = colorA ^ colorB;
WriteColor(dstp, hdcDest->format, color);
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = colorA & colorB;
WriteColor(dstp, hdcDest->format, color);
}
static BOOL BitBlt_SRCPAINT(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
- UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
- UINT32 nXSrc, UINT32 nYSrc)
+ UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
+ UINT32 nXSrc, UINT32 nYSrc)
{
UINT32 x, y;
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = colorA | colorB;
WriteColor(dstp, hdcDest->format, color);
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = (colorA & color) | (~colorA & colorB);
WriteColor(dstp, hdcDest->format, color);
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = (colorA & colorB) | (~colorA & colorC);
WriteColor(dstp, hdcDest->format, color);
const BYTE* patp = gdi_get_brush_pointer(
hdcDest, nXDest + x, nYDest + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 colorC = ReadColor(patp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = (colorA & colorB) | (~colorA & colorC);
WriteColor(dstp, hdcDest->format, color);
const BYTE* srcp = gdi_get_bitmap_pointer(
hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
colorD = colorA ^ (color & (colorB ^ colorA));
WriteColor(dstp, hdcDest->format, color);
const BYTE* patp = gdi_get_brush_pointer(
hdcDest, nXDest + x, nYDest + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 color = ReadColor(patp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
colorD = colorA ^ (color & (colorB ^ colorA));
WriteColor(dstp, hdcDest->format, color);
UINT32 colorB = ReadColor(patp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = colorA & ~colorB;
WriteColor(dstp, hdcDest->format, color);
}
for (x = 0; x < nWidth; x++)
{
const BYTE* srcp = gdi_get_bitmap_pointer(
- hdcSrc, nXSrc + x, nYSrc + y);
+ hdcSrc, nXSrc + x, nYSrc + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && dstp)
{
UINT32 color;
UINT32 colorB = ReadColor(dstp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = ~colorA & colorB;
WriteColor(dstp, hdcDest->format, color);
static BOOL BitBlt_MERGECOPY(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
- UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
- UINT32 nXSrc, UINT32 nYSrc)
+ UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
+ UINT32 nXSrc, UINT32 nYSrc)
{
UINT32 x, y;
const BYTE* patp = gdi_get_brush_pointer(
hdcDest, nXDest + x, nYDest + y);
BYTE* dstp = gdi_get_bitmap_pointer(
- hdcDest, nXDest + x, nYDest + y);
+ hdcDest, nXDest + x, nYDest + y);
if (srcp && patp && dstp)
{
UINT32 colorB = ReadColor(patp, hdcDest->format);
colorA = ConvertColor(colorA, hdcSrc->format,
- hdcDest->format, NULL);
+ hdcDest->format, NULL);
color = colorA & colorB;
WriteColor(dstp, hdcDest->format, color);
}
}
static BOOL BitBlt_MERGEPAINT(HGDI_DC hdcDest, UINT32 nXDest, UINT32 nYDest,
- UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
- UINT32 nXSrc, UINT32 nYSrc)
+ UINT32 nWidth, UINT32 nHeight, HGDI_DC hdcSrc,
+ UINT32 nXSrc, UINT32 nYSrc)
{
UINT32 x, y;
/* Bitmap Class */
HGDI_BITMAP gdi_create_bitmap(rdpGdi* gdi, UINT32 nWidth, UINT32 nHeight,
- UINT32 SrcFormat, BYTE* data)
+ UINT32 SrcFormat, BYTE* data)
{
UINT32 nSrcStep;
UINT32 nDstStep;
pSrcData = data;
nSrcStep = nWidth * GetBytesPerPixel(SrcFormat);
freerdp_image_copy(pDstData, gdi->dstFormat, nDstStep, 0, 0,
- nWidth, nHeight, pSrcData, SrcFormat, nSrcStep, 0, 0, gdi->palette);
+ nWidth, nHeight, pSrcData, SrcFormat, nSrcStep, 0, 0, gdi->palette);
bitmap = gdi_CreateBitmap(nWidth, nHeight, gdi->dstFormat, pDstData);
return bitmap;
}
if (!bitmap->data)
gdi_bitmap->bitmap = gdi_CreateCompatibleBitmap(
- gdi->hdc, bitmap->width,
- bitmap->height);
+ gdi->hdc, bitmap->width,
+ bitmap->height);
else
{
- UINT32 format;
-
- switch (bitmap->bpp)
- {
- case 32:
- format = PIXEL_FORMAT_RGBX32;
- break;
-
- case 24:
- format = PIXEL_FORMAT_RGB24;
- break;
-
- case 16:
- format = PIXEL_FORMAT_RGB16;
- break;
-
- case 15:
- format = PIXEL_FORMAT_RGB15;
- break;
-
- case 8:
- format = PIXEL_FORMAT_RGB8;
- break;
-
- case 4:
- format = PIXEL_FORMAT_A4;
- break;
-
- case 1:
- format = PIXEL_FORMAT_MONO;
- break;
-
- default:
- return FALSE;
- }
+ UINT32 format = bitmap->format;
gdi_bitmap->bitmap = gdi_create_bitmap(gdi, bitmap->width,
- bitmap->height,
- format, bitmap->data);
+ bitmap->height,
+ format, bitmap->data);
}
if (!gdi_bitmap->bitmap)
width = bitmap->right - bitmap->left + 1;
height = bitmap->bottom - bitmap->top + 1;
return gdi_BitBlt(context->gdi->primary->hdc, bitmap->left, bitmap->top,
- width, height, gdi_bitmap->hdc, 0, 0, GDI_SRCCOPY);
+ width, height, gdi_bitmap->hdc, 0, 0, GDI_SRCCOPY);
}
static BOOL gdi_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap,
- const BYTE* data, UINT32 width, UINT32 height,
- UINT32 bpp, UINT32 length, BOOL compressed,
- UINT32 codecId)
+ const BYTE* data, UINT32 width, UINT32 height,
+ UINT32 bpp, UINT32 length, BOOL compressed,
+ UINT32 codecId)
{
int status;
UINT16 size;
if (bpp < 32)
{
status = interleaved_decompress(gdi->codecs->interleaved,
- pSrcData, SrcSize,
- bpp,
- pDstData, gdi->dstFormat,
- -1, 0, 0, width, height,
- gdi->palette);
+ pSrcData, SrcSize,
+ bpp,
+ pDstData, gdi->dstFormat,
+ 0, 0, 0, width, height,
+ gdi->palette);
}
else
{
}
else
{
- SrcFormat = gdi_get_pixel_format(bpp, TRUE);
- status = freerdp_image_copy(pDstData, gdi->dstFormat, -1, 0, 0,
- width, height, pSrcData, SrcFormat, -1, 0, 0, gdi->palette);
+ SrcFormat = gdi_get_pixel_format(bpp, FALSE);
+ status = freerdp_image_copy(pDstData, gdi->dstFormat, 0, 0, 0,
+ width, height, pSrcData, SrcFormat,
+ 0, 0, 0, gdi->palette);
}
bitmap->compressed = FALSE;
bitmap->length = size;
- bitmap->bpp = GetBitsPerPixel(gdi->dstFormat);
+ bitmap->format = gdi->dstFormat;
return TRUE;
}
static BOOL gdi_Bitmap_SetSurface(rdpContext* context, rdpBitmap* bitmap,
- BOOL primary)
+ BOOL primary)
{
rdpGdi* gdi = context->gdi;
}
gdi_glyph->bitmap = gdi_CreateBitmap(glyph->cx, glyph->cy, PIXEL_FORMAT_MONO,
- data);
+ data);
if (!gdi_glyph->bitmap)
{
}
static BOOL gdi_Glyph_Draw(rdpContext* context, rdpGlyph* glyph, UINT32 x,
- UINT32 y)
+ UINT32 y)
{
gdiGlyph* gdi_glyph;
rdpGdi* gdi = context->gdi;
gdi_glyph = (gdiGlyph*) glyph;
return gdi_BitBlt(gdi->drawing->hdc, x, y, gdi_glyph->bitmap->width,
- gdi_glyph->bitmap->height, gdi_glyph->hdc, 0, 0, GDI_DSPDxax);
+ gdi_glyph->bitmap->height, gdi_glyph->hdc, 0, 0, GDI_DSPDxax);
}
static BOOL gdi_Glyph_BeginDraw(rdpContext* context, UINT32 x, UINT32 y,
- UINT32 width, UINT32 height, UINT32 bgcolor,
- UINT32 fgcolor, BOOL fOpRedundant)
+ UINT32 width, UINT32 height, UINT32 bgcolor,
+ UINT32 fgcolor, BOOL fOpRedundant)
{
GDI_RECT rect;
HGDI_BRUSH brush;
}
static BOOL gdi_Glyph_EndDraw(rdpContext* context, UINT32 x, UINT32 y,
- UINT32 width, UINT32 height, UINT32 bgcolor, UINT32 fgcolor)
+ UINT32 width, UINT32 height, UINT32 bgcolor, UINT32 fgcolor)
{
rdpGdi* gdi = context->gdi;
UINT32 SrcFormat = gdi_get_pixel_format(context->settings->ColorDepth, FALSE);
bgcolor = ConvertColor(bgcolor, SrcFormat,
- gdi->dstFormat, gdi->palette);
+ gdi->dstFormat, gdi->palette);
gdi->textColor = gdi_SetTextColor(gdi->drawing->hdc, bgcolor);
return TRUE;
}
/* Graphics Module */
-
BOOL gdi_register_graphics(rdpGraphics* graphics)
{
rdpBitmap* bitmap;