summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-05-12 09:20:50 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2020-05-12 16:10:02 +0200
commit71dcddd6486956382d2606c3e8e75a2e745d2433 (patch)
treedff9f07f84d1607a2847a1ef513002ae3b161891
parent235ba0e407ae1e14684da5d0d66641564d755ae2 (diff)
evas/filter: resolve float compare warnings
Summary: Depends on D11793 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11794
-rw-r--r--src/lib/evas/filters/evas_filter.c6
-rw-r--r--src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c9
-rw-r--r--src/modules/evas/engines/software_generic/filters/evas_filter_blur.c16
3 files changed, 17 insertions, 14 deletions
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index a35ad8131f..912e8c6882 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -821,7 +821,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
821 } 821 }
822#endif 822#endif
823 823
824 if (dx && dy) 824 if (EINA_DBL_NONZERO(dx) && EINA_DBL_NONZERO(dy))
825 { 825 {
826 tmp = evas_filter_temporary_buffer_get(ctx, dx_in->w, dx_in->h, in->alpha_only, 1); 826 tmp = evas_filter_temporary_buffer_get(ctx, dx_in->w, dx_in->h, in->alpha_only, 1);
827 if (!tmp) goto fail; 827 if (!tmp) goto fail;
@@ -833,7 +833,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx,
833 dy_in = in; 833 dy_in = in;
834 } 834 }
835 835
836 if (dx) 836 if (EINA_DBL_NONZERO(dx))
837 { 837 {
838 XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dx_in->id, dx_out->id, dx, 0.0); 838 XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dx_in->id, dx_out->id, dx, 0.0);
839 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dx_in, NULL, dx_out); 839 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,
844 cmd->draw.alphaonly = alphaonly; 844 cmd->draw.alphaonly = alphaonly;
845 } 845 }
846 846
847 if (dy) 847 if (EINA_DBL_NONZERO(dy))
848 { 848 {
849 XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dy_in->id, dy_out->id, 0.0, dy); 849 XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dy_in->id, dy_out->id, 0.0, dy);
850 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dy_in, NULL, dy_out); 850 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dy_in, NULL, dy_out);
diff --git a/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c b/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c
index 21b78198e1..875d1baaf1 100644
--- a/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c
+++ b/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c
@@ -145,7 +145,10 @@ _gl_filter_blur(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd)
145 s_h = cmd->input->h; 145 s_h = cmd->input->h;
146 d_w = cmd->output->w; 146 d_w = cmd->output->w;
147 d_h = cmd->output->h; 147 d_h = cmd->output->h;
148 EINA_SAFETY_ON_FALSE_RETURN_VAL(s_w && s_h && d_w && d_h, EINA_FALSE); 148 EINA_SAFETY_ON_FALSE_RETURN_VAL(
149 EINA_DBL_NONZERO(s_w) && EINA_DBL_NONZERO(s_h) && EINA_DBL_NONZERO(d_w) && EINA_DBL_NONZERO(d_h),
150 EINA_FALSE
151 );
149 152
150 gc = gl_generic_context_find(re, 1); 153 gc = gl_generic_context_find(re, 1);
151 154
@@ -157,7 +160,7 @@ _gl_filter_blur(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd)
157 160
158 evas_gl_common_context_target_surface_set(gc, surface); 161 evas_gl_common_context_target_surface_set(gc, surface);
159 162
160 if (cmd->blur.dx) 163 if (EINA_DBL_NONZERO(cmd->blur.dx))
161 { 164 {
162 horiz = EINA_TRUE; 165 horiz = EINA_TRUE;
163 radius = cmd->blur.dx; 166 radius = cmd->blur.dx;
@@ -274,7 +277,7 @@ gl_filter_blur_func_get(Render_Engine_GL_Generic *re EINA_UNUSED, Evas_Filter_Co
274 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, NULL); 277 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, NULL);
275 278
276 // 1D blurs only, radius != 0 279 // 1D blurs only, radius != 0
277 EINA_SAFETY_ON_FALSE_RETURN_VAL((!cmd->blur.dx) ^ (!cmd->blur.dy), NULL); 280 EINA_SAFETY_ON_FALSE_RETURN_VAL(!EINA_DBL_EQ(cmd->blur.dx, 0) ^ !EINA_DBL_EQ(cmd->blur.dy, 0), NULL);
278 281
279 return _gl_filter_blur; 282 return _gl_filter_blur;
280} 283}
diff --git a/src/modules/evas/engines/software_generic/filters/evas_filter_blur.c b/src/modules/evas/engines/software_generic/filters/evas_filter_blur.c
index 89d20e2ba6..c5617d0096 100644
--- a/src/modules/evas/engines/software_generic/filters/evas_filter_blur.c
+++ b/src/modules/evas/engines/software_generic/filters/evas_filter_blur.c
@@ -469,32 +469,32 @@ eng_filter_blur_func_get(Evas_Filter_Command *cmd)
469 case EVAS_FILTER_BLUR_BOX: 469 case EVAS_FILTER_BLUR_BOX:
470 if (!cmd->output->alpha_only) 470 if (!cmd->output->alpha_only)
471 { 471 {
472 if (cmd->blur.dx) 472 if (EINA_DBL_NONZERO(cmd->blur.dx))
473 return _box_blur_horiz_apply_rgba; 473 return _box_blur_horiz_apply_rgba;
474 else if (cmd->blur.dy) 474 else if (EINA_DBL_NONZERO(cmd->blur.dy))
475 return _box_blur_vert_apply_rgba; 475 return _box_blur_vert_apply_rgba;
476 } 476 }
477 else 477 else
478 { 478 {
479 if (cmd->blur.dx) 479 if (EINA_DBL_NONZERO(cmd->blur.dx))
480 return _box_blur_horiz_apply_alpha; 480 return _box_blur_horiz_apply_alpha;
481 else if (cmd->blur.dy) 481 else if (EINA_DBL_NONZERO(cmd->blur.dy))
482 return _box_blur_vert_apply_alpha; 482 return _box_blur_vert_apply_alpha;
483 } 483 }
484 break; 484 break;
485 case EVAS_FILTER_BLUR_GAUSSIAN: 485 case EVAS_FILTER_BLUR_GAUSSIAN:
486 if (!cmd->output->alpha_only) 486 if (!cmd->output->alpha_only)
487 { 487 {
488 if (cmd->blur.dx) 488 if (EINA_DBL_NONZERO(cmd->blur.dx))
489 return _gaussian_blur_horiz_apply_rgba; 489 return _gaussian_blur_horiz_apply_rgba;
490 else if (cmd->blur.dy) 490 else if (EINA_DBL_NONZERO(cmd->blur.dy))
491 return _gaussian_blur_vert_apply_rgba; 491 return _gaussian_blur_vert_apply_rgba;
492 } 492 }
493 else 493 else
494 { 494 {
495 if (cmd->blur.dx) 495 if (EINA_DBL_NONZERO(cmd->blur.dx))
496 return _gaussian_blur_horiz_apply_alpha; 496 return _gaussian_blur_horiz_apply_alpha;
497 else if (cmd->blur.dy) 497 else if (EINA_DBL_NONZERO(cmd->blur.dy))
498 return _gaussian_blur_vert_apply_alpha; 498 return _gaussian_blur_vert_apply_alpha;
499 } 499 }
500 break; 500 break;