GIF loader: Reduce progress checks from per-pixel to per-row.

Patch by Yuriy M. Kaminskiy.
This commit is contained in:
Kim Woelders 2016-04-03 19:43:38 +02:00
parent bfa12b68fe
commit 1efd421614
1 changed files with 2 additions and 2 deletions

View File

@ -164,12 +164,13 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
goto quit;
ptr = im->data;
per_inc = 100.0 / (((float)w) * h);
per_inc = 100.0 / (float)h;
for (i = 0; i < h; i++)
{
for (j = 0; j < w; j++)
{
*ptr++ = colormap[rows[i][j]];
}
per += per_inc;
if (progress && (((int)per) != last_per)
&& (((int)per) % progress_granularity == 0))
@ -182,7 +183,6 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
}
last_y = i;
}
}
}
finish: