int xf_SurfaceCommand_Alpha(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status = 0; xfGfxSurface* surface; RECTANGLE_16 invalidRect; freerdp_client_codecs_prepare(xfc->codecs, FREERDP_CODEC_ALPHACODEC); surface = (xfGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); if (!surface) return -1; printf("xf_SurfaceCommand_Alpha: status: %d\n", status); /* fill with green for now to distinguish from the rest */ freerdp_image_fill(surface->data, PIXEL_FORMAT_XRGB32, surface->scanline, cmd->left, cmd->top, cmd->width, cmd->height, 0x00FF00); invalidRect.left = cmd->left; invalidRect.top = cmd->top; invalidRect.right = cmd->right; invalidRect.bottom = cmd->bottom; region16_union_rect(&(xfc->invalidRegion), &(xfc->invalidRegion), &invalidRect); if (!xfc->inGfxFrame) xf_OutputUpdate(xfc); return 1; }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT xf_SurfaceCommand_Alpha(xfContext* xfc, RdpgfxClientContext* context, RDPGFX_SURFACE_COMMAND* cmd) { int status = 0; xfGfxSurface* surface; RECTANGLE_16 invalidRect; surface = (xfGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); if (!surface) return ERROR_INTERNAL_ERROR; if (!freerdp_client_codecs_prepare(surface->codecs, FREERDP_CODEC_ALPHACODEC, surface->width, surface->height)) return ERROR_INTERNAL_ERROR; WLog_DBG(TAG, "xf_SurfaceCommand_Alpha: status: %d", status); /* fill with green for now to distinguish from the rest */ freerdp_image_fill(surface->data, PIXEL_FORMAT_XRGB32, surface->scanline, cmd->left, cmd->top, cmd->width, cmd->height, 0x00FF00); invalidRect.left = cmd->left; invalidRect.top = cmd->top; invalidRect.right = cmd->right; invalidRect.bottom = cmd->bottom; region16_union_rect(&surface->invalidRegion, &surface->invalidRegion, &invalidRect); if (!xfc->inGfxFrame) xf_UpdateSurfaces(xfc); return CHANNEL_RC_OK; }
int rdtk_surface_fill(rdtkSurface* surface, int x, int y, int width, int height, UINT32 color) { freerdp_image_fill(surface->data, PIXEL_FORMAT_XRGB32, surface->scanline, x, y, width, height, color); return 1; }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, const RDPGFX_SURFACE_COMMAND* cmd) { UINT status = CHANNEL_RC_OK; gdiGfxSurface* surface; RECTANGLE_16 invalidRect; surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); if (!surface) return ERROR_INTERNAL_ERROR; WLog_WARN(TAG, "TODO gdi_SurfaceCommand_Alpha: status: %d", status); /* fill with green for now to distinguish from the rest */ if (!freerdp_image_fill(surface->data, surface->format, surface->scanline, cmd->left, cmd->top, cmd->width, cmd->height, 0x00FF00)) return ERROR_INTERNAL_ERROR; invalidRect.left = cmd->left; invalidRect.top = cmd->top; invalidRect.right = cmd->right; invalidRect.bottom = cmd->bottom; region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); if (!gdi->inGfxFrame) { status = CHANNEL_RC_NOT_INITIALIZED; IFCALLRET(context->UpdateSurfaces, status, context); } return status; }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT gdi_SolidFill(RdpgfxClientContext* context, const RDPGFX_SOLID_FILL_PDU* solidFill) { UINT status = CHANNEL_RC_OK; UINT16 index; UINT32 color; BYTE a, r, g, b; UINT32 nWidth, nHeight; RECTANGLE_16* rect; gdiGfxSurface* surface; RECTANGLE_16 invalidRect; rdpGdi* gdi = (rdpGdi*) context->custom; surface = (gdiGfxSurface*) context->GetSurfaceData(context, solidFill->surfaceId); if (!surface) return ERROR_INTERNAL_ERROR; b = solidFill->fillPixel.B; g = solidFill->fillPixel.G; r = solidFill->fillPixel.R; /* a = solidFill->fillPixel.XA; * Ignore alpha channel, this is a solid fill. */ a = 0xFF; color = GetColor(surface->format, r, g, b, a); for (index = 0; index < solidFill->fillRectCount; index++) { rect = &(solidFill->fillRects[index]); nWidth = rect->right - rect->left; nHeight = rect->bottom - rect->top; invalidRect.left = rect->left; invalidRect.top = rect->top; invalidRect.right = rect->right; invalidRect.bottom = rect->bottom; if (!freerdp_image_fill(surface->data, surface->format, surface->scanline, rect->left, rect->top, nWidth, nHeight, color)) return ERROR_INTERNAL_ERROR; region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); } IFCALL(context->UpdateSurfaceArea, context, surface->surfaceId, solidFill->fillRectCount, solidFill->fillRects); if (!gdi->inGfxFrame) { status = CHANNEL_RC_NOT_INITIALIZED; IFCALLRET(context->UpdateSurfaces, status, context); } return status; }
int gdi_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFill) { UINT16 index; UINT32 color; BYTE a, r, g, b; int nWidth, nHeight; RDPGFX_RECT16* rect; gdiGfxSurface* surface; RECTANGLE_16 invalidRect; rdpGdi* gdi = (rdpGdi*) context->custom; surface = (gdiGfxSurface*) context->GetSurfaceData(context, solidFill->surfaceId); if (!surface) return -1; b = solidFill->fillPixel.B; g = solidFill->fillPixel.G; r = solidFill->fillPixel.R; a = solidFill->fillPixel.XA; if (!gdi->invert) color = ARGB32(a, r, g, b); else color = ABGR32(a, r, g, b); for (index = 0; index < solidFill->fillRectCount; index++) { rect = &(solidFill->fillRects[index]); nWidth = rect->right - rect->left; nHeight = rect->bottom - rect->top; invalidRect.left = rect->left; invalidRect.top = rect->top; invalidRect.right = rect->right; invalidRect.bottom = rect->bottom; freerdp_image_fill(surface->data, surface->format, surface->scanline, rect->left, rect->top, nWidth, nHeight, color); region16_union_rect(&(gdi->invalidRegion), &(gdi->invalidRegion), &invalidRect); } if (!gdi->inGfxFrame) gdi_OutputUpdate(gdi); return 1; }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT xf_SolidFill(RdpgfxClientContext* context, RDPGFX_SOLID_FILL_PDU* solidFill) { UINT16 index; UINT32 color; BYTE a, r, g, b; int nWidth, nHeight; RECTANGLE_16* rect; xfGfxSurface* surface; RECTANGLE_16 invalidRect; xfContext* xfc = (xfContext*) context->custom; surface = (xfGfxSurface*) context->GetSurfaceData(context, solidFill->surfaceId); if (!surface) return ERROR_INTERNAL_ERROR; b = solidFill->fillPixel.B; g = solidFill->fillPixel.G; r = solidFill->fillPixel.R; a = solidFill->fillPixel.XA; color = ARGB32(a, r, g, b); for (index = 0; index < solidFill->fillRectCount; index++) { rect = &(solidFill->fillRects[index]); nWidth = rect->right - rect->left; nHeight = rect->bottom - rect->top; invalidRect.left = rect->left; invalidRect.top = rect->top; invalidRect.right = rect->right; invalidRect.bottom = rect->bottom; freerdp_image_fill(surface->data, surface->format, surface->scanline, rect->left, rect->top, nWidth, nHeight, color); region16_union_rect(&surface->invalidRegion, &surface->invalidRegion, &invalidRect); } if (!xfc->inGfxFrame) xf_UpdateSurfaces(xfc); return CHANNEL_RC_OK; }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT gdi_SurfaceCommand_Alpha(rdpGdi* gdi, RdpgfxClientContext* context, const RDPGFX_SURFACE_COMMAND* cmd) { UINT status = CHANNEL_RC_OK; UINT32 color; gdiGfxSurface* surface; RECTANGLE_16 invalidRect; surface = (gdiGfxSurface*) context->GetSurfaceData(context, cmd->surfaceId); if (!surface) { WLog_ERR(TAG, "%s: unable to retrieve surfaceData for surfaceId=%"PRIu32"", __FUNCTION__, cmd->surfaceId); return ERROR_NOT_FOUND; } WLog_WARN(TAG, "TODO gdi_SurfaceCommand_Alpha: status: %"PRIu32"", status); /* fill with green for now to distinguish from the rest */ color = GetColor(surface->format, 0x00, 0xFF, 0x00, 0xFF); if (!freerdp_image_fill(surface->data, surface->format, surface->scanline, cmd->left, cmd->top, cmd->width, cmd->height, color)) return ERROR_INTERNAL_ERROR; invalidRect.left = cmd->left; invalidRect.top = cmd->top; invalidRect.right = cmd->right; invalidRect.bottom = cmd->bottom; region16_union_rect(&(surface->invalidRegion), &(surface->invalidRegion), &invalidRect); IFCALL(context->UpdateSurfaceArea, context, surface->surfaceId, 1, &invalidRect); if (!gdi->inGfxFrame) { status = CHANNEL_RC_NOT_INITIALIZED; IFCALLRET(context->UpdateSurfaces, status, context); } return status; }