summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-02-05 15:34:28 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-07 17:33:18 +0900
commite112d49e0b73e9a081aa515141582ff42d74afd5 (patch)
treef40bea4a3aa098b496db7ba1f02b94784d1909dc /src
parent748501a5aff003d1a26b383f36aec0e05d367ee5 (diff)
Evas filters: Check that program code changes before updating
Save the code and compare with the new one. This way we can safely call program_set from the edje_calc functions.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_object_text.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 7d9d7fea3e..cecc4022df 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -47,6 +47,7 @@ struct _Evas_Object_Text
47 47
48 // special effects. VERY EXPERIMENTAL for now. 48 // special effects. VERY EXPERIMENTAL for now.
49 struct { 49 struct {
50 Eina_Stringshare *code;
50 Evas_Filter_Program *chain; 51 Evas_Filter_Program *chain;
51 Eina_Hash *sources; 52 Eina_Hash *sources;
52 void *output; 53 void *output;
@@ -1981,6 +1982,7 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
1981 o->cur.filter.output = NULL; 1982 o->cur.filter.output = NULL;
1982 } 1983 }
1983 evas_filter_program_del(o->cur.filter.chain); 1984 evas_filter_program_del(o->cur.filter.chain);
1985 eina_stringshare_del(o->cur.filter.code);
1984 o->cur.filter.chain = NULL; 1986 o->cur.filter.chain = NULL;
1985 1987
1986 /* free obj */ 1988 /* free obj */
@@ -2696,6 +2698,8 @@ _filter_program_set(Eo *eo_obj, void *_pd, va_list *list)
2696 Evas_Filter_Program *pgm = NULL; 2698 Evas_Filter_Program *pgm = NULL;
2697 2699
2698 if (!o) return; 2700 if (!o) return;
2701 if (o->cur.filter.code == arg) return;
2702 if (o->cur.filter.code && arg && !strcmp(arg, o->cur.filter.code)) return;
2699 2703
2700 // Parse filter program 2704 // Parse filter program
2701 evas_filter_program_del(o->cur.filter.chain); 2705 evas_filter_program_del(o->cur.filter.chain);
@@ -2712,6 +2716,7 @@ _filter_program_set(Eo *eo_obj, void *_pd, va_list *list)
2712 } 2716 }
2713 o->cur.filter.chain = pgm; 2717 o->cur.filter.chain = pgm;
2714 o->cur.filter.changed = EINA_TRUE; 2718 o->cur.filter.changed = EINA_TRUE;
2719 eina_stringshare_replace(&o->cur.filter.code, arg);
2715 2720
2716 // Update object 2721 // Update object
2717 obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS); 2722 obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);