Fixed #7745: Progressive surface cleanup
This commit is contained in:
parent
66c7228643
commit
edcb8284e7
@ -365,13 +365,11 @@ static INLINE PROGRESSIVE_SURFACE_CONTEXT*
|
||||
progressive_get_surface_data(PROGRESSIVE_CONTEXT* progressive, UINT16 surfaceId)
|
||||
{
|
||||
void* key = (void*)(((ULONG_PTR)surfaceId) + 1);
|
||||
void* pData = NULL;
|
||||
|
||||
if (!progressive)
|
||||
return NULL;
|
||||
|
||||
pData = HashTable_GetItemValue(progressive->SurfaceContexts, key);
|
||||
return pData;
|
||||
return HashTable_GetItemValue(progressive->SurfaceContexts, key);
|
||||
}
|
||||
|
||||
static void progressive_tile_free(RFX_PROGRESSIVE_TILE* tile)
|
||||
@ -384,10 +382,14 @@ static void progressive_tile_free(RFX_PROGRESSIVE_TILE* tile)
|
||||
}
|
||||
}
|
||||
|
||||
static void progressive_surface_context_free(PROGRESSIVE_SURFACE_CONTEXT* surface)
|
||||
static void progressive_surface_context_free(void* ptr)
|
||||
{
|
||||
PROGRESSIVE_SURFACE_CONTEXT* surface = ptr;
|
||||
UINT32 index;
|
||||
|
||||
if (!surface)
|
||||
return;
|
||||
|
||||
for (index = 0; index < surface->gridSize; index++)
|
||||
{
|
||||
RFX_PROGRESSIVE_TILE* tile = &(surface->tiles[index]);
|
||||
@ -609,13 +611,7 @@ INT32 progressive_create_surface_context(PROGRESSIVE_CONTEXT* progressive, UINT1
|
||||
|
||||
int progressive_delete_surface_context(PROGRESSIVE_CONTEXT* progressive, UINT16 surfaceId)
|
||||
{
|
||||
PROGRESSIVE_SURFACE_CONTEXT* surface = progressive_get_surface_data(progressive, surfaceId);
|
||||
|
||||
if (surface)
|
||||
{
|
||||
progressive_set_surface_data(progressive, surfaceId, NULL);
|
||||
progressive_surface_context_free(surface);
|
||||
}
|
||||
progressive_set_surface_data(progressive, surfaceId, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -1110,7 +1106,7 @@ static INLINE INT16 progressive_rfx_srl_read(RFX_PROGRESSIVE_UPGRADE_STATE* stat
|
||||
if (k)
|
||||
{
|
||||
bs->mask = ((1 << k) - 1);
|
||||
state->nz = ((bs->accumulator >> (32 - k)) & bs->mask);
|
||||
state->nz = ((bs->accumulator >> (32u - k)) & bs->mask);
|
||||
BitStream_Shift(bs, k);
|
||||
}
|
||||
|
||||
@ -1661,6 +1657,9 @@ static void CALLBACK progressive_process_tiles_tile_work_callback(PTP_CALLBACK_I
|
||||
{
|
||||
PROGRESSIVE_TILE_PROCESS_WORK_PARAM* param = (PROGRESSIVE_TILE_PROCESS_WORK_PARAM*)context;
|
||||
|
||||
WINPR_UNUSED(instance);
|
||||
WINPR_UNUSED(work);
|
||||
|
||||
switch (param->tile->blockType)
|
||||
{
|
||||
case PROGRESSIVE_WBT_TILE_SIMPLE:
|
||||
@ -1939,11 +1938,11 @@ static INLINE BOOL progressive_write_region(PROGRESSIVE_CONTEXT* progressive, wS
|
||||
for (i = 0, qv = msg->quantVals; i < msg->numQuant; i++, qv += 10)
|
||||
{
|
||||
/* RFX_COMPONENT_CODEC_QUANT */
|
||||
Stream_Write_UINT8(s, qv[0] + (qv[2] << 4)); /* LL3 (4-bit), HL3 (4-bit) */
|
||||
Stream_Write_UINT8(s, qv[1] + (qv[3] << 4)); /* LH3 (4-bit), HH3 (4-bit) */
|
||||
Stream_Write_UINT8(s, qv[5] + (qv[4] << 4)); /* HL2 (4-bit), LH2 (4-bit) */
|
||||
Stream_Write_UINT8(s, qv[6] + (qv[8] << 4)); /* HH2 (4-bit), HL1 (4-bit) */
|
||||
Stream_Write_UINT8(s, qv[7] + (qv[9] << 4)); /* LH1 (4-bit), HH1 (4-bit) */
|
||||
Stream_Write_UINT8(s, (UINT8)(qv[0] + (qv[2] << 4))); /* LL3 (4-bit), HL3 (4-bit) */
|
||||
Stream_Write_UINT8(s, (UINT8)(qv[1] + (qv[3] << 4))); /* LH3 (4-bit), HH3 (4-bit) */
|
||||
Stream_Write_UINT8(s, (UINT8)(qv[5] + (qv[4] << 4))); /* HL2 (4-bit), LH2 (4-bit) */
|
||||
Stream_Write_UINT8(s, (UINT8)(qv[6] + (qv[8] << 4))); /* HH2 (4-bit), HL1 (4-bit) */
|
||||
Stream_Write_UINT8(s, (UINT8)(qv[7] + (qv[9] << 4))); /* LH1 (4-bit), HH1 (4-bit) */
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -2545,8 +2544,8 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcD
|
||||
{
|
||||
RECTANGLE_16 clippingRect;
|
||||
const RFX_RECT* rect = &(region->rects[i]);
|
||||
clippingRect.left = nXDst + rect->x;
|
||||
clippingRect.top = nYDst + rect->y;
|
||||
clippingRect.left = (UINT16)nXDst + rect->x;
|
||||
clippingRect.top = (UINT16)nYDst + rect->y;
|
||||
clippingRect.right = clippingRect.left + rect->width;
|
||||
clippingRect.bottom = clippingRect.top + rect->height;
|
||||
region16_union_rect(&clippingRects, &clippingRects, &clippingRect);
|
||||
@ -2796,6 +2795,11 @@ PROGRESSIVE_CONTEXT* progressive_context_new(BOOL Compressor)
|
||||
if (!progressive->SurfaceContexts)
|
||||
goto fail;
|
||||
|
||||
{
|
||||
wObject* obj = HashTable_ValueObject(progressive->SurfaceContexts);
|
||||
WINPR_ASSERT(obj);
|
||||
obj->fnObjectFree = progressive_surface_context_free;
|
||||
}
|
||||
return progressive;
|
||||
fail:
|
||||
progressive_context_free(progressive);
|
||||
@ -2804,11 +2808,6 @@ fail:
|
||||
|
||||
void progressive_context_free(PROGRESSIVE_CONTEXT* progressive)
|
||||
{
|
||||
int count;
|
||||
int index;
|
||||
ULONG_PTR* pKeys = NULL;
|
||||
PROGRESSIVE_SURFACE_CONTEXT* surface;
|
||||
|
||||
if (!progressive)
|
||||
return;
|
||||
|
||||
@ -2817,21 +2816,7 @@ void progressive_context_free(PROGRESSIVE_CONTEXT* progressive)
|
||||
rfx_context_free(progressive->rfx_context);
|
||||
|
||||
BufferPool_Free(progressive->bufferPool);
|
||||
|
||||
if (progressive->SurfaceContexts)
|
||||
{
|
||||
count = HashTable_GetKeys(progressive->SurfaceContexts, &pKeys);
|
||||
|
||||
for (index = 0; index < count; index++)
|
||||
{
|
||||
surface = (PROGRESSIVE_SURFACE_CONTEXT*)HashTable_GetItemValue(
|
||||
progressive->SurfaceContexts, (void*)pKeys[index]);
|
||||
progressive_surface_context_free(surface);
|
||||
}
|
||||
|
||||
free(pKeys);
|
||||
HashTable_Free(progressive->SurfaceContexts);
|
||||
}
|
||||
HashTable_Free(progressive->SurfaceContexts);
|
||||
|
||||
free(progressive);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user