Summary:
Whenever _edje_recalc_do() is called, a state value of
Edje structure is increased. This increased value will be stored
in Edje_Real_Part and Edje_Real_Part_State for calculation optimazation.
But, once the state value is overflowed, it ruins calculation logic.
@fix
Test Plan:
Run an Edje file which has infinite animation for over an hour.
I'll attach an example to phab.
Reviewers: raster, cedric, woohyun, Hermet
Reviewed By: Hermet
Subscribers: #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7264
Change-Id: If4d941fa9e5496fdd694625d7f4c1f36b2345abb
Signed-off-by: Youngbok Shin <youngb.shin@samsung.com>
{
unsigned short i;
Eina_Bool need_calc;
+#ifdef EDJE_CALC_CACHE
+ Eina_Bool need_reinit_state = EINA_FALSE;
+#endif
// XXX: dont need this with current smart calc infra. remove me later
// ed->postponed = EINA_FALSE;
if (!ed->dirty) return;
ed->dirty = EINA_FALSE;
ed->state++;
+
+ /* Avoid overflow problem */
+ if (ed->state == USHRT_MAX)
+ {
+ ed->state = 0;
+#ifdef EDJE_CALC_CACHE
+ need_reinit_state = EINA_TRUE;
+#endif
+ }
+
for (i = 0; i < ed->table_parts_size; i++)
{
Edje_Real_Part *ep;
ep = ed->table_parts[i];
ep->calculated = FLAG_NONE; // FIXME: this is dubious (see below)
ep->calculating = FLAG_NONE;
+#ifdef EDJE_CALC_CACHE
+ if (need_reinit_state)
+ {
+ ep->state = 0;
+ ep->param1.state = 0;
+ if (ep->param2)
+ ep->param2->state = 0;
+ }
+#endif
}
for (i = 0; i < ed->table_parts_size; i++)
{