sw_engine: fix build warning

warning: absolute value function 'fabsf' given an argument of type 'double' but has parameter of type 'float' which may cause truncation of value [-Wabsolute-value]
This commit is contained in:
Hermet Park 2020-09-15 12:29:54 +09:00 committed by Hermet Park
parent c407d4d13d
commit ac90ea302d

View file

@ -151,7 +151,7 @@ bool _prepareRadial(SwFill* fill, const RadialGradient* radial, const Matrix* tr
//FIXME; Scale + Rotation is not working properly
radius *= sx;
if (fabsf(sx - sy) > FLT_EPSILON) {
if (abs(sx - sy) > FLT_EPSILON) {
fill->sx = sx;
fill->sy = sy;
}
@ -240,7 +240,7 @@ void fillFetchLinear(const SwFill* fill, uint32_t* dst, uint32_t y, uint32_t x,
float t = (fill->linear.dx * rx + fill->linear.dy * ry + fill->linear.offset) * (GRADIENT_STOP_SIZE - 1);
float inc = (fill->linear.dx) * (GRADIENT_STOP_SIZE - 1);
if (fabsf(inc) < FLT_EPSILON) {
if (abs(inc) < FLT_EPSILON) {
auto color = _fixedPixel(fill, static_cast<int32_t>(t * FIXPT_SIZE));
rasterRGBA32(dst, color, offset, len);
return;