forked from enlightenment/efl
evas/filter: resolve float compare warnings
Summary: Depends on D11793 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11794
This commit is contained in:
parent
235ba0e407
commit
71dcddd648
|
@ -821,7 +821,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (dx && dy)
|
if (EINA_DBL_NONZERO(dx) && EINA_DBL_NONZERO(dy))
|
||||||
{
|
{
|
||||||
tmp = evas_filter_temporary_buffer_get(ctx, dx_in->w, dx_in->h, in->alpha_only, 1);
|
tmp = evas_filter_temporary_buffer_get(ctx, dx_in->w, dx_in->h, in->alpha_only, 1);
|
||||||
if (!tmp) goto fail;
|
if (!tmp) goto fail;
|
||||||
|
@ -833,7 +833,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
|
||||||
dy_in = in;
|
dy_in = in;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dx)
|
if (EINA_DBL_NONZERO(dx))
|
||||||
{
|
{
|
||||||
XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dx_in->id, dx_out->id, dx, 0.0);
|
XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dx_in->id, dx_out->id, dx, 0.0);
|
||||||
cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dx_in, NULL, dx_out);
|
cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dx_in, NULL, dx_out);
|
||||||
|
@ -844,7 +844,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
|
||||||
cmd->draw.alphaonly = alphaonly;
|
cmd->draw.alphaonly = alphaonly;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dy)
|
if (EINA_DBL_NONZERO(dy))
|
||||||
{
|
{
|
||||||
XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dy_in->id, dy_out->id, 0.0, dy);
|
XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dy_in->id, dy_out->id, 0.0, dy);
|
||||||
cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dy_in, NULL, dy_out);
|
cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dy_in, NULL, dy_out);
|
||||||
|
|
|
@ -145,7 +145,10 @@ _gl_filter_blur(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd)
|
||||||
s_h = cmd->input->h;
|
s_h = cmd->input->h;
|
||||||
d_w = cmd->output->w;
|
d_w = cmd->output->w;
|
||||||
d_h = cmd->output->h;
|
d_h = cmd->output->h;
|
||||||
EINA_SAFETY_ON_FALSE_RETURN_VAL(s_w && s_h && d_w && d_h, EINA_FALSE);
|
EINA_SAFETY_ON_FALSE_RETURN_VAL(
|
||||||
|
EINA_DBL_NONZERO(s_w) && EINA_DBL_NONZERO(s_h) && EINA_DBL_NONZERO(d_w) && EINA_DBL_NONZERO(d_h),
|
||||||
|
EINA_FALSE
|
||||||
|
);
|
||||||
|
|
||||||
gc = gl_generic_context_find(re, 1);
|
gc = gl_generic_context_find(re, 1);
|
||||||
|
|
||||||
|
@ -157,7 +160,7 @@ _gl_filter_blur(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd)
|
||||||
|
|
||||||
evas_gl_common_context_target_surface_set(gc, surface);
|
evas_gl_common_context_target_surface_set(gc, surface);
|
||||||
|
|
||||||
if (cmd->blur.dx)
|
if (EINA_DBL_NONZERO(cmd->blur.dx))
|
||||||
{
|
{
|
||||||
horiz = EINA_TRUE;
|
horiz = EINA_TRUE;
|
||||||
radius = cmd->blur.dx;
|
radius = cmd->blur.dx;
|
||||||
|
@ -274,7 +277,7 @@ gl_filter_blur_func_get(Render_Engine_GL_Generic *re EINA_UNUSED, Evas_Filter_Co
|
||||||
EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, NULL);
|
EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, NULL);
|
||||||
|
|
||||||
// 1D blurs only, radius != 0
|
// 1D blurs only, radius != 0
|
||||||
EINA_SAFETY_ON_FALSE_RETURN_VAL((!cmd->blur.dx) ^ (!cmd->blur.dy), NULL);
|
EINA_SAFETY_ON_FALSE_RETURN_VAL(!EINA_DBL_EQ(cmd->blur.dx, 0) ^ !EINA_DBL_EQ(cmd->blur.dy, 0), NULL);
|
||||||
|
|
||||||
return _gl_filter_blur;
|
return _gl_filter_blur;
|
||||||
}
|
}
|
||||||
|
|
|
@ -469,32 +469,32 @@ eng_filter_blur_func_get(Evas_Filter_Command *cmd)
|
||||||
case EVAS_FILTER_BLUR_BOX:
|
case EVAS_FILTER_BLUR_BOX:
|
||||||
if (!cmd->output->alpha_only)
|
if (!cmd->output->alpha_only)
|
||||||
{
|
{
|
||||||
if (cmd->blur.dx)
|
if (EINA_DBL_NONZERO(cmd->blur.dx))
|
||||||
return _box_blur_horiz_apply_rgba;
|
return _box_blur_horiz_apply_rgba;
|
||||||
else if (cmd->blur.dy)
|
else if (EINA_DBL_NONZERO(cmd->blur.dy))
|
||||||
return _box_blur_vert_apply_rgba;
|
return _box_blur_vert_apply_rgba;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cmd->blur.dx)
|
if (EINA_DBL_NONZERO(cmd->blur.dx))
|
||||||
return _box_blur_horiz_apply_alpha;
|
return _box_blur_horiz_apply_alpha;
|
||||||
else if (cmd->blur.dy)
|
else if (EINA_DBL_NONZERO(cmd->blur.dy))
|
||||||
return _box_blur_vert_apply_alpha;
|
return _box_blur_vert_apply_alpha;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVAS_FILTER_BLUR_GAUSSIAN:
|
case EVAS_FILTER_BLUR_GAUSSIAN:
|
||||||
if (!cmd->output->alpha_only)
|
if (!cmd->output->alpha_only)
|
||||||
{
|
{
|
||||||
if (cmd->blur.dx)
|
if (EINA_DBL_NONZERO(cmd->blur.dx))
|
||||||
return _gaussian_blur_horiz_apply_rgba;
|
return _gaussian_blur_horiz_apply_rgba;
|
||||||
else if (cmd->blur.dy)
|
else if (EINA_DBL_NONZERO(cmd->blur.dy))
|
||||||
return _gaussian_blur_vert_apply_rgba;
|
return _gaussian_blur_vert_apply_rgba;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (cmd->blur.dx)
|
if (EINA_DBL_NONZERO(cmd->blur.dx))
|
||||||
return _gaussian_blur_horiz_apply_alpha;
|
return _gaussian_blur_horiz_apply_alpha;
|
||||||
else if (cmd->blur.dy)
|
else if (EINA_DBL_NONZERO(cmd->blur.dy))
|
||||||
return _gaussian_blur_vert_apply_alpha;
|
return _gaussian_blur_vert_apply_alpha;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue