[*]Rollback to evas_1.0.0.001+svn.62695slp2+build18.
authorDaniel Juyung Seo <juyung.seo@samsung.com>
Fri, 16 Sep 2011 02:05:59 +0000 (11:05 +0900)
committerDaniel Juyung Seo <juyung.seo@samsung.com>
Fri, 16 Sep 2011 02:05:59 +0000 (11:05 +0900)
src/lib/Evas.h
src/lib/canvas/evas_main.c
src/lib/canvas/evas_object_smart.c
src/lib/include/evas_private.h

index 8a898a0..6af9873 100644 (file)
@@ -9753,24 +9753,6 @@ EAPI void              evas_object_smart_calculate       (Evas_Object *obj) EINA
 EAPI void              evas_smart_objects_calculate      (Evas *e);
 
 /**
- * This gets the internal counter that counts the number of smart calculations
- * 
- * @param e The canvas to get the calculate counter from
- * 
- * Whenever evas performs smart object calculations on the whole canvas
- * it increments a counter by 1. This is the smart object calculate counter
- * that this function returns the value of. It starts at the value of 0 and
- * will increase (and eventually wrap around to negative values and so on) by
- * 1 every time objects are calculated. You can use this counter to ensure
- * you dont re-do calculations withint the same calculation generation/run
- * if the calculations maybe cause self-feeding effects.
- * 
- * @ingroup Evas_Smart_Object_Group
- * @since 1.1
- */
-EAPI int               evas_smart_objects_calculate_count_get (const Evas *e);
-   
-/**
  * Moves all children objects of a given smart object relative to a
  * given offset.
  *
index 05fce4f..54e0679 100644 (file)
@@ -122,7 +122,7 @@ evas_new(void)
    e->name_hash = eina_hash_string_superfast_new(NULL);
 
 #define EVAS_ARRAY_SET(E, Array)               \
-   eina_array_step_set(&E->Array, sizeof (E->Array), 4096);
+   eina_array_step_set(&E->Array, sizeof (E->Array), 256);
 
    EVAS_ARRAY_SET(e, delete_objects);
    EVAS_ARRAY_SET(e, active_objects);
@@ -249,8 +249,6 @@ evas_free(Evas *e)
    eina_array_flush(&e->calculate_objects);
    eina_array_flush(&e->clip_changes);
 
-   eina_list_free(e->calc_list);
-   
    e->magic = 0;
    free(e);
 }
index 1cdf3f2..4a305f0 100644 (file)
@@ -10,8 +10,7 @@ struct _Evas_Object_Smart
    void             *engine_data;
    void             *data;
    Eina_List        *callbacks;
-   Eina_Inlist      *contained;
-   Eina_List        *calc_node;
+   Eina_Inlist *contained;
    Evas_Smart_Cb_Description_Array callbacks_descriptions;
    int               walking_list;
    Eina_Bool         deletions_waiting : 1;
@@ -549,49 +548,32 @@ evas_object_smart_need_recalculate_set(Evas_Object *obj, Eina_Bool value)
    return;
    MAGIC_CHECK_END();
 
-   // XXX: do i need this?
-   if (obj->delete_me) return;
-      
    value = !!value;
-   if (value)
-     {
-        Evas *e = obj->layer->evas;
-        
-        if (o->need_recalculate)
-          {
-             if ((o->calc_node) && (e->calc_list_current != o->calc_node))
-                e->calc_list = eina_list_demote_list(e->calc_list,
-                                                     o->calc_node);
-             else
-                e->calc_list = eina_list_append(e->calc_list, obj);
-          }
-        else
-           e->calc_list = eina_list_append(e->calc_list, obj);
-        o->calc_node = eina_list_last(e->calc_list);
-      }
-   else
-     {
-        Evas *e = obj->layer->evas;
-        
-        if (o->need_recalculate)
-          {
-             if ((o->calc_node) && (e->calc_list_current != o->calc_node))
-                e->calc_list = eina_list_remove_list(e->calc_list,
-                                                     o->calc_node);
-             o->calc_node = NULL;
-             
-          }
-      }
-   
-   if (o->need_recalculate == value) return;
+   if (o->need_recalculate == value)
+     return;
 
    if (obj->recalculate_cycle > 64)
      {
         ERR("Object %p is not stable during recalc loop", obj);
-        return;
+        return ;
      }
-   if (obj->layer->evas->in_smart_calc) obj->recalculate_cycle++;
+   if (obj->layer->evas->in_smart_calc)
+     obj->recalculate_cycle++;
    o->need_recalculate = value;
+
+   if (!obj->smart.smart->smart_class->calculate) return;
+
+   /* XXX: objects can be present multiple times in calculate_objects()
+    * XXX: after a set-unset-set cycle, but it's not a problem since
+    * XXX: on _evas_render_call_smart_calculate() will check for the flag
+    * XXX: and it will be unset after the first.
+    */
+   if (o->need_recalculate)
+     {
+        Evas *e = obj->layer->evas;
+        eina_array_push(&e->calculate_objects, obj);
+     }
+   /* TODO: else, remove from array */
 }
 
 EAPI Eina_Bool
@@ -637,15 +619,6 @@ evas_smart_objects_calculate(Evas *e)
    evas_call_smarts_calculate(e);
 }
 
-EAPI int
-evas_smart_objects_calculate_count_get(const Evas *e)
-{
-   MAGIC_CHECK(e, Evas, MAGIC_EVAS);
-   return 0;
-   MAGIC_CHECK_END();
-   return e->smart_calc_count;
-}
-
 /**
  * Call calculate() on all smart objects that need_recalculate.
  *
@@ -654,37 +627,34 @@ evas_smart_objects_calculate_count_get(const Evas *e)
 void
 evas_call_smarts_calculate(Evas *e)
 {
+   Eina_Array *calculate;
    Evas_Object *obj;
-   Eina_List *l;
+   Eina_Array_Iterator it;
+   unsigned int i;
 
-//   printf("+CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------v\n");
-   evas_event_freeze(e);
    e->in_smart_calc++;
-   
-   EINA_LIST_FOREACH(e->calc_list, l, obj)
+   calculate = &e->calculate_objects;
+   for (i = 0; i < eina_array_count_get(calculate); ++i)
      {
-        Evas_Object_Smart *o = obj->object_data;
-        
-        if (obj->delete_me) continue;
-        e->calc_list_current = l;
+        Evas_Object_Smart *o;
+
+        obj = eina_array_data_get(calculate, i);
+        if (obj->delete_me)
+          continue;
+
+        o = obj->object_data;
         if (o->need_recalculate)
           {
              o->need_recalculate = 0;
              obj->smart.smart->smart_class->calculate(obj);
           }
-        if (o->calc_node == l) o->calc_node = NULL;
-        e->calc_list_current = NULL;
      }
-   EINA_LIST_FREE(e->calc_list, obj)
+   EINA_ARRAY_ITER_NEXT(calculate, i, obj, it)
      {
         obj->recalculate_cycle = 0;
      }
-   e->calc_list_current = NULL;
    e->in_smart_calc--;
-   if (e->in_smart_calc == 0) e->smart_calc_count++;
-   evas_event_thaw(e);
-   evas_event_thaw_eval(e);
-//   printf("-CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALC-----------^\n");
+   if (e->in_smart_calc == 0) eina_array_clean(calculate);
 }
 
 EAPI void
@@ -745,19 +715,13 @@ evas_object_smart_cleanup(Evas_Object *obj)
    o = (Evas_Object_Smart *)(obj->object_data);
    if (o->magic == MAGIC_OBJ_SMART)
      {
-        Evas *e = obj->layer->evas;
-
-        if ((o->calc_node) && (e->calc_list_current != o->calc_node))
-           e->calc_list = eina_list_remove_list(e->calc_list, 
-                                                o->calc_node);
-        o->calc_node = NULL;
         while (o->contained)
-           evas_object_smart_member_del((Evas_Object *)o->contained);
+          evas_object_smart_member_del((Evas_Object *)o->contained);
 
         while (o->callbacks)
           {
              Evas_Smart_Callback *cb;
-             
+
              cb = o->callbacks->data;
              o->callbacks = eina_list_remove(o->callbacks, cb);
              if (cb->event) eina_stringshare_del(cb->event);
index 7eeee99..d20d0f5 100644 (file)
@@ -304,9 +304,6 @@ struct _Evas
    Eina_Array     temporary_objects;
    Eina_Array     calculate_objects;
    Eina_Array     clip_changes;
-   
-   Eina_List     *calc_list;
-   Eina_List     *calc_list_current;
 
    Eina_List     *post_events; // free me on evas_free
 
@@ -319,7 +316,6 @@ struct _Evas
    Eina_List     *font_path;
 
    int            in_smart_calc;
-   int            smart_calc_count;
 
    Evas_Object   *focused;
    void          *attach_data;