forked from old/legacy-imlib2
GIF loader: Reduce progress checks from per-pixel to per-row.
Patch by Yuriy M. Kaminskiy.
This commit is contained in:
parent
bfa12b68fe
commit
1efd421614
|
@ -164,12 +164,13 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
|
||||||
goto quit;
|
goto quit;
|
||||||
|
|
||||||
ptr = im->data;
|
ptr = im->data;
|
||||||
per_inc = 100.0 / (((float)w) * h);
|
per_inc = 100.0 / (float)h;
|
||||||
for (i = 0; i < h; i++)
|
for (i = 0; i < h; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < w; j++)
|
for (j = 0; j < w; j++)
|
||||||
{
|
{
|
||||||
*ptr++ = colormap[rows[i][j]];
|
*ptr++ = colormap[rows[i][j]];
|
||||||
|
}
|
||||||
per += per_inc;
|
per += per_inc;
|
||||||
if (progress && (((int)per) != last_per)
|
if (progress && (((int)per) != last_per)
|
||||||
&& (((int)per) % progress_granularity == 0))
|
&& (((int)per) % progress_granularity == 0))
|
||||||
|
@ -182,7 +183,6 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
|
||||||
}
|
}
|
||||||
last_y = i;
|
last_y = i;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
|
|
Loading…
Reference in New Issue