UINT status = CHANNEL_RC_OK;
xfGfxSurface* surface;
UINT16* pSurfaceIds = NULL;
- rdpContext* ctx = (rdpContext*)context->custom;
- xfContext* xfc = (xfContext*) ctx;
- rdpGdi* gdi = ctx->instance->context->gdi;
+ rdpGdi* gdi = (rdpGdi*)context->custom;
+ xfContext* xfc = (xfContext*) gdi->context;
if (!gdi)
return status;
{
size_t size;
xfGfxSurface* surface;
- rdpContext* ctx = (rdpContext*)context->custom;
- xfContext* xfc = (xfContext*) ctx;
+ rdpGdi* gdi = (rdpGdi*)context->custom;
+ xfContext* xfc = (xfContext*) gdi->context;
surface = (xfGfxSurface*) calloc(1, sizeof(xfGfxSurface));
surface->gdi.height = (UINT32) createSurface->height;
switch(createSurface->pixelFormat)
{
- case PIXEL_FORMAT_ARGB_8888:
+ case GFX_PIXEL_FORMAT_ARGB_8888:
surface->gdi.format = PIXEL_FORMAT_BGRA32;
break;
- case PIXEL_FORMAT_XRGB_8888:
+ case GFX_PIXEL_FORMAT_XRGB_8888:
surface->gdi.format = PIXEL_FORMAT_BGRX32;
break;
default:
}
surface->gdi.scanline = surface->gdi.width * GetBytesPerPixel(surface->gdi.format);
- surface->gdi.scanline += (xfc->scanline_pad / 8) - (surface->gdi.scanline % (xfc->scanline_pad / 8));
+ if (xfc->scanline_pad > 0)
+ {
+ surface->gdi.scanline += (xfc->scanline_pad / 8);
+ surface->gdi.scanline -= (surface->gdi.scanline % (xfc->scanline_pad / 8));
+ }
size = surface->gdi.scanline * surface->gdi.height;
surface->gdi.data = (BYTE*) _aligned_malloc(size, 16);
UINT32 bytes = GetBytesPerPixel(xfc->format);
surface->stageScanline = width * bytes;
- surface->stageScanline += (xfc->scanline_pad / 8) - (surface->stageScanline % (xfc->scanline_pad / 8));
+ if (xfc->scanline_pad > 0)
+ {
+ surface->stageScanline += (xfc->scanline_pad / 8);
+ surface->stageScanline -= (surface->stageScanline % (xfc->scanline_pad / 8));
+ }
size = surface->stageScanline * surface->gdi.height;
if (!surface->stage)
{
- free(surface->gdi.data);
+ _aligned_free(surface->gdi.data);
free(surface);
return CHANNEL_RC_NO_MEMORY;
}
ZeroMemory(surface->stage, size);
- surface->image = XCreateImage(xfc->display, xfc->visual, xfc->depth, ZPixmap, 0,
- (char*) surface->stage, surface->gdi.width, surface->gdi.height, xfc->scanline_pad, surface->gdi.scanline);
+ surface->image = XCreateImage(xfc->display, xfc->visual, xfc->depth,
+ ZPixmap, 0, (char*) surface->stage,
+ surface->gdi.width, surface->gdi.height,
+ xfc->scanline_pad, surface->gdi.scanline);
}
surface->gdi.outputMapped = FALSE;
{
rdpGdi* gdi = xfc->context.gdi;
- xfc->gfx = gfx;
- gfx->custom = xfc->instance->context;
-
gdi_graphics_pipeline_init(gdi, gfx);
gfx->UpdateSurfaces = xf_UpdateSurfaces;
if (!surface)
return ERROR_INTERNAL_ERROR;
+ if (!freerdp_client_codecs_prepare(surface->codecs,
+ FREERDP_CODEC_REMOTEFX,
+ surface->width, surface->height))
+ return ERROR_INTERNAL_ERROR;
+
if (!rfx_process_message(surface->codecs->rfx, cmd->data, cmd->format,
cmd->length,
cmd->left, cmd->top,
if (!surface)
return ERROR_INTERNAL_ERROR;
- rc = clear_decompress(gdi->codecs->clear, cmd->data, cmd->length,
+ if (!freerdp_client_codecs_prepare(surface->codecs,
+ FREERDP_CODEC_CLEARCODEC,
+ surface->width, surface->height))
+ return ERROR_INTERNAL_ERROR;
+
+ rc = clear_decompress(surface->codecs->clear, cmd->data, cmd->length,
cmd->width, cmd->height,
surface->data, surface->format,
surface->scanline, cmd->left, cmd->top,
if (!surface)
return ERROR_INTERNAL_ERROR;
+ if (!freerdp_client_codecs_prepare(surface->codecs,
+ FREERDP_CODEC_PLANAR,
+ surface->width, surface->height))
+ return ERROR_INTERNAL_ERROR;
+
DstData = surface->data;
rc = planar_decompress(surface->codecs->planar, cmd->data, cmd->length,
DstData, surface->format,
if (!surface)
return ERROR_INTERNAL_ERROR;
+ if (!freerdp_client_codecs_prepare(surface->codecs,
+ FREERDP_CODEC_AVC420,
+ surface->width, surface->height))
+ return ERROR_INTERNAL_ERROR;
+
bs = (RDPGFX_AVC420_BITMAP_STREAM*) cmd->extra;
if (!bs)
if (!surface)
return ERROR_INTERNAL_ERROR;
+ if (!freerdp_client_codecs_prepare(surface->codecs,
+ FREERDP_CODEC_AVC444,
+ surface->width, surface->height))
+ return ERROR_INTERNAL_ERROR;
+
bs = (RDPGFX_AVC444_BITMAP_STREAM*) cmd->extra;
if (!bs)
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, "TODO gdi_SurfaceCommand_Alpha: status: %d", status);
/* fill with green for now to distinguish from the rest */
if (!surface)
return ERROR_INTERNAL_ERROR;
+ if (!freerdp_client_codecs_prepare(surface->codecs,
+ FREERDP_CODEC_PROGRESSIVE,
+ surface->width, surface->height))
+ return ERROR_INTERNAL_ERROR;
+
rc = progressive_create_surface_context(surface->codecs->progressive,
cmd->surfaceId,
surface->width, surface->height);
switch (createSurface->pixelFormat)
{
- case PIXEL_FORMAT_ARGB_8888:
+ case GFX_PIXEL_FORMAT_ARGB_8888:
surface->format = PIXEL_FORMAT_BGRA32;
break;
- case PIXEL_FORMAT_XRGB_8888:
+ case GFX_PIXEL_FORMAT_XRGB_8888:
surface->format = PIXEL_FORMAT_BGRX32;
break;
a = solidFill->fillPixel.XA;
color = GetColor(PIXEL_FORMAT_ARGB32, r, g, b, a);
color = ConvertColor(color, PIXEL_FORMAT_ARGB32, surface->format,
- &gdi->palette);
+ &gdi->palette);
for (index = 0; index < solidFill->fillRectCount; index++)
{