summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_filter_mixin.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-06-19 17:38:28 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-25 14:36:09 +0900
commit84e3dd5c34f3ee7a8f07311eab6c950d1c76ea51 (patch)
tree5541d3fced9648bb2380002d0d6b5ba5477fd8e5 /src/lib/evas/canvas/evas_filter_mixin.c
parent29402b2ce965c83cdcbfa29ac08b918ab01d95d2 (diff)
Evas filters: Add name to the filters
Deep down internally there was already a name, but no API could really set it properly. Here Edje will set the name of the filter based on the part name or the data item name if relevant.
Diffstat (limited to 'src/lib/evas/canvas/evas_filter_mixin.c')
-rw-r--r--src/lib/evas/canvas/evas_filter_mixin.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c
index 243b359..87454a7 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -121,7 +121,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
121 if (!fcow->chain) 121 if (!fcow->chain)
122 { 122 {
123 Evas_Filter_Program *pgm; 123 Evas_Filter_Program *pgm;
124 pgm = evas_filter_program_new(obj->name ? obj->name : obj->type, alpha); 124 pgm = evas_filter_program_new(fcow->name, alpha);
125 evas_filter_program_source_set_all(pgm, fcow->sources); 125 evas_filter_program_source_set_all(pgm, fcow->sources);
126 evas_filter_program_state_set(pgm, eo_obj, obj, 126 evas_filter_program_state_set(pgm, eo_obj, obj,
127 fcow->state.cur.name, fcow->state.cur.value, 127 fcow->state.cur.name, fcow->state.cur.value,
@@ -252,25 +252,27 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
252 252
253EOLIAN void 253EOLIAN void
254_evas_filter_efl_gfx_filter_program_set(Eo *eo_obj, Evas_Filter_Data *pd, 254_evas_filter_efl_gfx_filter_program_set(Eo *eo_obj, Evas_Filter_Data *pd,
255 const char *code) 255 const char *code, const char *name)
256{ 256{
257 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); 257 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
258 Evas_Filter_Program *pgm = NULL; 258 Evas_Filter_Program *pgm = NULL;
259 Eina_Bool alpha; 259 Eina_Bool alpha;
260 260
261 if (!pd) return; 261 if (!pd) return;
262 if (pd->data->code == code) return; 262 if ((pd->data->code == code) && (!name || (pd->data->name == name))) return;
263 if (pd->data->code && code && !strcmp(code, pd->data->code)) return; 263 if (pd->data->code && code && !strcmp(code, pd->data->code) &&
264 pd->data->name && name && !strcmp(name, pd->data->name)) return;
264 265
265 evas_object_async_block(obj); 266 evas_object_async_block(obj);
266 EINA_COW_WRITE_BEGIN(evas_object_filter_cow, pd->data, Evas_Object_Filter_Data, fcow) 267 EINA_COW_WRITE_BEGIN(evas_object_filter_cow, pd->data, Evas_Object_Filter_Data, fcow)
267 { 268 {
268 // Parse filter program 269 // Parse filter program
269 evas_filter_program_del(fcow->chain); 270 evas_filter_program_del(fcow->chain);
271 eina_stringshare_replace(&fcow->name, name);
270 if (code) 272 if (code)
271 { 273 {
272 alpha = eo_do_ret(eo_obj, alpha, evas_filter_input_alpha()); 274 alpha = eo_do_ret(eo_obj, alpha, evas_filter_input_alpha());
273 pgm = evas_filter_program_new("Evas.Filter", alpha); 275 pgm = evas_filter_program_new(fcow->name, alpha);
274 evas_filter_program_source_set_all(pgm, fcow->sources); 276 evas_filter_program_source_set_all(pgm, fcow->sources);
275 evas_filter_program_state_set(pgm, eo_obj, obj, 277 evas_filter_program_state_set(pgm, eo_obj, obj,
276 fcow->state.cur.name, fcow->state.cur.value, 278 fcow->state.cur.name, fcow->state.cur.value,
@@ -298,10 +300,11 @@ _evas_filter_efl_gfx_filter_program_set(Eo *eo_obj, Evas_Filter_Data *pd,
298 evas_object_inform_call_resize(eo_obj); 300 evas_object_inform_call_resize(eo_obj);
299} 301}
300 302
301EOLIAN const char * 303EOLIAN void
302_evas_filter_efl_gfx_filter_program_get(Eo *eo_obj EINA_UNUSED, Evas_Filter_Data *pd) 304_evas_filter_efl_gfx_filter_program_get(Eo *eo_obj EINA_UNUSED, Evas_Filter_Data *pd, const char **code, const char **name)
303{ 305{
304 return pd->data->code; 306 if (code) *code = pd->data->code;
307 if (name) *name = pd->data->name;
305} 308}
306 309
307EOLIAN void 310EOLIAN void