summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-01-26 17:35:42 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-02-10 12:00:37 +0900
commit7a50f5827f8407237c002d19f28330bd372e3ec1 (patch)
treed5df9f6b4a8059ac8f7d82328c561f6dc005f5c3
parent21d08f86e6087f7e30ff2015c7551c06e359bba9 (diff)
Evas render: Improve debug output with REND_DBG
Better formatting and less code clutter. This is a purely non-functional change as all the changed lines are ifdef'ed out by default.
-rw-r--r--src/lib/evas/canvas/evas_render.c268
-rw-r--r--src/lib/evas/include/evas_private.h4
2 files changed, 132 insertions, 140 deletions
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 42a6e4bb3e..1d2db2a5f3 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -22,7 +22,7 @@ void _evas_render2_wait(Eo *eo_e);
22 * NOTE: Define REND_DBG 1 in evas_private.h to enable debugging. Don't define 22 * NOTE: Define REND_DBG 1 in evas_private.h to enable debugging. Don't define
23 * it here since the flag is used on other places too. */ 23 * it here since the flag is used on other places too. */
24 24
25/* #define STDOUT_DBG 1 */ 25#define STDOUT_DBG 1
26 26
27#ifdef REND_DBG 27#ifdef REND_DBG
28static FILE *dbf = NULL; 28static FILE *dbf = NULL;
@@ -42,24 +42,20 @@ rend_dbg(const char *txt)
42 fputs(txt, dbf); 42 fputs(txt, dbf);
43 fflush(dbf); 43 fflush(dbf);
44} 44}
45#define RD(args...) \ 45#define RD(xxxx, args...) \
46 { \ 46 do { \
47 char __tmpbuf[4096]; \
48 \
49 snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
50 rend_dbg(__tmpbuf); \
51 }
52#define RDI(xxxx) \
53 { \
54 char __tmpbuf[4096]; int __tmpi; \ 47 char __tmpbuf[4096]; int __tmpi; \
55 for (__tmpi = 0; __tmpi < xxxx; __tmpi++) \ 48 if (xxxx) { \
56 __tmpbuf[__tmpi] = ' '; \ 49 for (__tmpi = 0; __tmpi < xxxx * 2; __tmpi++) \
57 __tmpbuf[__tmpi] = 0; \ 50 __tmpbuf[__tmpi] = ' '; \
51 __tmpbuf[__tmpi] = 0; \
52 rend_dbg(__tmpbuf); \
53 } \
54 snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
58 rend_dbg(__tmpbuf); \ 55 rend_dbg(__tmpbuf); \
59 } 56 } while (0)
60#else 57#else
61#define RD(args...) 58#define RD(args...) do {} while(0)
62#define RDI(x)
63#endif 59#endif
64 60
65#define OBJ_ARRAY_PUSH(array, obj) \ 61#define OBJ_ARRAY_PUSH(array, obj) \
@@ -336,7 +332,9 @@ static inline Eina_Bool
336_evas_render_object_is_mask(Evas_Object_Protected_Data *obj) 332_evas_render_object_is_mask(Evas_Object_Protected_Data *obj)
337{ 333{
338 if (!obj) return EINA_FALSE; 334 if (!obj) return EINA_FALSE;
339 return (obj->mask->is_mask && obj->clip.clipees); 335 if (obj->mask->is_mask && obj->clip.clipees)
336 return EINA_TRUE;
337 return EINA_FALSE;
340} 338}
341 339
342static void 340static void
@@ -349,7 +347,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
349 unsigned int i; 347 unsigned int i;
350 Evas_Object *eo_obj; 348 Evas_Object *eo_obj;
351 349
352 RD(" [--- PHASE 1 DIRECT\n"); 350 RD(0, " [--- PHASE 1 DIRECT\n");
353 for (i = 0; i < active_objects->count; i++) 351 for (i = 0; i < active_objects->count; i++)
354 { 352 {
355 Evas_Object_Protected_Data *obj = 353 Evas_Object_Protected_Data *obj =
@@ -376,12 +374,12 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
376 eina_array_data_get(render_objects, i); 374 eina_array_data_get(render_objects, i);
377 eo_obj = obj->object; 375 eo_obj = obj->object;
378 376
379 RD(" OBJ [%p", obj); 377 RD(0, " OBJ [%p", obj);
380 if (obj->name) 378 if (obj->name)
381 { 379 {
382 RD(":%s", obj->name); 380 RD(0, ":%s", obj->name);
383 } 381 }
384 RD("] changed %i\n", obj->changed); 382 RD(0, "] changed %i\n", obj->changed);
385 383
386 if (obj->changed) 384 if (obj->changed)
387 { 385 {
@@ -409,7 +407,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
409 _evas_mask_redraw_set(e, obj); 407 _evas_mask_redraw_set(e, obj);
410 } 408 }
411 409
412 RD(" pre-render-done smart:%p|%p [%p, %i] | [%p, %i] has_map:%i had_map:%i\n", 410 RD(0, " pre-render-done smart:%p|%p [%p, %i] | [%p, %i] has_map:%i had_map:%i\n",
413 obj->smart.smart, 411 obj->smart.smart,
414 evas_object_smart_members_get_direct(eo_obj), 412 evas_object_smart_members_get_direct(eo_obj),
415 obj->map->cur.map, obj->map->cur.usemap, 413 obj->map->cur.map, obj->map->cur.usemap,
@@ -420,7 +418,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
420 ((_evas_render_has_map(eo_obj, obj) || 418 ((_evas_render_has_map(eo_obj, obj) ||
421 (obj->changed_src_visible)))) 419 (obj->changed_src_visible))))
422 { 420 {
423 RD(" has map + smart\n"); 421 RD(0, " has map + smart\n");
424 _evas_render_prev_cur_clip_cache_add(e, obj); 422 _evas_render_prev_cur_clip_cache_add(e, obj);
425 } 423 }
426 } 424 }
@@ -435,12 +433,12 @@ _evas_render_phase1_direct(Evas_Public_Data *e,
435 (evas_object_is_opaque(eo_obj, obj))) && 433 (evas_object_is_opaque(eo_obj, obj))) &&
436 (!evas_object_is_source_invisible(eo_obj, obj))) 434 (!evas_object_is_source_invisible(eo_obj, obj)))
437 { 435 {
438 RD(" rect del\n"); 436 RD(0, " rect del\n");
439 _evas_render_cur_clip_cache_del(e, obj); 437 _evas_render_cur_clip_cache_del(e, obj);
440 } 438 }
441 } 439 }
442 } 440 }
443 RD(" ---]\n"); 441 RD(0, " ---]\n");
444} 442}
445 443
446static Eina_Bool 444static Eina_Bool
@@ -483,13 +481,11 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
483 } 481 }
484 obj->is_active = is_active; 482 obj->is_active = is_active;
485 483
486 RDI(level); 484#ifdef REND_DBG
487 RD(" [--- PROCESS [%p", obj); 485 RD(level, "[--- PROCESS [%p", obj);
488 if (obj->name) 486 if (obj->name) RD(0, ":%s", obj->name);
489 { 487 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);
490 RD(":%s", obj->name); 488#endif
491 }
492 RD("] '%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);
493 489
494 if ((!mapped_parent) && ((is_active) || (obj->delete_me != 0))) 490 if ((!mapped_parent) && ((is_active) || (obj->delete_me != 0)))
495 OBJ_ARRAY_PUSH(active_objects, obj); 491 OBJ_ARRAY_PUSH(active_objects, obj);
@@ -497,10 +493,9 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
497#ifdef REND_DBG 493#ifdef REND_DBG
498 if (!is_active) 494 if (!is_active)
499 { 495 {
500 RDI(level); 496 RD(level, "[%p", obj);
501 RD(" [%p", obj); 497 if (obj->name) RD(0, ":%s", obj->name);
502 if (obj->name) RD(":%s", obj->name); 498 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);
503 RD("] 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);
504 } 499 }
505#endif 500#endif
506 501
@@ -520,8 +515,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
520 515
521 if (map) 516 if (map)
522 { 517 {
523 RDI(level); 518 RD(level, " obj mapped\n");
524 RD(" obj mapped\n");
525 if (!hmap && obj->cur->clipper) 519 if (!hmap && obj->cur->clipper)
526 { 520 {
527 // Fix some bad clipping issues before an evas map animation starts 521 // Fix some bad clipping issues before an evas map animation starts
@@ -566,8 +560,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
566 } 560 }
567 else if (hmap) 561 else if (hmap)
568 { 562 {
569 RDI(level); 563 RD(level, " had map - restack objs\n");
570 RD(" had map - restack objs\n");
571 // OBJ_ARRAY_PUSH(restack_objects, obj); 564 // OBJ_ARRAY_PUSH(restack_objects, obj);
572 _evas_render_prev_cur_clip_cache_add(e, obj); 565 _evas_render_prev_cur_clip_cache_add(e, obj);
573 if (obj->changed) 566 if (obj->changed)
@@ -596,8 +589,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
596 { 589 {
597 if (obj->is_smart) 590 if (obj->is_smart)
598 { 591 {
599 RDI(level); 592 RD(level, " changed + smart - render ok\n");
600 RD(" changed + smart - render ok\n");
601 OBJ_ARRAY_PUSH(render_objects, obj); 593 OBJ_ARRAY_PUSH(render_objects, obj);
602 594
603 if (!is_active && obj->proxy->proxies) src_changed = EINA_TRUE; 595 if (!is_active && obj->proxy->proxies) src_changed = EINA_TRUE;
@@ -626,8 +618,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
626 { 618 {
627 if (is_active) 619 if (is_active)
628 { 620 {
629 RDI(level); 621 RD(level, " relevant + active\n");
630 RD(" relevant + active\n");
631 if (obj->restack) 622 if (obj->restack)
632 OBJ_ARRAY_PUSH(restack_objects, obj); 623 OBJ_ARRAY_PUSH(restack_objects, obj);
633 else 624 else
@@ -644,8 +635,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
644 evas_object_was_visible(eo_obj, obj)) 635 evas_object_was_visible(eo_obj, obj))
645 evas_object_cur_prev(eo_obj); 636 evas_object_cur_prev(eo_obj);
646 637
647 RDI(level); 638 RD(level, " skip - not smart, not active or clippees or not relevant\n");
648 RD(" skip - not smart, not active or clippees or not relevant\n");
649 } 639 }
650 } 640 }
651 else if (is_active && _evas_render_object_is_mask(obj) && 641 else if (is_active && _evas_render_object_is_mask(obj) &&
@@ -658,21 +648,18 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
658 OBJ_ARRAY_PUSH(render_objects, obj); 648 OBJ_ARRAY_PUSH(render_objects, obj);
659 obj->render_pre = EINA_TRUE; 649 obj->render_pre = EINA_TRUE;
660 } 650 }
661 651 RD(level, " relevant + active: clipper image\n");
662 RDI(level);
663 RD(" relevant + active: clipper image\n");
664 } 652 }
665 else 653 else
666 { 654 {
667 RDI(level); 655 RD(level, " skip - not smart, not active or clippees or not relevant\n");
668 RD(" skip - not smart, not active or clippees or not relevant\n");
669 } 656 }
670 } 657 }
671 } 658 }
672 else 659 else
673 { 660 {
674 /* not changed */ 661 /* not changed */
675 RD(" not changed... [%i] -> (%i %i %p %i) [%i]\n", 662 RD(level, " not changed... [%i] -> (%i %i %p %i) [%i]\n",
676 evas_object_is_visible(eo_obj, obj), 663 evas_object_is_visible(eo_obj, obj),
677 obj->cur->visible, obj->cur->cache.clip.visible, obj->smart.smart, 664 obj->cur->visible, obj->cur->cache.clip.visible, obj->smart.smart,
678 obj->cur->cache.clip.a, evas_object_was_visible(eo_obj, obj)); 665 obj->cur->cache.clip.a, evas_object_was_visible(eo_obj, obj));
@@ -683,8 +670,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
683 { 670 {
684 if (obj->is_smart) 671 if (obj->is_smart)
685 { 672 {
686 RDI(level); 673 RD(level, " smart + visible/was visible + not clip\n");
687 RD(" smart + visible/was visible + not clip\n");
688 OBJ_ARRAY_PUSH(render_objects, obj); 674 OBJ_ARRAY_PUSH(render_objects, obj);
689 obj->render_pre = EINA_TRUE; 675 obj->render_pre = EINA_TRUE;
690 Evas_Object_Protected_Data *obj2; 676 Evas_Object_Protected_Data *obj2;
@@ -709,37 +695,32 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
709 if (evas_object_is_opaque(eo_obj, obj) && 695 if (evas_object_is_opaque(eo_obj, obj) &&
710 evas_object_is_visible(eo_obj, obj)) 696 evas_object_is_visible(eo_obj, obj))
711 { 697 {
712 RDI(level); 698 RD(level, " opaque + visible\n");
713 RD(" opaque + visible\n");
714 OBJ_ARRAY_PUSH(render_objects, obj); 699 OBJ_ARRAY_PUSH(render_objects, obj);
715 obj->rect_del = EINA_TRUE; 700 obj->rect_del = EINA_TRUE;
716 } 701 }
717 else if (evas_object_is_visible(eo_obj, obj)) 702 else if (evas_object_is_visible(eo_obj, obj))
718 { 703 {
719 RDI(level); 704 RD(level, " visible\n");
720 RD(" visible\n");
721 OBJ_ARRAY_PUSH(render_objects, obj); 705 OBJ_ARRAY_PUSH(render_objects, obj);
722 obj->render_pre = EINA_TRUE; 706 obj->render_pre = EINA_TRUE;
723 } 707 }
724 else 708 else
725 { 709 {
726 RDI(level); 710 RD(level, " skip\n");
727 RD(" skip\n");
728 } 711 }
729 } 712 }
730 } 713 }
731 else if (is_active && _evas_render_object_is_mask(obj) && 714 else if (is_active && _evas_render_object_is_mask(obj) &&
732 evas_object_is_visible(eo_obj, obj)) 715 evas_object_is_visible(eo_obj, obj))
733 { 716 {
734 RDI(level); 717 RD(level, " visible clipper image\n");
735 RD(" visible clipper image\n");
736 OBJ_ARRAY_PUSH(render_objects, obj); 718 OBJ_ARRAY_PUSH(render_objects, obj);
737 obj->render_pre = EINA_TRUE; 719 obj->render_pre = EINA_TRUE;
738 } 720 }
739 /* else if (obj->smart.smart) 721 /* else if (obj->smart.smart)
740 { 722 {
741 RDI(level); 723 RD(level, " smart + mot visible/was visible\n");
742 RD(" smart + mot visible/was visible\n");
743 OBJ_ARRAY_PUSH(render_objects, obj); 724 OBJ_ARRAY_PUSH(render_objects, obj);
744 obj->render_pre = 1; 725 obj->render_pre = 1;
745 EINA_INLIST_FOREACH (evas_object_smart_members_get_direct(eo_obj), 726 EINA_INLIST_FOREACH (evas_object_smart_members_get_direct(eo_obj),
@@ -758,8 +739,7 @@ _evas_render_phase1_object_process(Evas_Public_Data *e, Evas_Object *eo_obj,
758*/ 739*/
759 } 740 }
760 if (!is_active) obj->restack = EINA_FALSE; 741 if (!is_active) obj->restack = EINA_FALSE;
761 RDI(level); 742 RD(level, "---]\n");
762 RD(" ---]\n");
763 return clean_them; 743 return clean_them;
764} 744}
765 745
@@ -774,7 +754,7 @@ _evas_render_phase1_process(Evas_Public_Data *e,
774 Evas_Layer *lay; 754 Evas_Layer *lay;
775 Eina_Bool clean_them = EINA_FALSE; 755 Eina_Bool clean_them = EINA_FALSE;
776 756
777 RD(" [--- PHASE 1\n"); 757 RD(0, " [--- PHASE 1\n");
778 EINA_INLIST_FOREACH(e->layers, lay) 758 EINA_INLIST_FOREACH(e->layers, lay)
779 { 759 {
780 Evas_Object_Protected_Data *obj; 760 Evas_Object_Protected_Data *obj;
@@ -783,10 +763,10 @@ _evas_render_phase1_process(Evas_Public_Data *e,
783 { 763 {
784 clean_them |= _evas_render_phase1_object_process 764 clean_them |= _evas_render_phase1_object_process
785 (e, obj->object, active_objects, restack_objects, delete_objects, 765 (e, obj->object, active_objects, restack_objects, delete_objects,
786 render_objects, 0, redraw_all, EINA_FALSE, EINA_FALSE, 1); 766 render_objects, 0, redraw_all, EINA_FALSE, EINA_FALSE, 2);
787 } 767 }
788 } 768 }
789 RD(" ---]\n"); 769 RD(0, " ---]\n");
790 return clean_them; 770 return clean_them;
791} 771}
792 772
@@ -878,12 +858,12 @@ pending_change(void *data, void *gdata EINA_UNUSED)
878 if (obj->delete_me) return EINA_FALSE; 858 if (obj->delete_me) return EINA_FALSE;
879 if (obj->pre_render_done) 859 if (obj->pre_render_done)
880 { 860 {
881 RD(" OBJ [%p", obj); 861 RD(0, " OBJ [%p", obj);
882 if (obj->name) 862 if (obj->name)
883 { 863 {
884 RD(":%s", obj->name); 864 RD(0, ":%s", obj->name);
885 } 865 }
886 RD("] pending change %i -> 0, pre %i\n", obj->changed, obj->pre_render_done); 866 RD(0, "] pending change %i -> 0, pre %i\n", obj->changed, obj->pre_render_done);
887 obj->func->render_post(eo_obj, obj, obj->private_data); 867 obj->func->render_post(eo_obj, obj, obj->private_data);
888 obj->pre_render_done = EINA_FALSE; 868 obj->pre_render_done = EINA_FALSE;
889 evas_object_change_reset(eo_obj); 869 evas_object_change_reset(eo_obj);
@@ -1231,22 +1211,35 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1231 1211
1232 evas_object_clip_recalc(obj); 1212 evas_object_clip_recalc(obj);
1233 1213
1234 RDI(level); 1214#ifdef REND_DBG
1235 RD(" { evas_render_mapped(%p, %p", e, obj); 1215 RD(level, "{\n");
1236 if (obj->name) 1216 RD(level, " evas_render_mapped(evas:%p, obj:%p", e, obj);
1217 if (obj->name) RD(0, ":\"%s\"", obj->name);
1218 RD(0, ", ctx:%p, sfc:%p, offset:%i,%i, %s, use_mapped_ctx:%d, %s)\n", context, surface, off_x, off_y,
1219 mapped ? "mapped" : "normal", use_mapped_ctx, do_async ? "async" : "sync");
1220 RD(level, " obj: '%s' %s", obj->type, obj->is_smart ? "(smart) " : "");
1221 if (obj->name) RD(0, "\"%s\"\n", obj->name);
1222 else RD(0, "\n");
1223 if (obj->cur->clipper)
1237 { 1224 {
1238 RD(":%s", obj->name); 1225 RD(level, " clipper: '%s'%s%s %p (mask %p) %d,%d %dx%d\n",
1226 obj->cur->clipper->type,
1227 obj->cur->clipper->name ? ":" : "",
1228 obj->cur->clipper->name ? obj->cur->clipper->name : "",
1229 obj->cur->clipper, obj->clip.mask,
1230 obj->cur->clipper->cur->geometry.x, obj->cur->clipper->cur->geometry.y,
1231 obj->cur->clipper->cur->geometry.w, obj->cur->clipper->cur->geometry.h);
1239 } 1232 }
1240 RD(", %p, %p, %i, %i, %i, %i)\n", context, surface, off_x, off_y, mapped, level); 1233#endif
1241 1234
1242 if (mapped) 1235 if (mapped)
1243 { 1236 {
1244 if (_evas_render_object_is_mask(obj)) 1237 if (_evas_render_object_is_mask(obj))
1245 { 1238 {
1239 RD(level, " is mask: redraw:%d sfc:%p\n", obj->mask->redraw, obj->mask->surface);
1246 if (!use_mapped_ctx || (surface != obj->mask->surface)) 1240 if (!use_mapped_ctx || (surface != obj->mask->surface))
1247 { 1241 {
1248 RDI(level); 1242 RD(level, "}\n");
1249 RD(" }\n");
1250 return clean_them; 1243 return clean_them;
1251 } 1244 }
1252 // else don't return: draw mask in its surface 1245 // else don't return: draw mask in its surface
@@ -1256,8 +1249,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1256 if ((!evas_object_is_visible(eo_obj, obj)) || (obj->clip.clipees) 1249 if ((!evas_object_is_visible(eo_obj, obj)) || (obj->clip.clipees)
1257 || (obj->cur->have_clipees)) 1250 || (obj->cur->have_clipees))
1258 { 1251 {
1259 RDI(level); 1252 RD(level, "}\n");
1260 RD(" }\n");
1261 return clean_them; 1253 return clean_them;
1262 } 1254 }
1263 } 1255 }
@@ -1266,8 +1258,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1266 if (!evas_object_is_proxy_visible(eo_obj, obj) || 1258 if (!evas_object_is_proxy_visible(eo_obj, obj) ||
1267 (obj->clip.clipees) || (obj->cur->have_clipees)) 1259 (obj->clip.clipees) || (obj->cur->have_clipees))
1268 { 1260 {
1269 RDI(level); 1261 RD(level, "}\n");
1270 RD(" }\n");
1271 return clean_them; 1262 return clean_them;
1272 } 1263 }
1273 } 1264 }
@@ -1276,17 +1267,17 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1276 (_evas_render_can_render(eo_obj, obj)))) 1267 (_evas_render_can_render(eo_obj, obj))))
1277 )) 1268 ))
1278 { 1269 {
1279 RDI(level); 1270 RD(level, "}\n");
1280 RD(" }\n");
1281 return clean_them; 1271 return clean_them;
1282 } 1272 }
1283 1273
1284 // set render_pre - for child objs that may not have gotten it. 1274 // set render_pre - for child objs that may not have gotten it.
1285 obj->pre_render_done = EINA_TRUE; 1275 obj->pre_render_done = EINA_TRUE;
1286 RD(" Hasmap: %p (%d) %p %d -> %d\n",obj->func->can_map, 1276 RD(level, " hasmap: %s [can_map:%p (%d)] cur.map:%p cur.usemap:%d\n",
1277 _evas_render_has_map(eo_obj, obj) ? "yes" : "no",
1278 obj->func->can_map,
1287 obj->func->can_map ? obj->func->can_map(eo_obj): -1, 1279 obj->func->can_map ? obj->func->can_map(eo_obj): -1,
1288 obj->map->cur.map, obj->map->cur.usemap, 1280 obj->map->cur.map, obj->map->cur.usemap);
1289 _evas_render_has_map(eo_obj, obj));
1290 if (_evas_render_has_map(eo_obj, obj)) 1281 if (_evas_render_has_map(eo_obj, obj))
1291 { 1282 {
1292 int sw, sh; 1283 int sw, sh;
@@ -1296,12 +1287,10 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1296 1287
1297 sw = obj->cur->geometry.w; 1288 sw = obj->cur->geometry.w;
1298 sh = obj->cur->geometry.h; 1289 sh = obj->cur->geometry.h;
1299 RDI(level); 1290 RD(level, " surf size: %ix%i\n", sw, sh);
1300 RD(" mapped obj: %ix%i\n", sw, sh);
1301 if ((sw <= 0) || (sh <= 0)) 1291 if ((sw <= 0) || (sh <= 0))
1302 { 1292 {
1303 RDI(level); 1293 RD(level, "}\n");
1304 RD(" }\n");
1305 return clean_them; 1294 return clean_them;
1306 } 1295 }
1307 1296
@@ -1312,8 +1301,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1312 if ((obj->map->surface_w != sw) || 1301 if ((obj->map->surface_w != sw) ||
1313 (obj->map->surface_h != sh)) 1302 (obj->map->surface_h != sh))
1314 { 1303 {
1315 RDI(level); 1304 RD(level, " new surf: %ix%i\n", sw, sh);
1316 RD(" new surf: %ix%i\n", sw, sh);
1317 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write) 1305 EINA_COW_WRITE_BEGIN(evas_object_map_cow, obj->map, Evas_Object_Map_Data, map_write)
1318 { 1306 {
1319 obj->layer->evas->engine.func->image_map_surface_free 1307 obj->layer->evas->engine.func->image_map_surface_free
@@ -1338,8 +1326,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1338 } 1326 }
1339 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write); 1327 EINA_COW_WRITE_END(evas_object_map_cow, obj->map, map_write);
1340 1328
1341 RDI(level); 1329 RD(level, " first surf: %ix%i\n", sw, sh);
1342 RD(" fisrt surf: %ix%i\n", sw, sh);
1343 changed = EINA_TRUE; 1330 changed = EINA_TRUE;
1344 } 1331 }
1345 1332
@@ -1359,8 +1346,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1359 { 1346 {
1360 int off_x2, off_y2; 1347 int off_x2, off_y2;
1361 1348
1362 RDI(level); 1349 RD(level, " children redraw\n");
1363 RD(" children redraw\n");
1364 // FIXME: calculate "changes" within map surface and only clear 1350 // FIXME: calculate "changes" within map surface and only clear
1365 // and re-render those 1351 // and re-render those
1366 if (obj->map->cur.map->alpha) 1352 if (obj->map->cur.map->alpha)
@@ -1428,8 +1414,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1428 rendered = EINA_TRUE; 1414 rendered = EINA_TRUE;
1429 } 1415 }
1430 1416
1431 RDI(level); 1417 RD(level, " draw map\n");
1432 RD(" draw map\n");
1433 1418
1434 if (rendered) 1419 if (rendered)
1435 { 1420 {
@@ -1468,8 +1453,11 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1468 { 1453 {
1469 // This path can be hit when we're multiplying masks on top of each other... 1454 // This path can be hit when we're multiplying masks on top of each other...
1470 Evas_Object_Protected_Data *mask = obj->cur->clipper; 1455 Evas_Object_Protected_Data *mask = obj->cur->clipper;
1456 RD(level, " has mask: [%p%s%s] redraw:%d sfc:%p\n",
1457 mask, mask->name?":":"", mask->name?mask->name:"",
1458 mask->mask->redraw, mask->mask->surface);
1471 if (mask->mask->redraw || !mask->mask->surface) 1459 if (mask->mask->redraw || !mask->mask->surface)
1472 evas_render_mask_subrender(obj->layer->evas, mask, obj->clip.prev_mask); 1460 evas_render_mask_subrender(obj->layer->evas, mask, obj->clip.prev_mask, level + 1);
1473 1461
1474 if (mask->mask->surface) 1462 if (mask->mask->surface)
1475 { 1463 {
@@ -1521,7 +1509,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1521 // (e->engine.data.output, obj->map->surface); 1509 // (e->engine.data.output, obj->map->surface);
1522 // obj->map->surface = NULL; 1510 // obj->map->surface = NULL;
1523 } 1511 }
1524 else 1512 else // not "has map"
1525 { 1513 {
1526#if 0 1514#if 0
1527 if (0 && obj->cur->cached_surface) 1515 if (0 && obj->cur->cached_surface)
@@ -1533,12 +1521,14 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1533 1521
1534 if (mapped) 1522 if (mapped)
1535 { 1523 {
1536 RDI(level); 1524 RD(level, " draw child of mapped obj: '%s'%s\n",
1537 RD(" draw child of mapped obj\n"); 1525 obj->type, obj->is_smart ? " (smart)" : "");
1526
1538 if (use_mapped_ctx) 1527 if (use_mapped_ctx)
1539 ctx = context; 1528 ctx = context;
1540 else 1529 else
1541 ctx = e->engine.func->context_new(e->engine.data.output); 1530 ctx = e->engine.func->context_new(e->engine.data.output);
1531
1542 if (obj->is_smart) 1532 if (obj->is_smart)
1543 { 1533 {
1544 /* Clipper masks */ 1534 /* Clipper masks */
@@ -1550,8 +1540,11 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1550 1540
1551 evas_object_clip_recalc(obj); 1541 evas_object_clip_recalc(obj);
1552 1542
1543 RD(level, " has mask: [%p%s%s] redraw:%d sfc:%p\n",
1544 mask, mask->name?":":"", mask->name?mask->name:"",
1545 mask->mask->redraw, mask->mask->surface);
1553 if (mask->mask->redraw || !mask->mask->surface) 1546 if (mask->mask->redraw || !mask->mask->surface)
1554 evas_render_mask_subrender(obj->layer->evas, mask, obj->clip.prev_mask); 1547 evas_render_mask_subrender(obj->layer->evas, mask, obj->clip.prev_mask, level + 1);
1555 1548
1556 if (mask->mask->surface) 1549 if (mask->mask->surface)
1557 { 1550 {
@@ -1584,7 +1577,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1584 /* We aren't sure this object will be rendered by 1577 /* We aren't sure this object will be rendered by
1585 normal(not proxy) drawing after, we reset this 1578 normal(not proxy) drawing after, we reset this
1586 only in case of normal drawing. For optmizing, 1579 only in case of normal drawing. For optmizing,
1587 push this object in an array then reset them 1580 push this object in an array then reset them
1588 in the end of the rendering.*/ 1581 in the end of the rendering.*/
1589 if (!proxy_render_data) 1582 if (!proxy_render_data)
1590 evas_object_change_reset(obj2->object); 1583 evas_object_change_reset(obj2->object);
@@ -1592,8 +1585,6 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1592 } 1585 }
1593 else 1586 else
1594 { 1587 {
1595 RDI(level);
1596
1597 if (obj->cur->clipper) 1588 if (obj->cur->clipper)
1598 { 1589 {
1599 if (_evas_render_has_map(eo_obj, obj) || 1590 if (_evas_render_has_map(eo_obj, obj) ||
@@ -1608,8 +1599,11 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1608 { 1599 {
1609 // This path can be hit when we're multiplying masks on top of each other... 1600 // This path can be hit when we're multiplying masks on top of each other...
1610 Evas_Object_Protected_Data *mask = obj->cur->clipper; 1601 Evas_Object_Protected_Data *mask = obj->cur->clipper;
1602 RD(level, " has mask: [%p%s%s] redraw:%d sfc:%p\n",
1603 mask, mask->name?":":"", mask->name?mask->name:"",
1604 mask->mask->redraw, mask->mask->surface);
1611 if (mask->mask->redraw || !mask->mask->surface) 1605 if (mask->mask->redraw || !mask->mask->surface)
1612 evas_render_mask_subrender(obj->layer->evas, mask, obj->clip.prev_mask); 1606 evas_render_mask_subrender(obj->layer->evas, mask, obj->clip.prev_mask, level + 1);
1613 1607
1614 if (mask->mask->surface) 1608 if (mask->mask->surface)
1615 { 1609 {
@@ -1671,16 +1665,14 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1671 ecx, ecy, ecw, ech); 1665 ecx, ecy, ecw, ech);
1672 } 1666 }
1673 1667
1674 RDI(level); 1668 RD(level, " draw normal obj\n");
1675 RD(" draw normal obj\n");
1676 obj->func->render(eo_obj, obj, obj->private_data, 1669 obj->func->render(eo_obj, obj, obj->private_data,
1677 e->engine.data.output, context, surface, 1670 e->engine.data.output, context, surface,
1678 off_x, off_y, do_async); 1671 off_x, off_y, do_async);
1679 } 1672 }
1680 if (obj->changed_map) clean_them = EINA_TRUE; 1673 if (obj->changed_map) clean_them = EINA_TRUE;
1681 } 1674 }
1682 RDI(level); 1675 RD(level, "}\n");
1683 RD(" }\n");
1684 1676
1685 return clean_them; 1677 return clean_them;
1686} 1678}
@@ -1769,7 +1761,8 @@ evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_
1769void 1761void
1770evas_render_mask_subrender(Evas_Public_Data *evas, 1762evas_render_mask_subrender(Evas_Public_Data *evas,
1771 Evas_Object_Protected_Data *mask, 1763 Evas_Object_Protected_Data *mask,
1772 Evas_Object_Protected_Data *prev_mask) 1764 Evas_Object_Protected_Data *prev_mask,
1765 int level)
1773{ 1766{
1774 int x, y, w, h, r, g, b, a; 1767 int x, y, w, h, r, g, b, a;
1775 void *ctx; 1768 void *ctx;
@@ -1781,6 +1774,8 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
1781 return; 1774 return;
1782 } 1775 }
1783 1776
1777 RD(level, "evas_render_mask_subrender(%p, prev: %p)\n", mask, prev_mask);
1778
1784 x = mask->cur->geometry.x; 1779 x = mask->cur->geometry.x;
1785 y = mask->cur->geometry.y; 1780 y = mask->cur->geometry.y;
1786 w = mask->cur->geometry.w; 1781 w = mask->cur->geometry.w;
@@ -1816,7 +1811,7 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
1816 { 1811 {
1817 // Note: This is preventive code. Never seen it happen. 1812 // Note: This is preventive code. Never seen it happen.
1818 WRN("Mask render order may be invalid"); 1813 WRN("Mask render order may be invalid");
1819 evas_render_mask_subrender(evas, prev_mask, prev_mask->clip.prev_mask); 1814 evas_render_mask_subrender(evas, prev_mask, prev_mask->clip.prev_mask, level + 1);
1820 } 1815 }
1821 } 1816 }
1822 1817
@@ -1859,7 +1854,7 @@ evas_render_mask_subrender(Evas_Public_Data *evas,
1859 } 1854 }
1860 evas_render_mapped(evas, mask->object, mask, ctx, mdata->surface, 1855 evas_render_mapped(evas, mask->object, mask, ctx, mdata->surface,
1861 -x, -y, 1, 0, 0, evas->output.w, evas->output.h, 1856 -x, -y, 1, 0, 0, evas->output.w, evas->output.h,
1862 NULL, 1, EINA_TRUE, EINA_FALSE); 1857 NULL, level, EINA_TRUE, EINA_FALSE);
1863 ENFN->context_free(ENDT, ctx); 1858 ENFN->context_free(ENDT, ctx);
1864 1859
1865 /* BEGIN HACK */ 1860 /* BEGIN HACK */
@@ -2082,7 +2077,7 @@ evas_render_updates_internal(Evas *eo_e,
2082#endif 2077#endif
2083 evas_call_smarts_calculate(eo_e); 2078 evas_call_smarts_calculate(eo_e);
2084 2079
2085 RD("[--- RENDER EVAS (size: %ix%i)\n", e->viewport.w, e->viewport.h); 2080 RD(0, "[--- RENDER EVAS (size: %ix%i)\n", e->viewport.w, e->viewport.h);
2086 2081
2087 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL); 2082 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL);
2088 2083
@@ -2266,7 +2261,7 @@ evas_render_updates_internal(Evas *eo_e,
2266 int off_x, off_y; 2261 int off_x, off_y;
2267 Render_Updates *ru; 2262 Render_Updates *ru;
2268 2263
2269 RD(" [--- UPDATE %i %i %ix%i\n", ux, uy, uw, uh); 2264 RD(0, " [--- UPDATE %i %i %ix%i\n", ux, uy, uw, uh);
2270 if (do_async) 2265 if (do_async)
2271 { 2266 {
2272 ru = malloc(sizeof(*ru)); 2267 ru = malloc(sizeof(*ru));
@@ -2334,12 +2329,12 @@ evas_render_updates_internal(Evas *eo_e,
2334 eo_obj = obj->object; 2329 eo_obj = obj->object;
2335 2330
2336 /* if it's in our outpout rect and it doesn't clip anything */ 2331 /* if it's in our outpout rect and it doesn't clip anything */
2337 RD(" OBJ: [%p", obj); 2332 RD(0, " OBJ: [%p", obj);
2338 if (obj->name) 2333 if (obj->name)
2339 { 2334 {
2340 RD(":%s", obj->name); 2335 RD(0, ":%s", obj->name);
2341 } 2336 }
2342 RD("] '%s' %i %i %ix%i\n", obj->type, obj->cur->geometry.x, obj->cur->geometry.y, obj->cur->geometry.w, obj->cur->geometry.h); 2337 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);
2343 if ((evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh) || 2338 if ((evas_object_is_in_output_rect(eo_obj, obj, ux - fx, uy - fy, uw, uh) ||
2344 (obj->is_smart)) && 2339 (obj->is_smart)) &&
2345 (!obj->clip.clipees) && 2340 (!obj->clip.clipees) &&
@@ -2351,7 +2346,7 @@ evas_render_updates_internal(Evas *eo_e,
2351 { 2346 {
2352 int x, y, w, h; 2347 int x, y, w, h;
2353 2348
2354 RD(" DRAW (vis: %i, a: %i, clipees: %p\n", obj->cur->visible, obj->cur->color.a, obj->clip.clipees); 2349 RD(0, " DRAW (vis: %i, a: %i, clipees: %p)\n", obj->cur->visible, obj->cur->color.a, obj->clip.clipees);
2355 if ((e->temporary_objects.count > offset) && 2350 if ((e->temporary_objects.count > offset) &&
2356 (eina_array_data_get(&e->temporary_objects, offset) == obj)) 2351 (eina_array_data_get(&e->temporary_objects, offset) == obj))
2357 offset++; 2352 offset++;
@@ -2384,7 +2379,7 @@ evas_render_updates_internal(Evas *eo_e,
2384 if (mask) 2379 if (mask)
2385 { 2380 {
2386 if (mask->mask->redraw || !mask->mask->surface) 2381 if (mask->mask->redraw || !mask->mask->surface)
2387 evas_render_mask_subrender(obj->layer->evas, mask, prev_mask); 2382 evas_render_mask_subrender(obj->layer->evas, mask, prev_mask, 4);
2388 2383
2389 if (mask->mask->surface) 2384 if (mask->mask->surface)
2390 { 2385 {
@@ -2411,7 +2406,7 @@ evas_render_updates_internal(Evas *eo_e,
2411 surface, off_x + fx, 2406 surface, off_x + fx,
2412 off_y + fy, 0, 2407 off_y + fy, 0,
2413 cx, cy, cw, ch, 2408 cx, cy, cw, ch,
2414 NULL, 1, 2409 NULL, 4,
2415 EINA_FALSE, 2410 EINA_FALSE,
2416 do_async); 2411 do_async);
2417 e->engine.func->context_cutout_clear(e->engine.data.output, 2412 e->engine.func->context_cutout_clear(e->engine.data.output,
@@ -2436,7 +2431,7 @@ evas_render_updates_internal(Evas *eo_e,
2436 2431
2437 /* free obscuring objects list */ 2432 /* free obscuring objects list */
2438 OBJS_ARRAY_CLEAN(&e->temporary_objects); 2433 OBJS_ARRAY_CLEAN(&e->temporary_objects);
2439 RD(" ---]\n"); 2434 RD(0, " ---]\n");
2440 } 2435 }
2441 2436
2442 if (do_async) 2437 if (do_async)
@@ -2467,25 +2462,20 @@ evas_render_updates_internal(Evas *eo_e,
2467 } 2462 }
2468 2463
2469 /* and do a post render pass */ 2464 /* and do a post render pass */
2465 if (e->active_objects.count) RD(0, " [--- POST RENDER\n");
2470 for (i = 0; i < e->active_objects.count; ++i) 2466 for (i = 0; i < e->active_objects.count; ++i)
2471 { 2467 {
2472 obj = eina_array_data_get(&e->active_objects, i); 2468 obj = eina_array_data_get(&e->active_objects, i);
2473 eo_obj = obj->object; 2469 eo_obj = obj->object;
2474 obj->pre_render_done = EINA_FALSE; 2470 obj->pre_render_done = EINA_FALSE;
2475 RD(" OBJ [%p", obj); 2471 RD(0, " OBJ [%p", obj);
2476 if (obj->name) 2472 if (obj->name) RD(0, ":%s", obj->name);
2477 { 2473 RD(0, "] changed:%i do_draw:%i (%s)\n", obj->changed, do_draw, obj->type);
2478 RD(":%s", obj->name);
2479 }
2480 RD("] post... %i %i\n", obj->changed, do_draw);
2481 if ((clean_them) || (obj->changed && do_draw)) 2474 if ((clean_them) || (obj->changed && do_draw))
2482 { 2475 {
2483 RD(" OBJ [%p", obj); 2476 RD(0, " OBJ [%p", obj);
2484 if (obj->name) 2477 if (obj->name) RD(0, ":%s", obj->name);
2485 { 2478 RD(0, "] render_post()\n");
2486 RD(":%s", obj->name);
2487 }
2488 RD("] post... func\n");
2489 obj->func->render_post(eo_obj, obj, obj->private_data); 2479 obj->func->render_post(eo_obj, obj, obj->private_data);
2490 obj->restack = EINA_FALSE; 2480 obj->restack = EINA_FALSE;
2491 evas_object_change_reset(eo_obj); 2481 evas_object_change_reset(eo_obj);
@@ -2498,6 +2488,8 @@ evas_render_updates_internal(Evas *eo_e,
2498 else if (obj->delete_me != 0) obj->delete_me++; 2488 else if (obj->delete_me != 0) obj->delete_me++;
2499 */ 2489 */
2500 } 2490 }
2491 if (e->active_objects.count) RD(0, " ---]\n");
2492
2501 /* free our obscuring object list */ 2493 /* free our obscuring object list */
2502 OBJS_ARRAY_CLEAN(&e->obscuring_objects); 2494 OBJS_ARRAY_CLEAN(&e->obscuring_objects);
2503 2495
@@ -2606,7 +2598,7 @@ evas_render_updates_internal(Evas *eo_e,
2606 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_POST, e->render.updates ? &post : NULL); 2598 _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_POST, e->render.updates ? &post : NULL);
2607 } 2599 }
2608 2600
2609 RD("---]\n"); 2601 RD(0, "---]\n");
2610 2602
2611#ifdef EVAS_RENDER_DEBUG_TIMING 2603#ifdef EVAS_RENDER_DEBUG_TIMING
2612 _accumulate_time(start_time, do_async ? &async_accumulator : &sync_accumulator); 2604 _accumulate_time(start_time, do_async ? &async_accumulator : &sync_accumulator);
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index e0f8171e26..3cd94aa6f8 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -20,7 +20,7 @@
20 20
21#define RENDER_METHOD_INVALID 0x00000000 21#define RENDER_METHOD_INVALID 0x00000000
22 22
23/* #define REND_DBG 1 */ 23//#define REND_DBG 1
24 24
25typedef struct _Evas_Layer Evas_Layer; 25typedef struct _Evas_Layer Evas_Layer;
26typedef struct _Evas_Size Evas_Size; 26typedef struct _Evas_Size Evas_Size;
@@ -1737,7 +1737,7 @@ void evas_render_invalidate(Evas *e);
1737void evas_render_object_recalc(Evas_Object *obj); 1737void evas_render_object_recalc(Evas_Object *obj);
1738void evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy, 1738void evas_render_proxy_subrender(Evas *eo_e, Evas_Object *eo_source, Evas_Object *eo_proxy,
1739 Evas_Object_Protected_Data *proxy_obj, Eina_Bool do_async); 1739 Evas_Object_Protected_Data *proxy_obj, Eina_Bool do_async);
1740void evas_render_mask_subrender(Evas_Public_Data *e, Evas_Object_Protected_Data *mask, Evas_Object_Protected_Data *prev_mask); 1740void evas_render_mask_subrender(Evas_Public_Data *e, Evas_Object_Protected_Data *mask, Evas_Object_Protected_Data *prev_mask, int level);
1741 1741
1742Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y); 1742Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y);
1743Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab); 1743Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab);