tizen 2.4 release
[framework/uifw/e17-mod-tizen-comp.git] / src / hwcomp / hwcomp_debug.c
1 #include "e_mod_comp_shared_types.h"
2 #include "e_mod_comp.h"
3 #include "e_mod_comp_atoms.h"
4 #include "e_mod_comp_debug.h"
5
6 #include "hwcomp_debug.h"
7
8 #if DEBUG_HWC
9 void _hwcomp_debug_print_update(E_Comp_HWComp_Update *hwc_update, const char *str)
10 {
11    E_Comp_HWComp_Drawable *cur_d = NULL;
12    int i;
13
14    E_CHECK(hwc_update);
15
16    ELBF(ELBT_COMP, 0, 0, "%15.15s| mode: %d num_d: %d ",
17         str, hwc_update->update_mode, hwc_update->num_drawable);
18    for (i = 0; i < hwc_update->num_overlays; i++)
19      {
20         cur_d = hwc_update->hwc_drawable[i];
21         ELBF(ELBT_COMP, 0, 0, "%15.15s|  cur {d[%d]:%p set:%d}",
22              str,
23              i, cur_d?cur_d->d:0x0,cur_d?cur_d->set_drawable:0);
24      }
25 }
26
27 void _hwcomp_debug_print_change_update(E_Comp_HWComp_Update *cur_hwc_update, E_Comp_HWComp_Update *new_hwc_update, const char *str)
28 {
29    E_Comp_HWComp_Drawable *cur_d = NULL;
30    E_Comp_HWComp_Drawable *new_d = NULL;
31    int i;
32    int diff;
33    int count=0;
34
35    E_CHECK(cur_hwc_update);
36    E_CHECK(new_hwc_update);
37
38    ELBF(ELBT_COMP, 0, 0, "%15.15s| mode: %d ===> %d num_d: %d ==> %d",
39         str,
40         cur_hwc_update->update_mode, new_hwc_update->update_mode,
41         cur_hwc_update->num_drawable, new_hwc_update->num_drawable);
42
43    diff = cur_hwc_update->num_overlays - new_hwc_update->num_overlays;
44    if (!diff) count = cur_hwc_update->num_overlays;
45    else if (diff > 0) count = new_hwc_update->num_overlays;
46    else count = cur_hwc_update->num_overlays;
47
48    for (i = 0; i < count; i++)
49      {
50         cur_d = cur_hwc_update->hwc_drawable[i];
51         new_d = new_hwc_update->hwc_drawable[i];
52         ELBF(ELBT_COMP, 0, 0, "%15.15s|  cur {d[%d]:%p set:%d} new {d[%d]:%p set:%d}",
53              str,
54              i, cur_d?cur_d->d:0x0,cur_d?cur_d->set_drawable:0,
55              i, new_d?new_d->d:0x0,new_d?new_d->set_drawable:0);
56      }
57
58    if (!diff) return;
59    else if (diff > 0)
60      {
61         for (i = 0; i < cur_hwc_update->num_overlays; i++)
62           {
63              cur_d = cur_hwc_update->hwc_drawable[i];
64              ELBF(ELBT_COMP, 0, 0, "%15.15s|  cur {d[%d]:%p set:%d} new {d[%d]:%s set:%d}",
65                   str,
66                   i, cur_d?cur_d->d:0x0,cur_d?cur_d->set_drawable:0,
67                   i, "HWOV",0);
68           }
69      }
70    else
71      {
72         for (i = 0; i < new_hwc_update->num_overlays; i++)
73           {
74              new_d = new_hwc_update->hwc_drawable[i];
75              ELBF(ELBT_COMP, 0, 0, "%15.15s|  cur {d[%d]:%s set:%d} new {d[%d]:%p set:%d}",
76                   str,
77                   i, "HWOV",0,
78                   i, new_d?new_d->d:0x0,new_d?new_d->set_drawable:0);
79           }
80      }
81 }
82 #endif /* End of DEBUG_HWC*/
83
84