From ac8c72238d13ee53fbac356f6fd62bff40d82d6b Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 13 Apr 2016 23:13:04 +0200 Subject: [PATCH] Api update. --- client/X11/xf_gdi.c | 176 +++++++++++++++++++++++------------------------ client/X11/xf_graphics.c | 10 +-- 2 files changed, 93 insertions(+), 93 deletions(-) diff --git a/client/X11/xf_gdi.c b/client/X11/xf_gdi.c index 59ccc7c..23e18b4 100644 --- a/client/X11/xf_gdi.c +++ b/client/X11/xf_gdi.c @@ -227,8 +227,8 @@ UINT32 xf_convert_rdp_order_color(xfContext* xfc, UINT32 color) case 32: case 24: if (xfc->visual->red_mask == 0xFF0000 && - xfc->visual->green_mask == 0xFF00 && - xfc->visual->blue_mask == 0xFF) + xfc->visual->green_mask == 0xFF00 && + xfc->visual->blue_mask == 0xFF) { return color; } @@ -240,8 +240,8 @@ UINT32 xf_convert_rdp_order_color(xfContext* xfc, UINT32 color) color = (color & 0xFF00) | ((color >> 16) & 0xFF); if (xfc->visual->red_mask == 0xF800 && - xfc->visual->green_mask == 0x07E0 && - xfc->visual->blue_mask == 0x001F) + xfc->visual->green_mask == 0x07E0 && + xfc->visual->blue_mask == 0x001F) { return color; } @@ -261,7 +261,7 @@ UINT32 xf_convert_rdp_order_color(xfContext* xfc, UINT32 color) { UINT32 dstColor = xfc->palette[color]; SplitColor(dstColor, xfc->format, &r, &g, &b, - NULL, NULL); + NULL, NULL); } break; @@ -271,8 +271,8 @@ UINT32 xf_convert_rdp_order_color(xfContext* xfc, UINT32 color) } return (((r >> xfc->red_shift_r) << xfc->red_shift_l) | - ((g >> xfc->green_shift_r) << xfc->green_shift_l) | - ((b >> xfc->blue_shift_r) << xfc->blue_shift_l)); + ((g >> xfc->green_shift_r) << xfc->green_shift_l) | + ((b >> xfc->blue_shift_r) << xfc->blue_shift_l)); } Pixmap xf_brush_new(xfContext* xfc, int width, int height, int bpp, BYTE* data) @@ -289,9 +289,9 @@ Pixmap xf_brush_new(xfContext* xfc, int width, int height, int bpp, BYTE* data) brushFormat = gdi_get_pixel_format(bpp, FALSE); cdata = (BYTE*) _aligned_malloc(width * height * 4, 16); freerdp_image_copy(cdata, xfc->format, -1, 0, 0, - width, height, data, brushFormat, -1, 0, 0, xfc->palette); + width, height, data, brushFormat, -1, 0, 0, xfc->palette); image = XCreateImage(xfc->display, xfc->visual, xfc->depth, - ZPixmap, 0, (char*) cdata, width, height, xfc->scanline_pad, 0); + ZPixmap, 0, (char*) cdata, width, height, xfc->scanline_pad, 0); gc = XCreateGC(xfc->display, xfc->drawable, 0, NULL); XPutImage(xfc->display, bitmap, gc, image, 0, 0, 0, 0, width, height); XFree(image); @@ -313,14 +313,14 @@ Pixmap xf_mono_bitmap_new(xfContext* xfc, int width, int height, BYTE* data) scanline = (width + 7) / 8; bitmap = XCreatePixmap(xfc->display, xfc->drawable, width, height, 1); image = XCreateImage(xfc->display, xfc->visual, 1, - ZPixmap, 0, (char*) data, width, height, 8, scanline); + ZPixmap, 0, (char*) data, width, height, 8, scanline); XPutImage(xfc->display, bitmap, xfc->gc_mono, image, 0, 0, 0, 0, width, height); XFree(image); return bitmap; } BOOL xf_gdi_bitmap_update(rdpContext* context, - const BITMAP_UPDATE* bitmapUpdate) + const BITMAP_UPDATE* bitmapUpdate) { int status; int nXDst; @@ -367,21 +367,21 @@ BOOL xf_gdi_bitmap_update(rdpContext* context, return FALSE; status = interleaved_decompress(codecs->interleaved, - pSrcData, SrcSize, - bitsPerPixel, - pDstData, - xfc->format, -1, - 0, 0, - nWidth, nHeight, - xfc->palette); + pSrcData, SrcSize, + bitsPerPixel, + pDstData, + xfc->format, -1, + 0, 0, + nWidth, nHeight, + xfc->palette); } else { if (!freerdp_client_codecs_prepare(codecs, FREERDP_CODEC_PLANAR)) return FALSE; - status = planar_decompress(codecs->planar, pSrcData, SrcSize, &pDstData, - xfc->format, -1, 0, 0, nWidth, nHeight, TRUE); + status = planar_decompress(codecs->planar, pSrcData, SrcSize, pDstData, + xfc->format, -1, 0, 0, nWidth, nHeight, TRUE); } if (status < 0) @@ -396,14 +396,14 @@ BOOL xf_gdi_bitmap_update(rdpContext* context, { pDstData = xfc->bitmap_buffer; status = freerdp_image_copy(pDstData, xfc->format, -1, 0, 0, - nWidth, nHeight, pSrcData, SrcFormat, -1, 0, 0, xfc->palette); + nWidth, nHeight, pSrcData, SrcFormat, -1, 0, 0, xfc->palette); pSrcData = xfc->bitmap_buffer; } xf_lock_x11(xfc, FALSE); XSetFunction(xfc->display, xfc->gc, GXcopy); image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, - (char*) pSrcData, nWidth, nHeight, xfc->scanline_pad, 0); + (char*) pSrcData, nWidth, nHeight, xfc->scanline_pad, 0); if (!image) { @@ -414,7 +414,7 @@ BOOL xf_gdi_bitmap_update(rdpContext* context, nWidth = bitmap->destRight - bitmap->destLeft + 1; /* clip width */ nHeight = bitmap->destBottom - bitmap->destTop + 1; /* clip height */ XPutImage(xfc->display, xfc->primary, xfc->gc, - image, 0, 0, nXDst, nYDst, nWidth, nHeight); + image, 0, 0, nXDst, nYDst, nWidth, nHeight); XFree(image); ret = gdi_InvalidateRegion(xfc->hdc, nXDst, nYDst, nWidth, nHeight); xf_unlock_x11(xfc, FALSE); @@ -427,7 +427,7 @@ BOOL xf_gdi_bitmap_update(rdpContext* context, } static BOOL xf_gdi_palette_update(rdpContext* context, - const PALETTE_UPDATE* palette) + const PALETTE_UPDATE* palette) { int index; const PALETTE_ENTRY* pe; @@ -440,7 +440,7 @@ static BOOL xf_gdi_palette_update(rdpContext* context, { pe = &(palette->entries[index]); palette32[index] = GetColor(xfc->format, - pe->red, pe->green, pe->blue, 0xFF); + pe->red, pe->green, pe->blue, 0xFF); } xf_unlock_x11(xfc, FALSE); @@ -448,7 +448,7 @@ static BOOL xf_gdi_palette_update(rdpContext* context, } static BOOL xf_gdi_set_bounds(rdpContext* context, - const rdpBounds* bounds) + const rdpBounds* bounds) { XRectangle clip; xfContext* xfc = (xfContext*) context; @@ -479,12 +479,12 @@ static BOOL xf_gdi_dstblt(rdpContext* context, const DSTBLT_ORDER* dstblt) xf_set_rop3(xfc, gdi_rop3_code(dstblt->bRop)); XSetFillStyle(xfc->display, xfc->gc, FillSolid); XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - dstblt->nLeftRect, dstblt->nTopRect, - dstblt->nWidth, dstblt->nHeight); + dstblt->nLeftRect, dstblt->nTopRect, + dstblt->nWidth, dstblt->nHeight); if (xfc->drawing == xfc->primary) ret = gdi_InvalidateRegion(xfc->hdc, dstblt->nLeftRect, dstblt->nTopRect, - dstblt->nWidth, dstblt->nHeight); + dstblt->nWidth, dstblt->nHeight); XSetFunction(xfc->display, xfc->gc, GXcopy); xf_unlock_x11(xfc, FALSE); @@ -510,19 +510,19 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetForeground(xfc->display, xfc->gc, foreColor); XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); + patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); } else if (brush->style == GDI_BS_HATCHED) { pattern = xf_mono_bitmap_new(xfc, 8, 8, - GDI_BS_HATCHED_PATTERNS + 8 * brush->hatch); + GDI_BS_HATCHED_PATTERNS + 8 * brush->hatch); XSetForeground(xfc->display, xfc->gc, backColor); XSetBackground(xfc->display, xfc->gc, foreColor); XSetFillStyle(xfc->display, xfc->gc, FillOpaqueStippled); XSetStipple(xfc->display, xfc->gc, pattern); XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y); XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); + patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); XFreePixmap(xfc->display, pattern); } else if (brush->style == GDI_BS_PATTERN) @@ -534,7 +534,7 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) XSetTile(xfc->display, xfc->gc, pattern); XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y); XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); + patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); XSetTile(xfc->display, xfc->gc, xfc->primary); XFreePixmap(xfc->display, pattern); } @@ -547,7 +547,7 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) XSetStipple(xfc->display, xfc->gc, pattern); XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y); XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); + patblt->nLeftRect, patblt->nTopRect, patblt->nWidth, patblt->nHeight); XFreePixmap(xfc->display, pattern); } } @@ -558,7 +558,7 @@ static BOOL xf_gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt) if (xfc->drawing == xfc->primary) ret = gdi_InvalidateRegion(xfc->hdc, patblt->nLeftRect, patblt->nTopRect, - patblt->nWidth, patblt->nHeight); + patblt->nWidth, patblt->nHeight); XSetFunction(xfc->display, xfc->gc, GXcopy); xf_unlock_x11(xfc, FALSE); @@ -576,12 +576,12 @@ static BOOL xf_gdi_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt) xf_lock_x11(xfc, FALSE); xf_set_rop3(xfc, gdi_rop3_code(scrblt->bRop)); XCopyArea(xfc->display, xfc->primary, xfc->drawing, xfc->gc, scrblt->nXSrc, - scrblt->nYSrc, - scrblt->nWidth, scrblt->nHeight, scrblt->nLeftRect, scrblt->nTopRect); + scrblt->nYSrc, + scrblt->nWidth, scrblt->nHeight, scrblt->nLeftRect, scrblt->nTopRect); if (xfc->drawing == xfc->primary) ret = gdi_InvalidateRegion(xfc->hdc, scrblt->nLeftRect, scrblt->nTopRect, - scrblt->nWidth, scrblt->nHeight); + scrblt->nWidth, scrblt->nHeight); XSetFunction(xfc->display, xfc->gc, GXcopy); xf_unlock_x11(xfc, FALSE); @@ -589,7 +589,7 @@ static BOOL xf_gdi_scrblt(rdpContext* context, const SCRBLT_ORDER* scrblt) } static BOOL xf_gdi_opaque_rect(rdpContext* context, - const OPAQUE_RECT_ORDER* opaque_rect) + const OPAQUE_RECT_ORDER* opaque_rect) { UINT32 color; xfContext* xfc = (xfContext*) context; @@ -600,20 +600,20 @@ static BOOL xf_gdi_opaque_rect(rdpContext* context, XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetForeground(xfc->display, xfc->gc, color); XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - opaque_rect->nLeftRect, opaque_rect->nTopRect, - opaque_rect->nWidth, opaque_rect->nHeight); + opaque_rect->nLeftRect, opaque_rect->nTopRect, + opaque_rect->nWidth, opaque_rect->nHeight); if (xfc->drawing == xfc->primary) ret = gdi_InvalidateRegion(xfc->hdc, opaque_rect->nLeftRect, - opaque_rect->nTopRect, - opaque_rect->nWidth, opaque_rect->nHeight); + opaque_rect->nTopRect, + opaque_rect->nWidth, opaque_rect->nHeight); xf_unlock_x11(xfc, FALSE); return ret; } static BOOL xf_gdi_multi_opaque_rect(rdpContext* context, - const MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect) + const MULTI_OPAQUE_RECT_ORDER* multi_opaque_rect) { UINT32 i; UINT32 color; @@ -630,13 +630,13 @@ static BOOL xf_gdi_multi_opaque_rect(rdpContext* context, { rectangle = &multi_opaque_rect->rectangles[i]; XFillRectangle(xfc->display, xfc->drawing, xfc->gc, - rectangle->left, rectangle->top, - rectangle->width, rectangle->height); + rectangle->left, rectangle->top, + rectangle->width, rectangle->height); if (xfc->drawing == xfc->primary) { if (!(ret = gdi_InvalidateRegion(xfc->hdc, rectangle->left, rectangle->top, - rectangle->width, rectangle->height))) + rectangle->width, rectangle->height))) break; } } @@ -646,7 +646,7 @@ static BOOL xf_gdi_multi_opaque_rect(rdpContext* context, } void xf_gdi_draw_nine_grid(rdpContext* context, - DRAW_NINE_GRID_ORDER* draw_nine_grid) + DRAW_NINE_GRID_ORDER* draw_nine_grid) { WLog_ERR(TAG, "DrawNineGrid"); } @@ -662,7 +662,7 @@ static BOOL xf_gdi_line_to(rdpContext* context, const LINE_TO_ORDER* line_to) XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetForeground(xfc->display, xfc->gc, color); XDrawLine(xfc->display, xfc->drawing, xfc->gc, - line_to->nXStart, line_to->nYStart, line_to->nXEnd, line_to->nYEnd); + line_to->nXStart, line_to->nYStart, line_to->nXEnd, line_to->nYEnd); if (xfc->drawing == xfc->primary) { @@ -680,7 +680,7 @@ static BOOL xf_gdi_line_to(rdpContext* context, const LINE_TO_ORDER* line_to) } static BOOL xf_gdi_invalidate_poly_region(xfContext* xfc, XPoint* points, - int npoints) + int npoints) { int x, y, x1, y1, x2, y2; @@ -715,7 +715,7 @@ static BOOL xf_gdi_invalidate_poly_region(xfContext* xfc, XPoint* points, } static BOOL xf_gdi_polyline(rdpContext* context, - const POLYLINE_ORDER* polyline) + const POLYLINE_ORDER* polyline) { int i; int npoints; @@ -747,7 +747,7 @@ static BOOL xf_gdi_polyline(rdpContext* context, } XDrawLines(xfc->display, xfc->drawing, xfc->gc, points, npoints, - CoordModePrevious); + CoordModePrevious); if (xfc->drawing == xfc->primary) { @@ -775,13 +775,13 @@ static BOOL xf_gdi_memblt(rdpContext* context, MEMBLT_ORDER* memblt) if (xf_set_rop3(xfc, gdi_rop3_code(memblt->bRop))) { XCopyArea(xfc->display, bitmap->pixmap, xfc->drawing, xfc->gc, - memblt->nXSrc, memblt->nYSrc, memblt->nWidth, memblt->nHeight, - memblt->nLeftRect, memblt->nTopRect); + memblt->nXSrc, memblt->nYSrc, memblt->nWidth, memblt->nHeight, + memblt->nLeftRect, memblt->nTopRect); if (xfc->drawing == xfc->primary) ret = gdi_InvalidateRegion(xfc->hdc, memblt->nLeftRect, - memblt->nTopRect, memblt->nWidth, - memblt->nHeight); + memblt->nTopRect, memblt->nWidth, + memblt->nHeight); XSetFunction(xfc->display, xfc->gc, GXcopy); } @@ -842,12 +842,12 @@ static BOOL xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) } XCopyArea(xfc->display, bitmap->pixmap, xfc->drawing, xfc->gc, - mem3blt->nXSrc, mem3blt->nYSrc, mem3blt->nWidth, mem3blt->nHeight, - mem3blt->nLeftRect, mem3blt->nTopRect); + mem3blt->nXSrc, mem3blt->nYSrc, mem3blt->nWidth, mem3blt->nHeight, + mem3blt->nLeftRect, mem3blt->nTopRect); if (xfc->drawing == xfc->primary) ret = gdi_InvalidateRegion(xfc->hdc, mem3blt->nLeftRect, mem3blt->nTopRect, - mem3blt->nWidth, mem3blt->nHeight); + mem3blt->nWidth, mem3blt->nHeight); XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetTSOrigin(xfc->display, xfc->gc, 0, 0); @@ -862,7 +862,7 @@ static BOOL xf_gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt) static BOOL xf_gdi_polygon_sc(rdpContext* context, - const POLYGON_SC_ORDER* polygon_sc) + const POLYGON_SC_ORDER* polygon_sc) { int i, npoints; XPoint* points; @@ -908,7 +908,7 @@ static BOOL xf_gdi_polygon_sc(rdpContext* context, XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetForeground(xfc->display, xfc->gc, brush_color); XFillPolygon(xfc->display, xfc->drawing, xfc->gc, - points, npoints, Complex, CoordModePrevious); + points, npoints, Complex, CoordModePrevious); if (xfc->drawing == xfc->primary) { @@ -923,7 +923,7 @@ static BOOL xf_gdi_polygon_sc(rdpContext* context, } static BOOL xf_gdi_polygon_cb(rdpContext* context, - POLYGON_CB_ORDER* polygon_cb) + POLYGON_CB_ORDER* polygon_cb) { int i, npoints; XPoint* points; @@ -995,7 +995,7 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context, XSetTSOrigin(xfc->display, xfc->gc, brush->x, brush->y); XFillPolygon(xfc->display, xfc->drawing, xfc->gc, - points, npoints, Complex, CoordModePrevious); + points, npoints, Complex, CoordModePrevious); XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetTSOrigin(xfc->display, xfc->gc, 0, 0); XFreePixmap(xfc->display, pattern); @@ -1018,27 +1018,27 @@ static BOOL xf_gdi_polygon_cb(rdpContext* context, } static BOOL xf_gdi_ellipse_sc(rdpContext* context, - const ELLIPSE_SC_ORDER* ellipse_sc) + const ELLIPSE_SC_ORDER* ellipse_sc) { WLog_ERR(TAG, "Not implemented: EllipseSC"); return TRUE; } static BOOL xf_gdi_ellipse_cb(rdpContext* context, - const ELLIPSE_CB_ORDER* ellipse_cb) + const ELLIPSE_CB_ORDER* ellipse_cb) { WLog_ERR(TAG, "Not implemented: EllipseCB"); return TRUE; } static BOOL xf_gdi_frame_marker(rdpContext* context, - const FRAME_MARKER_ORDER* frameMarker) + const FRAME_MARKER_ORDER* frameMarker) { return TRUE; } static BOOL xf_gdi_surface_frame_marker(rdpContext* context, - const SURFACE_FRAME_MARKER* surface_frame_marker) + const SURFACE_FRAME_MARKER* surface_frame_marker) { rdpSettings* settings; xfContext* xfc = (xfContext*) context; @@ -1061,12 +1061,12 @@ static BOOL xf_gdi_surface_frame_marker(rdpContext* context, if ((xfc->frame_x2 > xfc->frame_x1) && (xfc->frame_y2 > xfc->frame_y1)) ret = gdi_InvalidateRegion(xfc->hdc, xfc->frame_x1, xfc->frame_y1, - xfc->frame_x2 - xfc->frame_x1, xfc->frame_y2 - xfc->frame_y1); + xfc->frame_x2 - xfc->frame_x1, xfc->frame_y2 - xfc->frame_y1); if (settings->FrameAcknowledge > 0) { IFCALL(xfc->instance->update->SurfaceFrameAcknowledge, context, - surface_frame_marker->frameId); + surface_frame_marker->frameId); } break; @@ -1077,7 +1077,7 @@ static BOOL xf_gdi_surface_frame_marker(rdpContext* context, } static BOOL xf_gdi_surface_update_frame(xfContext* xfc, UINT16 tx, UINT16 ty, - UINT16 width, UINT16 height) + UINT16 width, UINT16 height) { BOOL ret = TRUE; @@ -1114,7 +1114,7 @@ static BOOL xf_gdi_surface_update_frame(xfContext* xfc, UINT16 tx, UINT16 ty, } static BOOL xf_gdi_surface_bits(rdpContext* context, - const SURFACE_BITS_COMMAND* cmd) + const SURFACE_BITS_COMMAND* cmd) { int i, tx, ty; XImage* image; @@ -1135,10 +1135,10 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, } if (!rfx_process_message(xfc->codecs->rfx, cmd->bitmapData, - PIXEL_FORMAT_XRGB32, cmd->bitmapDataLength, - cmd->destLeft, cmd->destTop, - gdi->primary_buffer, gdi->dstFormat, gdi->stride, - gdi->height, &invalidRegion)) + PIXEL_FORMAT_XRGB32, cmd->bitmapDataLength, + cmd->destLeft, cmd->destTop, + gdi->primary_buffer, gdi->dstFormat, gdi->stride, + gdi->height, &invalidRegion)) { WLog_ERR(TAG, "Failed to process RemoteFX message"); xf_unlock_x11(xfc, FALSE); @@ -1148,7 +1148,7 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, XSetFunction(xfc->display, xfc->gc, GXcopy); XSetFillStyle(xfc->display, xfc->gc, FillSolid); XSetClipRectangles(xfc->display, xfc->gc, cmd->destLeft, cmd->destTop, - (XRectangle*) message->rects, message->numRects, YXBanded); + (XRectangle*) message->rects, message->numRects, YXBanded); /* Invalidate the updated region */ for (i = 0; i < message->numRects; i++) @@ -1157,7 +1157,7 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, ty = message->rects[i].y + cmd->destTop; if (!xf_gdi_surface_update_frame(xfc, tx, ty, message->rects[i].width, - message->rects[i].height)) + message->rects[i].height)) { ret = FALSE; break; @@ -1176,8 +1176,8 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, } if (!nsc_process_message(xfc->codecs->nsc, cmd->bpp, cmd->width, cmd->height, - cmd->bitmapData, cmd->bitmapDataLength, - xfc->bitmap_buffer, xfc->format, 0, 0, 0, cmd->width, cmd->height)) + cmd->bitmapData, cmd->bitmapDataLength, + xfc->bitmap_buffer, xfc->format, 0, 0, 0, cmd->width, cmd->height)) { xf_unlock_x11(xfc, FALSE); return FALSE; @@ -1188,12 +1188,12 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, pSrcData = xfc->codecs->nsc->BitmapData; pDstData = xfc->bitmap_buffer; image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, - (char*) pDstData, cmd->width, cmd->height, xfc->scanline_pad, 0); + (char*) pDstData, cmd->width, cmd->height, xfc->scanline_pad, 0); XPutImage(xfc->display, xfc->primary, xfc->gc, image, 0, 0, - cmd->destLeft, cmd->destTop, cmd->width, cmd->height); + cmd->destLeft, cmd->destTop, cmd->width, cmd->height); XFree(image); ret = xf_gdi_surface_update_frame(xfc, cmd->destLeft, cmd->destTop, cmd->width, - cmd->height); + cmd->height); XSetClipMask(xfc->display, xfc->gc, None); } else if (cmd->codecID == RDP_CODEC_ID_NONE) @@ -1203,16 +1203,16 @@ static BOOL xf_gdi_surface_bits(rdpContext* context, pSrcData = cmd->bitmapData; pDstData = xfc->bitmap_buffer; freerdp_image_copy(pDstData, xfc->format, -1, 0, 0, - cmd->width, cmd->height, pSrcData, - PIXEL_FORMAT_BGRX32_VF, -1, 0, 0, xfc->palette); + cmd->width, cmd->height, pSrcData, + PIXEL_FORMAT_BGRX32_VF, -1, 0, 0, xfc->palette); image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0, - (char*) pDstData, cmd->width, cmd->height, xfc->scanline_pad, 0); + (char*) pDstData, cmd->width, cmd->height, xfc->scanline_pad, 0); XPutImage(xfc->display, xfc->primary, xfc->gc, image, 0, 0, - cmd->destLeft, cmd->destTop, - cmd->width, cmd->height); + cmd->destLeft, cmd->destTop, + cmd->width, cmd->height); XFree(image); ret = xf_gdi_surface_update_frame(xfc, cmd->destLeft, cmd->destTop, cmd->width, - cmd->height); + cmd->height); XSetClipMask(xfc->display, xfc->gc, None); } else diff --git a/client/X11/xf_graphics.c b/client/X11/xf_graphics.c index 8f1d8fe..d8e1860 100644 --- a/client/X11/xf_graphics.c +++ b/client/X11/xf_graphics.c @@ -55,7 +55,7 @@ static BOOL xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) xf_lock_x11(xfc, FALSE); data = bitmap->data; - depth = (bitmap->bpp >= 24) ? 24 : bitmap->bpp; + depth = GetBitsPerPixel(bitmap->format); pixmap = XCreatePixmap(xfc->display, xfc->drawable, bitmap->width, bitmap->height, xfc->depth); @@ -71,7 +71,7 @@ static BOOL xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) return FALSE; } - SrcFormat = gdi_get_pixel_format(bitmap->bpp, TRUE); + SrcFormat = bitmap->format; freerdp_image_copy(data, xfc->format, -1, 0, 0, bitmap->width, bitmap->height, @@ -81,7 +81,7 @@ static BOOL xf_Bitmap_New(rdpContext* context, rdpBitmap* bitmap) _aligned_free(bitmap->data); bitmap->data = data; - bitmap->bpp = (xfc->depth >= 24) ? 32 : xfc->depth; + bitmap->format = xfc->format; } image = XCreateImage(xfc->display, xfc->visual, xfc->depth, @@ -185,7 +185,7 @@ static BOOL xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, return FALSE; status = planar_decompress(xfc->codecs->planar, pSrcData, SrcSize, - &pDstData, xfc->format, -1, 0, 0, width, height, TRUE); + pDstData, xfc->format, -1, 0, 0, width, height, TRUE); } if (status < 0) @@ -205,7 +205,7 @@ static BOOL xf_Bitmap_Decompress(rdpContext* context, rdpBitmap* bitmap, bitmap->compressed = FALSE; bitmap->length = size; - bitmap->bpp = (xfc->depth >= 24) ? 32 : xfc->depth; + bitmap->format = xfc->format; return TRUE; } -- 2.7.4