summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-01-11 21:18:59 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-01-17 14:21:13 +0900
commit3f24b6ea2f9709fc8b77cc9d2b4580edb60f14fe (patch)
tree817da8c1d415d9a8fc1aa5ed4dfb6ff4fd3182b2 /src
parent4550b4cf832b256d6bca49a5e536c2327bbd5e8c (diff)
evas: Use eina_slstr to simplify render debug
Only enabled if REND_DBG is manually enabled inside evas_render.c
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_render.c95
1 files changed, 48 insertions, 47 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 252f0b6350..ba360ebdd5 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -21,6 +21,25 @@ static FILE *dbf = NULL;
21static int __RD_level = 0; 21static int __RD_level = 0;
22static int __RD_enable = REND_DBG; 22static int __RD_enable = REND_DBG;
23 23
24static inline Eina_Slstr *
25_efl_object_name(const Evas_Object_Protected_Data *obj)
26{
27 const Eo *eo_obj;
28 const char *name;
29 const char *klass;
30
31 if (!obj) return "(nil)";
32 eo_obj = obj->object;
33 name = obj->name ?: efl_name_get(eo_obj);
34 klass = obj->type; //efl_class_name_get(eo_obj);
35 if (name)
36 return eina_slstr_printf("[%p@%p: %s '%s']", eo_obj, obj, klass, name);
37 else
38 return eina_slstr_printf("[%p@%p: %s]", eo_obj, obj, klass);
39}
40
41#define RDNAME(_obj) _efl_object_name(_obj)
42
24static void 43static void
25rend_dbg(const char *txt) 44rend_dbg(const char *txt)
26{ 45{
@@ -423,9 +442,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
423 eina_array_data_get(render_objects, i); 442 eina_array_data_get(render_objects, i);
424 eo_obj = obj->object; 443 eo_obj = obj->object;
425 444
426 RD(0, " OBJ [%p", obj); 445 RD(0, " OBJ %s changed %i\n", RDNAME(obj), obj->changed);
427 IFRD(obj->name, 0, " '%s'", obj->name);
428 RD(0, "] changed %i\n", obj->changed);
429 446
430 if (obj->changed) 447 if (obj->changed)
431 { 448 {
@@ -1043,9 +1060,9 @@ _evas_render_phase1_object_process(Phase1_Context *p1ctx,
1043 obj->is_active = is_active; 1060 obj->is_active = is_active;
1044 1061
1045#ifdef REND_DBG 1062#ifdef REND_DBG
1046 RD(level, "[--- PROCESS [%p", obj->object); 1063 RD(level, "[--- PROCESS %s active = %i, del = %i | %i,%i %ix%i\n",
1047 IFRD(obj->name, 0, " '%s'", obj->name); 1064 RDNAME(obj), is_active, obj->delete_me, obj->cur->geometry.x,
1048 RD(0, "] '%s' active = %i, del = %i | %i %i %ix%i\n", obj->type, is_active, obj->delete_me, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h); 1065 obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
1049#endif 1066#endif
1050 1067
1051 if ((!mapped_parent) && 1068 if ((!mapped_parent) &&
@@ -1075,9 +1092,9 @@ _evas_render_phase1_object_process(Phase1_Context *p1ctx,
1075#ifdef REND_DBG 1092#ifdef REND_DBG
1076 if (!is_active) 1093 if (!is_active)
1077 { 1094 {
1078 RD(level, "[%p", obj->object); 1095 RD(level, "%s vis: %i, cache.clip.vis: %i cache.clip.a: %i [func: %p]\n",
1079 IFRD(obj->name, 0, " '%s'", obj->name); 1096 RDNAME(obj), obj->cur->visible, obj->cur->cache.clip.visible,
1080 RD(0, "] vis: %i, cache.clip.vis: %i cache.clip.a: %i [%p]\n", obj->cur->visible, obj->cur->cache.clip.visible, obj->cur->cache.clip.a, obj->func->is_visible); 1097 obj->cur->cache.clip.a, obj->func->is_visible);
1081 } 1098 }
1082#endif 1099#endif
1083 1100
@@ -1280,9 +1297,7 @@ pending_change(void *data, void *gdata EINA_UNUSED)
1280 if (obj->delete_me) return EINA_FALSE; 1297 if (obj->delete_me) return EINA_FALSE;
1281 if (obj->pre_render_done) 1298 if (obj->pre_render_done)
1282 { 1299 {
1283 RD(0, " OBJ [%p", obj); 1300 RD(0, " OBJ %s pending change %i -> 0, pre %i\n", RDNAME(obj), obj->changed, obj->pre_render_done);
1284 IFRD(obj->name, 0, " '%s'", obj->name);
1285 RD(0, "] pending change %i -> 0, pre %i\n", obj->changed, obj->pre_render_done);
1286 obj->func->render_post(eo_obj, obj, obj->private_data); 1301 obj->func->render_post(eo_obj, obj, obj->private_data);
1287 obj->pre_render_done = EINA_FALSE; 1302 obj->pre_render_done = EINA_FALSE;
1288 evas_object_change_reset(eo_obj); 1303 evas_object_change_reset(eo_obj);
@@ -1696,21 +1711,15 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
1696 eina_evlog("+render_object", eo_obj, 0.0, NULL); 1711 eina_evlog("+render_object", eo_obj, 0.0, NULL);
1697#ifdef REND_DBG 1712#ifdef REND_DBG
1698 RD(level, "{\n"); 1713 RD(level, "{\n");
1699 RD(level, " evas_render_mapped(evas:%p, obj:%p", evas->evas, obj->object); 1714 RD(level, " evas_render_mapped(evas:%p, obj:%s, ctx:%p, sfc:%p, offset:%i,%i, %s, %s)\n",
1700 IFRD(obj->name, 0, " '%s'", obj->name); 1715 evas->evas, RDNAME(obj), context, surface, off_x, off_y,
1701 RD(0, ", ctx:%p, sfc:%p, offset:%i,%i, %s, %s)\n", context, surface, off_x, off_y,
1702 mapped ? "mapped" : "normal", do_async ? "async" : "sync"); 1716 mapped ? "mapped" : "normal", do_async ? "async" : "sync");
1703 RD(level, " obj: '%s' %s", obj->type, obj->is_smart ? "(smart) " : ""); 1717 IFRD(obj->is_smart, level, " is_smart");
1704 if (obj->is_frame) RD(0, "(frame) "); 1718 IFRD(obj->is_frame, level, " in framespace%s", obj->is_frame_top ? " (top object)" : "");
1705 if (obj->name) RD(0, "'%s'\n", obj->name);
1706 else RD(0, "\n");
1707 if (obj->cur->clipper) 1719 if (obj->cur->clipper)
1708 { 1720 {
1709 RD(level, " clipper: '%s'%s%s %p (mask: %p) %d,%d %dx%d ; color: {%d,%d,%d,%d} ; cached: {%d,%d,%d,%d}\n", 1721 RD(level, " clipper: %s (mask: %s) %d,%d %dx%d ; color: {%d,%d,%d,%d} ; cached: {%d,%d,%d,%d}\n",
1710 obj->cur->clipper->type, 1722 RDNAME(obj->cur->clipper), RDNAME(obj->clip.mask),
1711 obj->cur->clipper->name ? ":" : "",
1712 obj->cur->clipper->name ? obj->cur->clipper->name : "",
1713 obj->cur->clipper->object, obj->clip.mask ? obj->clip.mask->object : NULL,
1714 obj->cur->clipper->cur->geometry.x, obj->cur->clipper->cur->geometry.y, 1723 obj->cur->clipper->cur->geometry.x, obj->cur->clipper->cur->geometry.y,
1715 obj->cur->clipper->cur->geometry.w, obj->cur->clipper->cur->geometry.h, 1724 obj->cur->clipper->cur->geometry.w, obj->cur->clipper->cur->geometry.h,
1716 obj->cur->clipper->cur->color.r, obj->cur->clipper->cur->color.g, 1725 obj->cur->clipper->cur->color.r, obj->cur->clipper->cur->color.g,
@@ -2000,9 +2009,8 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
2000 Evas_Object_Protected_Data *prev_mask = obj->clip.prev_mask; 2009 Evas_Object_Protected_Data *prev_mask = obj->clip.prev_mask;
2001 Eina_Bool redraw = mask->mask->redraw || !mask->mask->surface; 2010 Eina_Bool redraw = mask->mask->redraw || !mask->mask->surface;
2002 2011
2003 RD(level, " has mask: [%p%s%s] redraw:%d sfc:%p prev_mask:%p\n", 2012 RD(level, " has mask: %s redraw:%d sfc:%p prev_mask:%p\n",
2004 mask->object, mask->name?":":"", mask->name?mask->name:"", 2013 RDNAME(mask), mask->mask->redraw, mask->mask->surface, prev_mask);
2005 mask->mask->redraw, mask->mask->surface, prev_mask);
2006 if (prev_mask && !_mask_apply_inside_proxy(proxy_render_data, prev_mask)) 2014 if (prev_mask && !_mask_apply_inside_proxy(proxy_render_data, prev_mask))
2007 { 2015 {
2008 RD(level, " discard prev mask and redraw (guessed outside proxy)\n"); 2016 RD(level, " discard prev mask and redraw (guessed outside proxy)\n");
@@ -2065,9 +2073,8 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
2065 Evas_Object_Protected_Data *prev_mask = obj->clip.prev_mask; 2073 Evas_Object_Protected_Data *prev_mask = obj->clip.prev_mask;
2066 Eina_Bool redraw = mask->mask->redraw || !mask->mask->surface; 2074 Eina_Bool redraw = mask->mask->redraw || !mask->mask->surface;
2067 2075
2068 RD(level, " has mask: [%p%s%s] redraw:%d sfc:%p prev_mask:%p\n", 2076 RD(level, " has mask: %s redraw:%d sfc:%p prev_mask:%p\n",
2069 mask->object, mask->name?":":"", mask->name?mask->name:"", 2077 RDNAME(mask), mask->mask->redraw, mask->mask->surface, prev_mask);
2070 mask->mask->redraw, mask->mask->surface, prev_mask);
2071 if (prev_mask && !_mask_apply_inside_proxy(proxy_render_data, prev_mask)) 2078 if (prev_mask && !_mask_apply_inside_proxy(proxy_render_data, prev_mask))
2072 { 2079 {
2073 RD(level, " discard prev mask and redraw (guessed outside proxy)\n"); 2080 RD(level, " discard prev mask and redraw (guessed outside proxy)\n");
@@ -2158,9 +2165,8 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj,
2158 Evas_Object_Protected_Data *prev_mask = obj->clip.prev_mask; 2165 Evas_Object_Protected_Data *prev_mask = obj->clip.prev_mask;
2159 Eina_Bool redraw = mask->mask->redraw || !mask->mask->surface; 2166 Eina_Bool redraw = mask->mask->redraw || !mask->mask->surface;
2160 2167
2161 RD(level, " has mask: [%p%s%s] redraw:%d sfc:%p prev_mask:%p\n", 2168 RD(level, " has mask: %s redraw:%d sfc:%p prev_mask:%p\n",
2162 mask->object, mask->name?":":"", mask->name?mask->name:"", 2169 RDNAME(mask), mask->mask->redraw, mask->mask->surface, prev_mask);
2163 mask->mask->redraw, mask->mask->surface, prev_mask);
2164 if (prev_mask && !_mask_apply_inside_proxy(proxy_render_data, prev_mask)) 2170 if (prev_mask && !_mask_apply_inside_proxy(proxy_render_data, prev_mask))
2165 { 2171 {
2166 RD(level, " discard prev mask and redraw (guessed outside proxy)\n"); 2172 RD(level, " discard prev mask and redraw (guessed outside proxy)\n");
@@ -2282,7 +2288,8 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
2282 w = source->cur->geometry.w; 2288 w = source->cur->geometry.w;
2283 h = source->cur->geometry.h; 2289 h = source->cur->geometry.h;
2284 2290
2285 RD(level, " proxy_subrender(source: %p, proxy: %p, %dx%d)\n", source, proxy_obj, w, h); 2291 RD(level, " proxy_subrender(source: %s, proxy: %s, %dx%d)\n",
2292 RDNAME(source), RDNAME(proxy_obj), w, h);
2286 2293
2287 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, source->proxy, 2294 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, source->proxy,
2288 Evas_Object_Proxy_Data, proxy_write) 2295 Evas_Object_Proxy_Data, proxy_write)
@@ -2366,8 +2373,8 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
2366 if (!mask) return; 2373 if (!mask) return;
2367 2374
2368 eina_evlog("+mask_subrender", mask->object, 0.0, NULL); 2375 eina_evlog("+mask_subrender", mask->object, 0.0, NULL);
2369 RD(level, "evas_render_mask_subrender(%p, prev: %p, %s)\n", 2376 RD(level, "evas_render_mask_subrender(mask: %s, prev: %s, %s)\n",
2370 mask, prev_mask, do_async ? "async" : "sync"); 2377 RDNAME(mask), RDNAME(prev_mask), do_async ? "async" : "sync");
2371 2378
2372 is_image = efl_isa(mask->object, EFL_CANVAS_IMAGE_INTERNAL_CLASS); 2379 is_image = efl_isa(mask->object, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
2373 2380
@@ -2787,9 +2794,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *evas,
2787 if (obj == top) break; 2794 if (obj == top) break;
2788 2795
2789 /* if it's in our outpout rect and it doesn't clip anything */ 2796 /* if it's in our outpout rect and it doesn't clip anything */
2790 RD(level, " OBJ: [%p", eo_obj); 2797 RD(level, " OBJ: %s %i %i %ix%i\n", RDNAME(obj), obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
2791 IFRD(obj->name, 0, " '%s'", obj->name);
2792 RD(level, "] '%s' %i %i %ix%i\n", obj->type, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
2793 if ( 2798 if (
2794 (!obj->clip.clipees) && 2799 (!obj->clip.clipees) &&
2795 (obj->cur->visible) && 2800 (obj->cur->visible) &&
@@ -2901,7 +2906,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *evas,
2901 OBJS_ARRAY_CLEAN(&evas->temporary_objects); 2906 OBJS_ARRAY_CLEAN(&evas->temporary_objects);
2902 2907
2903#ifdef REND_DBG 2908#ifdef REND_DBG
2904 if (top) RD(level, " ---] SNAPSHOT [obj:%p sfc:%p]\n", top, surface); 2909 if (top) RD(level, " ---] SNAPSHOT [obj:%s sfc:%p]\n", RDNAME(top), surface);
2905 else RD(level, " ---]\n"); 2910 else RD(level, " ---]\n");
2906#endif 2911#endif
2907 2912
@@ -3180,7 +3185,7 @@ evas_render_updates_internal(Evas *eo_e,
3180 3185
3181 pseudo_canvas = _evas_object_image_surface_get(obj->object, obj); 3186 pseudo_canvas = _evas_object_image_surface_get(obj->object, obj);
3182 3187
3183 RD(0, " SNAPSHOT [obj:%p sfc:%p ur:%d,%d %dx%d]\n", obj, pseudo_canvas, ur.x, ur.y, ur.w, ur.h); 3188 RD(0, " SNAPSHOT %s [sfc:%p ur:%d,%d %dx%d]\n", RDNAME(obj), pseudo_canvas, ur.x, ur.y, ur.w, ur.h);
3184 ctx = ENFN->context_new(ENDT); 3189 ctx = ENFN->context_new(ENDT);
3185 clean_them |= evas_render_updates_internal_loop(eo_e, e, pseudo_canvas, ctx, 3190 clean_them |= evas_render_updates_internal_loop(eo_e, e, pseudo_canvas, ctx,
3186 obj, 3191 obj,
@@ -3280,14 +3285,10 @@ evas_render_updates_internal(Evas *eo_e,
3280 obj = ent->obj; 3285 obj = ent->obj;
3281 eo_obj = obj->object; 3286 eo_obj = obj->object;
3282 obj->pre_render_done = EINA_FALSE; 3287 obj->pre_render_done = EINA_FALSE;
3283 RD(0, " OBJ [%p", obj); 3288 RD(0, " OBJ %s changed:%i do_draw:%i\n", RDNAME(obj), obj->changed, do_draw);
3284 IFRD(obj->name, 0, " '%s'", obj->name);
3285 RD(0, "] changed:%i do_draw:%i (%s)\n", obj->changed, do_draw, obj->type);
3286 if ((clean_them) || (obj->changed && do_draw)) 3289 if ((clean_them) || (obj->changed && do_draw))
3287 { 3290 {
3288 RD(0, " OBJ [%p", obj); 3291 RD(0, " OBJ %s render_post()\n", RDNAME(obj));
3289 IFRD(obj->name, 0, " '%s'", obj->name);
3290 RD(0, "] render_post()\n");
3291 obj->func->render_post(eo_obj, obj, obj->private_data); 3292 obj->func->render_post(eo_obj, obj, obj->private_data);
3292 obj->restack = EINA_FALSE; 3293 obj->restack = EINA_FALSE;
3293 evas_object_change_reset(eo_obj); 3294 evas_object_change_reset(eo_obj);