summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-09-01 20:47:40 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-09-04 11:11:39 +0900
commitbcbf7d14e66b7438a7756198d2d6a84c9df672b5 (patch)
treed6cc0e74aefd15086fdb903786c7a45c6f36f7b0
parentd69f9e0b84f0e3827fbee328fc4a6a46e499faf6 (diff)
evas_render: moar debug (REND_DBG)
-rw-r--r--src/lib/evas/canvas/evas_render.c44
1 files changed, 35 insertions, 9 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index faa56c5..371c8f4 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -20,6 +20,7 @@
20 20
21#ifdef REND_DBG 21#ifdef REND_DBG
22static FILE *dbf = NULL; 22static FILE *dbf = NULL;
23static int __RD_level = 0;
23 24
24static void 25static void
25rend_dbg(const char *txt) 26rend_dbg(const char *txt)
@@ -39,6 +40,7 @@ rend_dbg(const char *txt)
39#define RD(xxxx, args...) \ 40#define RD(xxxx, args...) \
40 do { \ 41 do { \
41 char __tmpbuf[4096]; int __tmpi; \ 42 char __tmpbuf[4096]; int __tmpi; \
43 __RD_level = xxxx; \
42 if (xxxx) { \ 44 if (xxxx) { \
43 for (__tmpi = 0; __tmpi < xxxx * 2; __tmpi++) \ 45 for (__tmpi = 0; __tmpi < xxxx * 2; __tmpi++) \
44 __tmpbuf[__tmpi] = ' '; \ 46 __tmpbuf[__tmpi] = ' '; \
@@ -51,6 +53,7 @@ rend_dbg(const char *txt)
51#define IFRD(ifcase, xxxx, args...) \ 53#define IFRD(ifcase, xxxx, args...) \
52 if (ifcase) { \ 54 if (ifcase) { \
53 char __tmpbuf[4096]; int __tmpi; \ 55 char __tmpbuf[4096]; int __tmpi; \
56 __RD_level = xxxx; \
54 if (xxxx) { \ 57 if (xxxx) { \
55 for (__tmpi = 0; __tmpi < xxxx * 2; __tmpi++) \ 58 for (__tmpi = 0; __tmpi < xxxx * 2; __tmpi++) \
56 __tmpbuf[__tmpi] = ' '; \ 59 __tmpbuf[__tmpi] = ' '; \
@@ -1273,7 +1276,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1273 RD(0, ", ctx:%p, sfc:%p, offset:%i,%i, %s, use_mapped_ctx:%d, %s)\n", context, surface, off_x, off_y, 1276 RD(0, ", ctx:%p, sfc:%p, offset:%i,%i, %s, use_mapped_ctx:%d, %s)\n", context, surface, off_x, off_y,
1274 mapped ? "mapped" : "normal", use_mapped_ctx, do_async ? "async" : "sync"); 1277 mapped ? "mapped" : "normal", use_mapped_ctx, do_async ? "async" : "sync");
1275 RD(level, " obj: '%s' %s", obj->type, obj->is_smart ? "(smart) " : ""); 1278 RD(level, " obj: '%s' %s", obj->type, obj->is_smart ? "(smart) " : "");
1276 if (obj->name) RD(0, " '%s'\n", obj->name); 1279 if (obj->name) RD(0, "'%s'\n", obj->name);
1277 else RD(0, "\n"); 1280 else RD(0, "\n");
1278 if (obj->cur->clipper) 1281 if (obj->cur->clipper)
1279 { 1282 {
@@ -1285,6 +1288,10 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1285 obj->cur->clipper->cur->geometry.x, obj->cur->clipper->cur->geometry.y, 1288 obj->cur->clipper->cur->geometry.x, obj->cur->clipper->cur->geometry.y,
1286 obj->cur->clipper->cur->geometry.w, obj->cur->clipper->cur->geometry.h); 1289 obj->cur->clipper->cur->geometry.w, obj->cur->clipper->cur->geometry.h);
1287 } 1290 }
1291
1292 RD(level, " geom: %d,%d %dx%d, cache.clip: (vis: %d) %d,%d %dx%d\n",
1293 obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h,
1294 obj->cur->cache.clip.visible, obj->cur->cache.clip.x, obj->cur->cache.clip.y, obj->cur->cache.clip.w, obj->cur->cache.clip.h);
1288#endif 1295#endif
1289 1296
1290 if (mapped) 1297 if (mapped)
@@ -1294,6 +1301,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1294 RD(level, " is mask: redraw:%d sfc:%p\n", obj->mask->redraw, obj->mask->surface); 1301 RD(level, " is mask: redraw:%d sfc:%p\n", obj->mask->redraw, obj->mask->surface);
1295 if (!use_mapped_ctx || (surface != obj->mask->surface)) 1302 if (!use_mapped_ctx || (surface != obj->mask->surface))
1296 { 1303 {
1304 RD(level, " not rendering mask surface\n");
1297 RD(level, "}\n"); 1305 RD(level, "}\n");
1298 return clean_them; 1306 return clean_them;
1299 } 1307 }
@@ -1304,6 +1312,9 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1304 if ((!evas_object_is_visible(eo_obj, obj)) || (obj->clip.clipees) 1312 if ((!evas_object_is_visible(eo_obj, obj)) || (obj->clip.clipees)
1305 || (obj->cur->have_clipees) || (obj->no_render)) 1313 || (obj->cur->have_clipees) || (obj->no_render))
1306 { 1314 {
1315 IFRD(obj->no_render, level, " proxy_src_clip + no_render\n");
1316 IFRD(obj->clip.clipees || obj->cur->have_clipees, level, " proxy_src_clip + has clippees\n");
1317 IFRD(!evas_object_is_visible(eo_obj, obj), level, " not visible\n");
1307 RD(level, "}\n"); 1318 RD(level, "}\n");
1308 return clean_them; 1319 return clean_them;
1309 } 1320 }
@@ -1311,12 +1322,15 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1311 else if (!evas_object_is_proxy_visible(eo_obj, obj) || 1322 else if (!evas_object_is_proxy_visible(eo_obj, obj) ||
1312 (obj->clip.clipees) || (obj->cur->have_clipees)) 1323 (obj->clip.clipees) || (obj->cur->have_clipees))
1313 { 1324 {
1325 IFRD(!evas_object_is_proxy_visible(eo_obj, obj), level, " proxy not visible\n");
1326 IFRD(obj->clip.clipees || obj->cur->have_clipees, level, " has clippees\n");
1314 RD(level, "}\n"); 1327 RD(level, "}\n");
1315 return clean_them; 1328 return clean_them;
1316 } 1329 }
1317 else if (obj->no_render && (!use_mapped_ctx || (surface != obj->proxy->surface))) 1330 else if (obj->no_render && (!use_mapped_ctx || (surface != obj->proxy->surface)))
1318 { 1331 {
1319 RD(level, " no render\n}\n"); 1332 RD(level, " no_render\n");
1333 RD(level, "}\n");
1320 return clean_them; 1334 return clean_them;
1321 } 1335 }
1322 } 1336 }
@@ -1324,6 +1338,9 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1324 (_evas_render_can_render(eo_obj, obj)))) 1338 (_evas_render_can_render(eo_obj, obj))))
1325 )) 1339 ))
1326 { 1340 {
1341 IFRD(!evas_object_is_active(eo_obj, obj), level, " not active\n");
1342 IFRD(!_evas_render_can_render(eo_obj, obj), level, " can't render\n");
1343 IFRD(obj->clip.clipees, level, " has clippees\n");
1327 RD(level, "}\n"); 1344 RD(level, "}\n");
1328 return clean_them; 1345 return clean_them;
1329 } 1346 }
@@ -1581,8 +1598,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1581 1598
1582 if (mapped) 1599 if (mapped)
1583 { 1600 {
1584 RD(level, " draw child of mapped obj: '%s'%s\n", 1601 RD(level, " draw child of mapped obj\n");
1585 obj->type, obj->is_smart ? " (smart)" : "");
1586 1602
1587 if (use_mapped_ctx) 1603 if (use_mapped_ctx)
1588 ctx = context; 1604 ctx = context;
@@ -1684,6 +1700,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1684 } 1700 }
1685 } 1701 }
1686 } 1702 }
1703 RD(level, " render()\n");
1687 obj->func->render(eo_obj, obj, obj->private_data, 1704 obj->func->render(eo_obj, obj, obj->private_data,
1688 e->engine.data.output, ctx, 1705 e->engine.data.output, ctx,
1689 surface, off_x, off_y, EINA_FALSE); 1706 surface, off_x, off_y, EINA_FALSE);
@@ -1729,7 +1746,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1729 ecx, ecy, ecw, ech); 1746 ecx, ecy, ecw, ech);
1730 } 1747 }
1731 1748
1732 RD(level, " draw normal obj\n"); 1749 RD(level, " draw normal obj: render()\n");
1733 obj->func->render(eo_obj, obj, obj->private_data, 1750 obj->func->render(eo_obj, obj, obj->private_data,
1734 e->engine.data.output, context, surface, 1751 e->engine.data.output, context, surface,
1735 off_x, off_y, do_async); 1752 off_x, off_y, do_async);
@@ -1754,15 +1771,22 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
1754 Evas_Public_Data *evas = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS); 1771 Evas_Public_Data *evas = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
1755 Evas_Object_Protected_Data *source; 1772 Evas_Object_Protected_Data *source;
1756 Eina_Bool source_clip = EINA_FALSE; 1773 Eina_Bool source_clip = EINA_FALSE;
1774 int level = 1;
1757 void *ctx; 1775 void *ctx;
1758 int w, h; 1776 int w, h;
1759 1777
1778#ifdef REND_DBG
1779 level = __RD_level;
1780#endif
1781
1760 if (!eo_source) return; 1782 if (!eo_source) return;
1761 source = eo_data_scope_get(eo_source, EVAS_OBJECT_CLASS); 1783 source = eo_data_scope_get(eo_source, EVAS_OBJECT_CLASS);
1762 1784
1763 w = source->cur->geometry.w; 1785 w = source->cur->geometry.w;
1764 h = source->cur->geometry.h; 1786 h = source->cur->geometry.h;
1765 1787
1788 RD(level, " proxy_subrender(source: %p, proxy: %p)\n", source, proxy_obj);
1789
1766 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, source->proxy, 1790 EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, source->proxy,
1767 Evas_Object_Proxy_Data, proxy_write) 1791 Evas_Object_Proxy_Data, proxy_write)
1768 { 1792 {
@@ -1772,6 +1796,7 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
1772 if ((proxy_write->surface) && 1796 if ((proxy_write->surface) &&
1773 ((proxy_write->w != w) || (proxy_write->h != h))) 1797 ((proxy_write->w != w) || (proxy_write->h != h)))
1774 { 1798 {
1799 RD(level, " free surface: %p\n", proxy_write->surface);
1775 ENFN->image_free(ENDT, proxy_write->surface); 1800 ENFN->image_free(ENDT, proxy_write->surface);
1776 proxy_write->surface = NULL; 1801 proxy_write->surface = NULL;
1777 } 1802 }
@@ -1781,6 +1806,7 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
1781 if (!proxy_write->surface) 1806 if (!proxy_write->surface)
1782 { 1807 {
1783 proxy_write->surface = ENFN->image_map_surface_new(ENDT, w, h, 1); 1808 proxy_write->surface = ENFN->image_map_surface_new(ENDT, w, h, 1);
1809 RD(level, " created surface: %p %dx%d\n", proxy_write->surface, w, h);
1784 if (!proxy_write->surface) goto end; 1810 if (!proxy_write->surface) goto end;
1785 proxy_write->w = w; 1811 proxy_write->w = w;
1786 proxy_write->h = h; 1812 proxy_write->h = h;
@@ -1788,7 +1814,7 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
1788 1814
1789 ctx = ENFN->context_new(ENDT); 1815 ctx = ENFN->context_new(ENDT);
1790 ENFN->context_color_set(ENDT, ctx, 0, 0,0, 0); 1816 ENFN->context_color_set(ENDT, ctx, 0, 0,0, 0);
1791 ENFN->context_render_op_set(ENDT, ctx,EVAS_RENDER_COPY); 1817 ENFN->context_render_op_set(ENDT, ctx, EVAS_RENDER_COPY);
1792 ENFN->rectangle_draw(ENDT, ctx, proxy_write->surface, 0, 0, w, h, do_async); 1818 ENFN->rectangle_draw(ENDT, ctx, proxy_write->surface, 0, 0, w, h, do_async);
1793 ENFN->context_free(ENDT, ctx); 1819 ENFN->context_free(ENDT, ctx);
1794 1820
@@ -1806,8 +1832,8 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
1806 evas_render_mapped(evas, eo_source, source, ctx, proxy_write->surface, 1832 evas_render_mapped(evas, eo_source, source, ctx, proxy_write->surface,
1807 -source->cur->geometry.x, 1833 -source->cur->geometry.x,
1808 -source->cur->geometry.y, 1834 -source->cur->geometry.y,
1809 2, 0, 0, evas->output.w, evas->output.h, 1835 level + 1, 0, 0, evas->output.w, evas->output.h,
1810 &proxy_render_data, 1, EINA_TRUE, do_async); 1836 &proxy_render_data, level + 1, EINA_TRUE, do_async);
1811 1837
1812 ENFN->context_free(ENDT, ctx); 1838 ENFN->context_free(ENDT, ctx);
1813 proxy_write->surface = ENFN->image_dirty_region(ENDT, proxy_write->surface, 0, 0, w, h); 1839 proxy_write->surface = ENFN->image_dirty_region(ENDT, proxy_write->surface, 0, 0, w, h);
@@ -2207,7 +2233,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *e,
2207 2233
2208 /* if it's in our outpout rect and it doesn't clip anything */ 2234 /* if it's in our outpout rect and it doesn't clip anything */
2209 RD(0, " OBJ: [%p", obj); 2235 RD(0, " OBJ: [%p", obj);
2210 IFRD(0, " '%s'", obj->name); 2236 IFRD(obj->name, 0, " '%s'", obj->name);
2211 RD(0, "] '%s' %i %i %ix%i\n", obj->type, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h); 2237 RD(0, "] '%s' %i %i %ix%i\n", obj->type, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h);
2212 if ((evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh) || 2238 if ((evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh) ||
2213 (obj->is_smart)) && 2239 (obj->is_smart)) &&