evas - png loader - work around libpng arm bug where rgb > a on decode

on arm when a is 0 ... per pixel rgb can be > 0 which violates premul
rgb leading to junk rendering. this now is worked around in the png
loader and forces rgb to 0 when a is 0 per pixel.

@fix
This commit is contained in:
Carsten Haitzler 2022-05-04 18:12:24 +01:00
parent 9490cf857b
commit 7743b17dba
1 changed files with 22 additions and 0 deletions

View File

@ -596,6 +596,17 @@ evas_image_load_file_head_with_data_png(void *loader_data,
}
free(pixels2);
if ((epi.hasa) && (pack_offset == sizeof(DATA32)))
{
DATA32 *dst_ptr = (DATA32 *) surface;
int total = w * h;
for (i = 0; i < total; i++)
{
if (A_VAL(dst_ptr) == 0) *dst_ptr = 0;
dst_ptr++;
}
}
prop->info.premul = EINA_TRUE;
*error = EVAS_LOAD_ERROR_NONE;
@ -882,6 +893,17 @@ evas_image_load_file_data_png(void *loader_data,
}
}
if ((epi.hasa) && (pack_offset == sizeof(DATA32)))
{
DATA32 *dst_ptr = (DATA32 *) surface;
int total = w * h;
for (i = 0; i < total; i++)
{
if (A_VAL(dst_ptr) == 0) *dst_ptr = 0;
dst_ptr++;
}
}
prop->info.premul = EINA_TRUE;
*error = EVAS_LOAD_ERROR_NONE;