summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-06-09 21:29:13 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-25 14:36:08 +0900
commit4882788527c037a70ca7344d370c891e53d88e61 (patch)
tree9e958299c7c336aa38647ae66a5e2796e279b46a /src
parentf3e16bc4854268cecc19a38671c6f68071b7955b (diff)
Evas filters: Reduce debugging with default compile opts
When using debug compile flags, full-on filter debug will happen.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/filters/evas_filter.c59
-rw-r--r--src/lib/evas/filters/evas_filter_blend.c26
-rw-r--r--src/lib/evas/filters/evas_filter_blur.c4
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c17
-rw-r--r--src/lib/evas/filters/evas_filter_private.h14
5 files changed, 67 insertions, 53 deletions
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index d420929..dc022a3 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -72,9 +72,6 @@ evas_filter_context_new(Evas_Public_Data *evas, Eina_Bool async)
72 * better and implement filters direcly with shaders. 72 * better and implement filters direcly with shaders.
73 */ 73 */
74 ctx->gl_engine = (evas->engine.func->gl_surface_read_pixels != NULL); 74 ctx->gl_engine = (evas->engine.func->gl_surface_read_pixels != NULL);
75 if (ctx->gl_engine)
76 DBG("Detected GL engine. All filters will still run in software (SLOW).");
77
78 return ctx; 75 return ctx;
79} 76}
80 77
@@ -211,7 +208,7 @@ evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj,
211 _assert(fb->h == source->cur->geometry.h); 208 _assert(fb->h == source->cur->geometry.h);
212 if (source->proxy->surface && !source->proxy->redraw) 209 if (source->proxy->surface && !source->proxy->redraw)
213 { 210 {
214 DBG("Source already rendered: '%s' of type '%s'", 211 XDBG("Source already rendered: '%s' of type '%s'",
215 fb->source_name, eo_class_name_get(eo_class_get(fb->source))); 212 fb->source_name, eo_class_name_get(eo_class_get(fb->source)));
216 _filter_buffer_backing_free(fb); 213 _filter_buffer_backing_free(fb);
217 if (!ctx->gl_engine) 214 if (!ctx->gl_engine)
@@ -229,7 +226,7 @@ evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj,
229 } 226 }
230 else 227 else
231 { 228 {
232 DBG("Source needs to be rendered: '%s' of type '%s' (%s)", 229 XDBG("Source needs to be rendered: '%s' of type '%s' (%s)",
233 fb->source_name, eo_class_name_get(eo_class_get(fb->source)), 230 fb->source_name, eo_class_name_get(eo_class_get(fb->source)),
234 source->proxy->redraw ? "redraw" : "no surface"); 231 source->proxy->redraw ? "redraw" : "no surface");
235 evas_render_proxy_subrender(ctx->evas->evas, fb->source, eo_obj, obj, do_async); 232 evas_render_proxy_subrender(ctx->evas->evas, fb->source, eo_obj, obj, do_async);
@@ -247,7 +244,7 @@ evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj,
247 } 244 }
248 fb->alpha_only = EINA_FALSE; 245 fb->alpha_only = EINA_FALSE;
249 } 246 }
250 DBG("Source has dimensions %dx%d (buffer %d)", fb->w, fb->h, fb->id); 247 XDBG("Source has dimensions %dx%d (buffer %d)", fb->w, fb->h, fb->id);
251 } 248 }
252} 249}
253 250
@@ -366,7 +363,7 @@ evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx)
366 w = ctx->w; 363 w = ctx->w;
367 h = ctx->h; 364 h = ctx->h;
368 365
369 //DBG("Allocating all buffers based on output size %ux%u", w, h); 366 XDBG("Allocating all buffers based on output size %ux%u", w, h);
370 367
371 EINA_INLIST_FOREACH(ctx->commands, cmd) 368 EINA_INLIST_FOREACH(ctx->commands, cmd)
372 { 369 {
@@ -409,7 +406,7 @@ evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx)
409 if (fillmode & EVAS_FILTER_FILL_MODE_STRETCH_Y) 406 if (fillmode & EVAS_FILTER_FILL_MODE_STRETCH_Y)
410 sh = h; 407 sh = h;
411 408
412 //DBG("Allocating temporary buffer of size %ux%u %s", sw, sh, in->alpha_only ? "alpha" : "rgba"); 409 XDBG("Allocating temporary buffer of size %ux%u %s", sw, sh, in->alpha_only ? "alpha" : "rgba");
413 fb = evas_filter_buffer_alloc_new(ctx, sw, sh, in->alpha_only); 410 fb = evas_filter_buffer_alloc_new(ctx, sw, sh, in->alpha_only);
414 if (!fb) goto alloc_fail; 411 if (!fb) goto alloc_fail;
415 fb->transient = EINA_TRUE; 412 fb->transient = EINA_TRUE;
@@ -424,7 +421,7 @@ evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx)
424 if (in->w) sw = in->w; 421 if (in->w) sw = in->w;
425 if (in->h) sh = in->h; 422 if (in->h) sh = in->h;
426 423
427 //DBG("Allocating temporary buffer of size %ux%u %s", sw, sh, in->alpha_only ? "alpha" : "rgba"); 424 XDBG("Allocating temporary buffer of size %ux%u %s", sw, sh, in->alpha_only ? "alpha" : "rgba");
428 fb = evas_filter_buffer_alloc_new(ctx, sw, sh, in->alpha_only); 425 fb = evas_filter_buffer_alloc_new(ctx, sw, sh, in->alpha_only);
429 if (!fb) goto alloc_fail; 426 if (!fb) goto alloc_fail;
430 fb->transient = EINA_TRUE; 427 fb->transient = EINA_TRUE;
@@ -464,7 +461,7 @@ evas_filter_context_buffers_allocate_all(Evas_Filter_Context *ctx)
464 continue; 461 continue;
465 } 462 }
466 463
467 //DBG("Allocating buffer of size %ux%u %s", fb->w, fb->h, fb->alpha_only ? "alpha" : "rgba"); 464 XDBG("Allocating buffer of size %ux%u %s", fb->w, fb->h, fb->alpha_only ? "alpha" : "rgba");
468 im = _rgba_image_alloc(fb, NULL); 465 im = _rgba_image_alloc(fb, NULL);
469 if (!im) goto alloc_fail; 466 if (!im) goto alloc_fail;
470 467
@@ -493,7 +490,7 @@ evas_filter_buffer_empty_new(Evas_Filter_Context *ctx, Eina_Bool alpha_only)
493 490
494 fb->transient = EINA_FALSE; 491 fb->transient = EINA_FALSE;
495 492
496 DBG("Created context buffer %d", fb->id); 493 XDBG("Created context buffer %d", fb->id);
497 return fb->id; 494 return fb->id;
498} 495}
499 496
@@ -827,7 +824,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
827 if (dy < 0) dy = 0; 824 if (dy < 0) dy = 0;
828 if (!dx && !dy) 825 if (!dx && !dy)
829 { 826 {
830 DBG("Changing 0px blur into simple blend"); 827 XDBG("Changing 0px blur into simple blend");
831 return evas_filter_command_blend_add(ctx, drawctx, inbuf, outbuf, ox, oy, EVAS_FILTER_FILL_MODE_NONE); 828 return evas_filter_command_blend_add(ctx, drawctx, inbuf, outbuf, ox, oy, EVAS_FILTER_FILL_MODE_NONE);
832 } 829 }
833 830
@@ -943,7 +940,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
943 else if ((blend || (in->alpha_only && !out->alpha_only)) || 940 else if ((blend || (in->alpha_only && !out->alpha_only)) ||
944 (!blend && !in->alpha_only && !out->alpha_only && (color != 0xFFFFFFFF))) 941 (!blend && !in->alpha_only && !out->alpha_only && (color != 0xFFFFFFFF)))
945 { 942 {
946 DBG("Adding extra blending step %d --> %d (%s --> %s)", in->id, out->id, 943 XDBG("Adding extra blending step %d --> %d (%s --> %s)", in->id, out->id,
947 in->alpha_only ? "Alpha" : "RGBA", 944 in->alpha_only ? "Alpha" : "RGBA",
948 out->alpha_only ? "Alpha" : "RGBA"); 945 out->alpha_only ? "Alpha" : "RGBA");
949 Eina_Bool wasl = in->locked; 946 Eina_Bool wasl = in->locked;
@@ -1022,7 +1019,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
1022 1019
1023 if (dx) 1020 if (dx)
1024 { 1021 {
1025 DBG("Add horizontal blur %d -> %d (%dpx)", in->id, out_dx->id, dx); 1022 XDBG("Add horizontal blur %d -> %d (%dpx)", in->id, out_dx->id, dx);
1026 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, in, NULL, out_dx); 1023 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, in, NULL, out_dx);
1027 if (!cmd) goto fail; 1024 if (!cmd) goto fail;
1028 cmd->blur.type = type; 1025 cmd->blur.type = type;
@@ -1036,7 +1033,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
1036 1033
1037 if (dy) 1034 if (dy)
1038 { 1035 {
1039 DBG("Add vertical blur %d -> %d (%dpx)", in_dy->id, out_dy->id, dy); 1036 XDBG("Add vertical blur %d -> %d (%dpx)", in_dy->id, out_dy->id, dy);
1040 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, in_dy, NULL, out_dy); 1037 cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, in_dy, NULL, out_dy);
1041 if (!cmd) goto fail; 1038 if (!cmd) goto fail;
1042 cmd->blur.type = type; 1039 cmd->blur.type = type;
@@ -1053,7 +1050,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
1053 int render_op; 1050 int render_op;
1054 1051
1055 if (!cmd) goto fail; 1052 if (!cmd) goto fail;
1056 DBG("Add copy %d -> %d", copybuf->id, blur_out->id); 1053 XDBG("Add copy %d -> %d", copybuf->id, blur_out->id);
1057 cmd->ENFN->context_color_set(cmd->ENDT, drawctx, 255, 255, 255, 255); 1054 cmd->ENFN->context_color_set(cmd->ENDT, drawctx, 255, 255, 255, 255);
1058 render_op = cmd->ENFN->context_render_op_get(cmd->ENDT, drawctx); 1055 render_op = cmd->ENFN->context_render_op_get(cmd->ENDT, drawctx);
1059 cmd->ENFN->context_render_op_set(cmd->ENDT, drawctx, EVAS_RENDER_COPY); 1056 cmd->ENFN->context_render_op_set(cmd->ENDT, drawctx, EVAS_RENDER_COPY);
@@ -1066,7 +1063,7 @@ evas_filter_command_blur_add(Evas_Filter_Context *ctx, void *drawctx,
1066 1063
1067 if (blend) 1064 if (blend)
1068 { 1065 {
1069 DBG("Add blend %d (%s) -> %d (%s)", 1066 XDBG("Add blend %d (%s) -> %d (%s)",
1070 blur_out->id, blur_out->alpha_only ? "Alpha" : "RGBA", 1067 blur_out->id, blur_out->alpha_only ? "Alpha" : "RGBA",
1071 out->id, out->alpha_only ? "Alpha" : "RGBA"); 1068 out->id, out->alpha_only ? "Alpha" : "RGBA");
1072 id = evas_filter_command_blend_add(ctx, drawctx, blur_out->id, out->id, ox, oy, EVAS_FILTER_FILL_MODE_NONE); 1069 id = evas_filter_command_blend_add(ctx, drawctx, blur_out->id, out->id, ox, oy, EVAS_FILTER_FILL_MODE_NONE);
@@ -1096,7 +1093,7 @@ evas_filter_command_blend_add(Evas_Filter_Context *ctx, void *drawctx,
1096 1093
1097 if (inbuf == outbuf) 1094 if (inbuf == outbuf)
1098 { 1095 {
1099 DBG("Skipping NOP blend operation %d --> %d", inbuf, outbuf); 1096 XDBG("Skipping NOP blend operation %d --> %d", inbuf, outbuf);
1100 return -1; 1097 return -1;
1101 } 1098 }
1102 1099
@@ -1129,7 +1126,7 @@ evas_filter_command_blend_add(Evas_Filter_Context *ctx, void *drawctx,
1129 &cmd->draw.clip.w, &cmd->draw.clip.h); 1126 &cmd->draw.clip.w, &cmd->draw.clip.h);
1130 1127
1131 if (cmd->draw.clip_use) 1128 if (cmd->draw.clip_use)
1132 DBG("Draw clip: %d,%d,%d,%d", cmd->draw.clip.x, cmd->draw.clip.y, 1129 XDBG("Draw clip: %d,%d,%d,%d", cmd->draw.clip.x, cmd->draw.clip.y,
1133 cmd->draw.clip.w, cmd->draw.clip.h); 1130 cmd->draw.clip.w, cmd->draw.clip.h);
1134 1131
1135 out->dirty = EINA_TRUE; 1132 out->dirty = EINA_TRUE;
@@ -1149,7 +1146,7 @@ evas_filter_command_grow_add(Evas_Filter_Context *ctx, void *draw_context,
1149 1146
1150 if (!radius) 1147 if (!radius)
1151 { 1148 {
1152 DBG("Changing 0px grow into simple blend"); 1149 XDBG("Changing 0px grow into simple blend");
1153 return evas_filter_command_blend_add(ctx, draw_context, inbuf, outbuf, 0, 0, EVAS_FILTER_FILL_MODE_NONE); 1150 return evas_filter_command_blend_add(ctx, draw_context, inbuf, outbuf, 0, 0, EVAS_FILTER_FILL_MODE_NONE);
1154 } 1151 }
1155 1152
@@ -1573,7 +1570,7 @@ evas_filter_target_set(Evas_Filter_Context *ctx, void *draw_context,
1573 (ENDT, fb->w, fb->h, fb->backing->image.data, EINA_TRUE, 1570 (ENDT, fb->w, fb->h, fb->backing->image.data, EINA_TRUE,
1574 fb->backing->cache_entry.space); 1571 fb->backing->cache_entry.space);
1575 1572
1576 DBG("Set target as #%d (%p) and output #%d (%p, gl %p)", 1573 XDBG("Set target as #%d (%p) and output #%d (%p, gl %p)",
1577 ctx->target.bufid, surface, fb->id, fb->backing, fb->glimage); 1574 ctx->target.bufid, surface, fb->id, fb->backing, fb->glimage);
1578 } 1575 }
1579 1576
@@ -1607,7 +1604,7 @@ _filter_target_render(Evas_Filter_Context *ctx)
1607 surface = dst->glimage; 1604 surface = dst->glimage;
1608 if (src->glimage) 1605 if (src->glimage)
1609 { 1606 {
1610 DBG("Using glimage from output buffer."); 1607 XDBG("Using glimage from output buffer.");
1611 if (src->backing) 1608 if (src->backing)
1612 ENFN->image_data_put(ENDT, src->glimage, src->backing->image.data); 1609 ENFN->image_data_put(ENDT, src->glimage, src->backing->image.data);
1613 } 1610 }
@@ -1615,7 +1612,7 @@ _filter_target_render(Evas_Filter_Context *ctx)
1615 { 1612 {
1616 RGBA_Image *im = src->backing; 1613 RGBA_Image *im = src->backing;
1617 1614
1618 DBG("Creating glimage from output buffer."); 1615 XDBG("Creating glimage from output buffer.");
1619 src->glimage = ENFN->image_new_from_data(ENDT, src->w, src->h, 1616 src->glimage = ENFN->image_new_from_data(ENDT, src->w, src->h,
1620 im->image.data, EINA_TRUE, 1617 im->image.data, EINA_TRUE,
1621 EVAS_COLORSPACE_ARGB8888); 1618 EVAS_COLORSPACE_ARGB8888);
@@ -1824,6 +1821,7 @@ _clip_to_target(int *sx /* OUT */, int *sy /* OUT */, int sw, int sh,
1824 } 1821 }
1825} 1822}
1826 1823
1824#ifdef FILTERS_DEBUG
1827static const char * 1825static const char *
1828_filter_name_get(int mode) 1826_filter_name_get(int mode)
1829{ 1827{
@@ -1841,6 +1839,7 @@ _filter_name_get(int mode)
1841 } 1839 }
1842#undef FNAME 1840#undef FNAME
1843} 1841}
1842#endif
1844 1843
1845static Eina_Bool 1844static Eina_Bool
1846_filter_command_run(Evas_Filter_Command *cmd) 1845_filter_command_run(Evas_Filter_Command *cmd)
@@ -1850,14 +1849,16 @@ _filter_command_run(Evas_Filter_Command *cmd)
1850 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->output, EINA_FALSE); 1849 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->output, EINA_FALSE);
1851 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, EINA_FALSE); 1850 EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, EINA_FALSE);
1852 1851
1853 DBG("Command %d (%s): %d [%d] --> %d", 1852#ifdef FILTERS_DEBUG
1853 XDBG("Command %d (%s): %d [%d] --> %d",
1854 cmd->id, _filter_name_get(cmd->mode), 1854 cmd->id, _filter_name_get(cmd->mode),
1855 cmd->input->id, cmd->mask ? cmd->mask->id : 0, cmd->output->id); 1855 cmd->input->id, cmd->mask ? cmd->mask->id : 0, cmd->output->id);
1856#endif
1856 1857
1857 if (!cmd->input->w && !cmd->input->h 1858 if (!cmd->input->w && !cmd->input->h
1858 && (cmd->mode != EVAS_FILTER_MODE_FILL)) 1859 && (cmd->mode != EVAS_FILTER_MODE_FILL))
1859 { 1860 {
1860 DBG("Skipping processing of empty input buffer (size 0x0)"); 1861 XDBG("Skipping processing of empty input buffer (size 0x0)");
1861 return EINA_TRUE; 1862 return EINA_TRUE;
1862 } 1863 }
1863 1864
@@ -1962,6 +1963,7 @@ _filter_thread_run_cb(void *data)
1962Eina_Bool 1963Eina_Bool
1963evas_filter_run(Evas_Filter_Context *ctx) 1964evas_filter_run(Evas_Filter_Context *ctx)
1964{ 1965{
1966 static int warned = 0;
1965 Eina_Bool ret; 1967 Eina_Bool ret;
1966 1968
1967 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE); 1969 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE);
@@ -1969,8 +1971,11 @@ evas_filter_run(Evas_Filter_Context *ctx)
1969 if (!ctx->commands) 1971 if (!ctx->commands)
1970 return EINA_TRUE; 1972 return EINA_TRUE;
1971 1973
1972 if (ctx->gl_engine) 1974 if (ctx->gl_engine && !warned)
1973 INF("EXPERIMENTAL OpenGL support! The text filters will be very slow!"); 1975 {
1976 DBG("OpenGL support through SW functions, expect low performance!");
1977 warned = 1;
1978 }
1974 1979
1975 if (ctx->async) 1980 if (ctx->async)
1976 { 1981 {
diff --git a/src/lib/evas/filters/evas_filter_blend.c b/src/lib/evas/filters/evas_filter_blend.c
index e12ed64..17be2bc 100644
--- a/src/lib/evas/filters/evas_filter_blend.c
+++ b/src/lib/evas/filters/evas_filter_blend.c
@@ -323,17 +323,18 @@ _mapped_blend(void *data, void *drawctx,
323 int right = 0, bottom = 0, left = 0, top = 0; 323 int right = 0, bottom = 0, left = 0, top = 0;
324 int row, col, rows, cols; 324 int row, col, rows, cols;
325 Eina_Bool ret = EINA_TRUE; 325 Eina_Bool ret = EINA_TRUE;
326 Eina_Bool debug = eina_log_domain_level_check(_evas_filter_log_dom, 6);
326 327
327 EINA_SAFETY_ON_FALSE_RETURN_VAL((sx == 0) && (sy == 0), EINA_FALSE); 328 EINA_SAFETY_ON_FALSE_RETURN_VAL((sx == 0) && (sy == 0), EINA_FALSE);
328 329
329 if (fillmode == EVAS_FILTER_FILL_MODE_NONE) 330 if (fillmode == EVAS_FILTER_FILL_MODE_NONE)
330 { 331 {
331 _clip_to_target(&sx, &sy, sw, sh, dx, dy, dw, dh, &dx, &dy, &rows, &cols); 332 _clip_to_target(&sx, &sy, sw, sh, dx, dy, dw, dh, &dx, &dy, &rows, &cols);
332 /* 333 if (debug)
333 DBG("blend: %d,%d,%d,%d --> %d,%d,%d,%d (from %dx%d to %dx%d +%d,%d)", 334 {
334 0, 0, sw, sh, dx, dy, cols, rows, sw, sh, dw, dh, dx, dy); 335 XDBG("blend: %d,%d,%d,%d --> %d,%d,%d,%d (from %dx%d to %dx%d +%d,%d)",
335 */ 336 0, 0, sw, sh, dx, dy, cols, rows, sw, sh, dw, dh, dx, dy);
336 337 }
337 image_draw(data, drawctx, out, in, 338 image_draw(data, drawctx, out, in,
338 sx, sy, cols, rows, // src 339 sx, sy, cols, rows, // src
339 dx, dy, cols, rows, // dst 340 dx, dy, cols, rows, // dst
@@ -467,13 +468,14 @@ _mapped_blend(void *data, void *drawctx,
467 } 468 }
468 if (src_w <= 0 || dst_w <= 0) break; 469 if (src_w <= 0 || dst_w <= 0) break;
469 470
470 /* 471 if (debug)
471 DBG("blend: [%d,%d] %d,%d,%dx%d --> %d,%d,%dx%d " 472 {
472 "(src %dx%d, dst %dx%d)", 473 XDBG("blend: [%d,%d] %d,%d,%dx%d --> %d,%d,%dx%d "
473 col, row, src_x, src_y, src_w, src_h, 474 "(src %dx%d, dst %dx%d)",
474 dst_x, dst_y, dst_w, dst_h, 475 col, row, src_x, src_y, src_w, src_h,
475 sw, sh, dw, dh); 476 dst_x, dst_y, dst_w, dst_h,
476 */ 477 sw, sh, dw, dh);
478 }
477 image_draw(data, drawctx, out, in, 479 image_draw(data, drawctx, out, in,
478 src_x, src_y, src_w, src_h, 480 src_x, src_y, src_w, src_h,
479 dst_x, dst_y, dst_w, dst_h, 481 dst_x, dst_y, dst_w, dst_h,
diff --git a/src/lib/evas/filters/evas_filter_blur.c b/src/lib/evas/filters/evas_filter_blur.c
index 06fb31e..4c375a7 100644
--- a/src/lib/evas/filters/evas_filter_blur.c
+++ b/src/lib/evas/filters/evas_filter_blur.c
@@ -19,7 +19,7 @@ _box_blur_auto_radius(int *radii, int r)
19 radii[0] = r / 2; 19 radii[0] = r / 2;
20 radii[1] = r - radii[0] - 1; 20 radii[1] = r - radii[0] - 1;
21 radii[2] = 0; 21 radii[2] = 0;
22 DBG("Using auto radius for %d: %d %d", r, radii[0], radii[1]); 22 XDBG("Using auto radius for %d: %d %d", r, radii[0], radii[1]);
23 return 2; 23 return 2;
24 } 24 }
25 else 25 else
@@ -28,7 +28,7 @@ _box_blur_auto_radius(int *radii, int r)
28 radii[1] = (r + 2) / 3; 28 radii[1] = (r + 2) / 3;
29 radii[2] = r - radii[0] - radii[1]; 29 radii[2] = r - radii[0] - radii[1];
30 radii[3] = 0; 30 radii[3] = 0;
31 DBG("Using auto radius for %d: %d %d %d", r, radii[0], radii[1], radii[2]); 31 XDBG("Using auto radius for %d: %d %d %d", r, radii[0], radii[1], radii[2]);
32 return 3; 32 return 3;
33 } 33 }
34} 34}
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 8992dcb..7bf812b 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -10,10 +10,6 @@
10# define LUA52 1 10# define LUA52 1
11#endif 11#endif
12 12
13#ifdef DEBUG
14# define FILTERS_DEBUG
15#endif
16
17#define FILTERS_LEGACY_COMPAT 13#define FILTERS_LEGACY_COMPAT
18 14
19#define EVAS_FILTER_MODE_GROW (EVAS_FILTER_MODE_LAST+1) 15#define EVAS_FILTER_MODE_GROW (EVAS_FILTER_MODE_LAST+1)
@@ -1753,7 +1749,7 @@ _padding_set_padding_update(Evas_Filter_Program *pgm,
1753 b = _instruction_param_geti(instr, "b", &bset); 1749 b = _instruction_param_geti(instr, "b", &bset);
1754 1750
1755 if (!lset && !rset && !bset && !tset) 1751 if (!lset && !rset && !bset && !tset)
1756 DBG("padding_set() called without specifying any of l,r,t,b resets to 0"); 1752 INF("padding_set() called without specifying any of l,r,t,b resets to 0");
1757 1753
1758 if (l < 0 || r < 0 || t < 0 || b < 0) 1754 if (l < 0 || r < 0 || t < 0 || b < 0)
1759 { 1755 {
@@ -2141,7 +2137,7 @@ _lua_print(lua_State *L)
2141 2137
2142 if (nargs < 1) 2138 if (nargs < 1)
2143 { 2139 {
2144 DBG("LUA: (nothing)"); 2140 INF("(nothing)");
2145 return 0; 2141 return 0;
2146 } 2142 }
2147 2143
@@ -2160,7 +2156,7 @@ _lua_print(lua_State *L)
2160 eina_strbuf_append_char(s, ' '); 2156 eina_strbuf_append_char(s, ' ');
2161 } 2157 }
2162 2158
2163 INF("LUA: %s", eina_strbuf_string_get(s)); 2159 INF("%s", eina_strbuf_string_get(s));
2164 eina_strbuf_free(s); 2160 eina_strbuf_free(s);
2165 2161
2166 return 0; 2162 return 0;
@@ -2250,11 +2246,12 @@ _lua_import_class(lua_State *L, const char *name, char **code)
2250 f = eina_file_open(path, EINA_FALSE); 2246 f = eina_file_open(path, EINA_FALSE);
2251 if (!f) return EINA_FALSE; 2247 if (!f) return EINA_FALSE;
2252 sz = eina_file_size_get(f); 2248 sz = eina_file_size_get(f);
2253 *code = malloc(sz); 2249 *code = malloc(sz + 1);
2254 if (!*code) return EINA_FALSE; 2250 if (!*code) return EINA_FALSE;
2255 map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); 2251 map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
2256 if (!map) return EINA_FALSE; 2252 if (!map) return EINA_FALSE;
2257 memcpy(*code, map, sz); 2253 memcpy(*code, map, sz);
2254 (*code)[sz] = '\0';
2258 eina_file_map_free(f, map); 2255 eina_file_map_free(f, map);
2259 eina_file_close(f); 2256 eina_file_close(f);
2260 } 2257 }
@@ -3388,7 +3385,7 @@ _instruction_dump(Evas_Filter_Instruction *instr)
3388 comma = ", "; 3385 comma = ", ";
3389 } 3386 }
3390 eina_strbuf_append(str, "})"); 3387 eina_strbuf_append(str, "})");
3391 DBG("%s", eina_strbuf_string_get(str)); 3388 XDBG("%s", eina_strbuf_string_get(str));
3392 eina_strbuf_free(str); 3389 eina_strbuf_free(str);
3393} 3390}
3394#else 3391#else
@@ -3408,7 +3405,7 @@ evas_filter_context_program_use(Evas_Filter_Context *ctx,
3408 EINA_SAFETY_ON_NULL_RETURN_VAL(pgm, EINA_FALSE); 3405 EINA_SAFETY_ON_NULL_RETURN_VAL(pgm, EINA_FALSE);
3409 EINA_SAFETY_ON_FALSE_RETURN_VAL(pgm->valid, EINA_FALSE); 3406 EINA_SAFETY_ON_FALSE_RETURN_VAL(pgm->valid, EINA_FALSE);
3410 3407
3411 DBG("Using program '%s' for context %p", pgm->name, ctx); 3408 XDBG("Using program '%s' for context %p", pgm->name, ctx);
3412 3409
3413 // Copy current state (size, edje state val, color class, etc...) 3410 // Copy current state (size, edje state val, color class, etc...)
3414 ctx->w = pgm->state.w; 3411 ctx->w = pgm->state.w;
diff --git a/src/lib/evas/filters/evas_filter_private.h b/src/lib/evas/filters/evas_filter_private.h
index 7a4ba85..683e35a 100644
--- a/src/lib/evas/filters/evas_filter_private.h
+++ b/src/lib/evas/filters/evas_filter_private.h
@@ -8,6 +8,10 @@
8extern int _evas_filter_log_dom; 8extern int _evas_filter_log_dom;
9#define EVAS_FILTER_LOG_COLOR EINA_COLOR_LIGHTBLUE 9#define EVAS_FILTER_LOG_COLOR EINA_COLOR_LIGHTBLUE
10 10
11#ifdef DEBUG
12# define FILTERS_DEBUG
13#endif
14
11#ifdef ERR 15#ifdef ERR
12# undef ERR 16# undef ERR
13#endif 17#endif
@@ -29,6 +33,12 @@ extern int _evas_filter_log_dom;
29#endif 33#endif
30#define DBG(...) EINA_LOG_DOM_DBG(_evas_filter_log_dom, __VA_ARGS__) 34#define DBG(...) EINA_LOG_DOM_DBG(_evas_filter_log_dom, __VA_ARGS__)
31 35
36#ifdef FILTERS_DEBUG
37# define XDBG(...) DBG(__VA_ARGS__)
38#else
39# define XDBG(...) do {} while (0)
40#endif
41
32// This is a potential optimization. 42// This is a potential optimization.
33#define DIV_USING_BITSHIFT 1 43#define DIV_USING_BITSHIFT 1
34 44
@@ -82,8 +92,8 @@ extern int _evas_filter_log_dom;
82# define DEBUG_TIME_END() \ 92# define DEBUG_TIME_END() \
83 clock_gettime(CLOCK_MONOTONIC, &ts2); \ 93 clock_gettime(CLOCK_MONOTONIC, &ts2); \
84 long long int t = 1000000LL * (ts2.tv_sec - ts1.tv_sec) \ 94 long long int t = 1000000LL * (ts2.tv_sec - ts1.tv_sec) \
85 + (ts2.tv_nsec - ts1.tv_nsec) / 1000LL; \ 95 + (ts2.tv_nsec - ts1.tv_nsec) / 1000LL; (void) t; \
86 INF("TIME SPENT: %lldus", t); 96 XDBG("TIME SPENT: %lldus", t);
87#else 97#else
88# define DEBUG_TIME_BEGIN() do {} while(0) 98# define DEBUG_TIME_BEGIN() do {} while(0)
89# define DEBUG_TIME_END() do {} while(0) 99# define DEBUG_TIME_END() do {} while(0)