Evas filters: Simplify evas_filter_dirty
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 2 Mar 2016 05:41:32 +0000 (14:41 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 15 Mar 2016 02:11:59 +0000 (11:11 +0900)
Objects can mark themselves as changed rather than having all this
duplicated code inside the mixin.

src/lib/evas/canvas/evas_filter_mixin.c
src/lib/evas/canvas/evas_object_image.c
src/lib/evas/canvas/evas_object_text.c

index 4d4b7ca..6461776 100644 (file)
@@ -56,10 +56,6 @@ _filter_end_sync(Evas_Filter_Context *ctx, Evas_Object_Protected_Data *obj,
         ERR("Filter failed at runtime!");
         evas_filter_invalid_set(eo_obj, EINA_TRUE);
         evas_filter_dirty(eo_obj);
-        evas_object_change(eo_obj, obj);
-        evas_object_clip_dirty(eo_obj, obj);
-        evas_object_coords_recalc(eo_obj, obj);
-        evas_object_inform_call_resize(eo_obj);
      }
    else
      {
@@ -401,12 +397,7 @@ _evas_filter_efl_gfx_filter_filter_program_set(Eo *eo_obj, Evas_Filter_Data *pd,
      }
    FCOW_END(fcow, pd);
 
-   // Update object
    evas_filter_dirty(eo_obj);
-   evas_object_change(eo_obj, obj);
-   evas_object_clip_dirty(eo_obj, obj);
-   evas_object_coords_recalc(eo_obj, obj);
-   evas_object_inform_call_resize(eo_obj);
 }
 
 EOLIAN static void
@@ -497,10 +488,6 @@ update:
      }
 
    evas_filter_dirty(eo_obj);
-   evas_object_change(eo_obj, obj);
-   evas_object_clip_dirty(eo_obj, obj);
-   evas_object_coords_recalc(eo_obj, obj);
-   evas_object_inform_call_resize(eo_obj);
 }
 
 EOLIAN static Efl_Gfx_Base *
@@ -542,12 +529,7 @@ _evas_filter_efl_gfx_filter_filter_state_set(Eo *eo_obj, Evas_Filter_Data *pd,
                                            pd->data->state.pos);
           }
 
-        // Mark as changed
         evas_filter_dirty(eo_obj);
-        evas_object_change(eo_obj, obj);
-        evas_object_clip_dirty(eo_obj, obj);
-        evas_object_coords_recalc(eo_obj, obj);
-        evas_object_inform_call_resize(eo_obj);
      }
 }
 
@@ -659,7 +641,6 @@ _evas_filter_efl_gfx_filter_filter_data_set(Eo *eo_obj, Evas_Filter_Data *pd,
                                             const char *name, const char *value,
                                             Eina_Bool execute)
 {
-   Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
    Evas_Filter_Data_Binding *db, *found = NULL;
    Evas_Object_Filter_Data *fcow;
 
@@ -701,12 +682,7 @@ _evas_filter_efl_gfx_filter_filter_data_set(Eo *eo_obj, Evas_Filter_Data *pd,
      }
    FCOW_END(fcow, pd);
 
-   // update object
    evas_filter_dirty(eo_obj);
-   evas_object_change(eo_obj, obj);
-   evas_object_clip_dirty(eo_obj, obj);
-   evas_object_coords_recalc(eo_obj, obj);
-   evas_object_inform_call_resize(eo_obj);
 }
 
 EOLIAN static void
index f3b1d77..8fd8c94 100644 (file)
@@ -3206,9 +3206,12 @@ evas_process_dirty_pixels(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj,
 }
 
 EOLIAN static void
-_evas_image_evas_filter_filter_dirty(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o)
+_evas_image_evas_filter_filter_dirty(Eo *eo_obj, Evas_Image_Data *o)
 {
+   Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
+
    o->changed = 1;
+   evas_object_change(eo_obj, obj);
 }
 
 EOLIAN static Eina_Bool
index a492ebd..186200e 100644 (file)
@@ -1665,8 +1665,11 @@ evas_font_draw_async_check(Evas_Object_Protected_Data *obj,
 EOLIAN static void
 _evas_text_evas_filter_filter_dirty(Eo *eo_obj, Evas_Text_Data *o)
 {
+   Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
+
    _evas_object_text_items_clear(o);
    o->changed = 1;
+   evas_object_change(eo_obj, obj);
    _evas_object_text_recalc(eo_obj, o->cur.text);
 }