mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 08:54:38 +09:00
Fixed initial alpha values for codec buffers
This commit is contained in:
@@ -414,6 +414,8 @@ static INLINE BOOL progressive_tile_allocate(RFX_PROGRESSIVE_TILE* tile)
|
||||
{
|
||||
size_t dataLen = tile->stride * tile->height * 1ULL;
|
||||
tile->data = (BYTE*)_aligned_malloc(dataLen, 16);
|
||||
if (tile->data)
|
||||
memset(tile->data, 0xFF, dataLen);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -155,18 +155,19 @@ static void rfx_tile_init(void* obj)
|
||||
|
||||
static void* rfx_decoder_tile_new(const void* val)
|
||||
{
|
||||
const size_t size = 4 * 64 * 64;
|
||||
RFX_TILE* tile = NULL;
|
||||
WINPR_UNUSED(val);
|
||||
|
||||
if (!(tile = (RFX_TILE*)calloc(1, sizeof(RFX_TILE))))
|
||||
return NULL;
|
||||
|
||||
if (!(tile->data = (BYTE*)_aligned_malloc(4 * 64 * 64, 16)))
|
||||
if (!(tile->data = (BYTE*)_aligned_malloc(size, 16)))
|
||||
{
|
||||
free(tile);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(tile->data, 0xff, size);
|
||||
tile->allocated = TRUE;
|
||||
return tile;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,11 @@ static UINT gdi_ResetGraphics(RdpgfxClientContext* context,
|
||||
{
|
||||
surface = (gdiGfxSurface*)context->GetSurfaceData(context, pSurfaceIds[index]);
|
||||
|
||||
if (!surface || !surface->outputMapped)
|
||||
if (!surface)
|
||||
continue;
|
||||
|
||||
memset(surface->data, 0xFF, surface->scanline * surface->height);
|
||||
if (!surface->outputMapped)
|
||||
continue;
|
||||
|
||||
region16_clear(&surface->invalidRegion);
|
||||
@@ -858,6 +862,7 @@ static UINT gdi_SurfaceCommand_Progressive(rdpGdi* gdi, RdpgfxClientContext* con
|
||||
}
|
||||
|
||||
region16_init(&invalidRegion);
|
||||
|
||||
rc = progressive_decompress(surface->codecs->progressive, cmd->data, cmd->length, surface->data,
|
||||
surface->format, surface->scanline, cmd->left, cmd->top,
|
||||
&invalidRegion, cmd->surfaceId, gdi->frameId);
|
||||
@@ -1032,6 +1037,7 @@ static UINT gdi_CreateSurface(RdpgfxClientContext* context,
|
||||
goto fail;
|
||||
}
|
||||
|
||||
memset(surface->data, 0xFF, surface->scanline * surface->height);
|
||||
surface->outputMapped = FALSE;
|
||||
region16_init(&surface->invalidRegion);
|
||||
rc = context->SetSurfaceData(context, surface->surfaceId, (void*)surface);
|
||||
|
||||
Reference in New Issue
Block a user