Small optimization
This commit is contained in:
parent
6b5a652d5c
commit
97b9992aa4
1 changed files with 4 additions and 3 deletions
|
@ -212,6 +212,7 @@ static inline Color _getFinalPixel(RenderArea* area, int x, int y)
|
||||||
{
|
{
|
||||||
Color result, col;
|
Color result, col;
|
||||||
int sx, sy;
|
int sx, sy;
|
||||||
|
double factor = 1.0 / (double)(area->params.antialias * area->params.antialias);
|
||||||
RenderFragment* pixel_data;
|
RenderFragment* pixel_data;
|
||||||
|
|
||||||
result.r = result.g = result.b = 0.0;
|
result.r = result.g = result.b = 0.0;
|
||||||
|
@ -238,9 +239,9 @@ static inline Color _getFinalPixel(RenderArea* area, int x, int y)
|
||||||
col.g = pixel_data->data.color.g;
|
col.g = pixel_data->data.color.g;
|
||||||
col.b = pixel_data->data.color.b;
|
col.b = pixel_data->data.color.b;
|
||||||
}
|
}
|
||||||
result.r += col.r / (double)(area->params.antialias * area->params.antialias);
|
result.r += col.r * factor;
|
||||||
result.g += col.g / (double)(area->params.antialias * area->params.antialias);
|
result.g += col.g * factor;
|
||||||
result.b += col.b / (double)(area->params.antialias * area->params.antialias);
|
result.b += col.b * factor;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue