/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT gdi_ResetGraphics(RdpgfxClientContext* context, const RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) { UINT32 index; UINT16 count; UINT32 DesktopWidth; UINT32 DesktopHeight; gdiGfxSurface* surface; UINT16* pSurfaceIds = NULL; rdpGdi* gdi = (rdpGdi*) context->custom; rdpUpdate* update = gdi->context->update; rdpSettings* settings = gdi->context->settings; DesktopWidth = resetGraphics->width; DesktopHeight = resetGraphics->height; if ((DesktopWidth != settings->DesktopWidth) || (DesktopHeight != settings->DesktopHeight)) { settings->DesktopWidth = DesktopWidth; settings->DesktopHeight = DesktopHeight; if (update) update->DesktopResize(gdi->context); } context->GetSurfaceIds(context, &pSurfaceIds, &count); for (index = 0; index < count; index++) { surface = (gdiGfxSurface*) context->GetSurfaceData(context, pSurfaceIds[index]); if (!surface || !surface->outputMapped) continue; if (!freerdp_client_codecs_reset(surface->codecs, FREERDP_CODEC_ALL, surface->width, surface->height)) { free(pSurfaceIds); return ERROR_INTERNAL_ERROR; } region16_clear(&surface->invalidRegion); } free(pSurfaceIds); if (!freerdp_client_codecs_reset(gdi->context->codecs, FREERDP_CODEC_ALL, gdi->width, gdi->height)) return ERROR_INTERNAL_ERROR; gdi->graphicsReset = TRUE; return CHANNEL_RC_OK; }
int xf_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) { int count; int index; xfGfxSurface* surface; UINT16* pSurfaceIds = NULL; xfContext* xfc = (xfContext*) context->custom; freerdp_client_codecs_reset(xfc->codecs, FREERDP_CODEC_ALL); count = context->GetSurfaceIds(context, &pSurfaceIds); for (index = 0; index < count; index++) { surface = (xfGfxSurface*) context->GetSurfaceData(context, pSurfaceIds[index]); if (!surface || !surface->outputMapped) continue; region16_clear(&surface->invalidRegion); } free(pSurfaceIds); xfc->graphicsReset = TRUE; return 1; }
int gdi_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) { rdpGdi* gdi = (rdpGdi*) context->custom; freerdp_client_codecs_reset(gdi->codecs, FREERDP_CODEC_ALL); region16_init(&(gdi->invalidRegion)); gdi->graphicsReset = TRUE; return 1; }
int xf_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) { xfContext* xfc = (xfContext*) context->custom; freerdp_client_codecs_reset(xfc->codecs, FREERDP_CODEC_ALL); region16_uninit(&(xfc->invalidRegion)); region16_init(&(xfc->invalidRegion)); xfc->graphicsReset = TRUE; return 1; }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ static UINT xf_ResetGraphics(RdpgfxClientContext* context, RDPGFX_RESET_GRAPHICS_PDU* resetGraphics) { int index; UINT16 count; xfGfxSurface* surface; UINT16* pSurfaceIds = NULL; xfContext* xfc = (xfContext*) context->custom; context->GetSurfaceIds(context, &pSurfaceIds, &count); for (index = 0; index < count; index++) { surface = (xfGfxSurface*) context->GetSurfaceData(context, pSurfaceIds[index]); if (!surface || !surface->outputMapped) continue; if (!freerdp_client_codecs_reset(surface->codecs, FREERDP_CODEC_ALL, surface->width, surface->height)) { free(pSurfaceIds); return ERROR_INTERNAL_ERROR; } region16_clear(&surface->invalidRegion); } free(pSurfaceIds); if (!freerdp_client_codecs_reset(xfc->codecs, FREERDP_CODEC_ALL, xfc->settings->DesktopWidth, xfc->settings->DesktopHeight)) return ERROR_INTERNAL_ERROR; xfc->graphicsReset = TRUE; return CHANNEL_RC_OK; }