summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-02-05 11:40:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-02-07 17:33:18 +0900
commit8570b38dd16ac9930b6a5f925a6f38eff37f2e90 (patch)
tree442f0131bd6c8543dd96c73073319f5321fa2cae /src/lib
parent7043c8bb89dfe8a9740a5a2a4d759664c534b766 (diff)
Evas filters: Rename bind to source_set
Because that's what we call it for proxy images :)
Diffstat (limited to '')
-rw-r--r--src/lib/evas/Evas_Eo.h16
-rw-r--r--src/lib/evas/canvas/evas_object_text.c13
-rw-r--r--src/lib/evas/filters/evas_filter.c2
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c39
-rw-r--r--src/lib/evas/filters/evas_filter_private.h2
-rw-r--r--src/lib/evas/include/evas_filter.h5
6 files changed, 56 insertions, 21 deletions
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index 0ef522e8e1..69878f573c 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -1847,7 +1847,7 @@ enum
1847 EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_SET, 1847 EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_SET,
1848 EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_GET, 1848 EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_GET,
1849 EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET, 1849 EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET,
1850 EVAS_OBJ_TEXT_SUB_ID_FILTER_OBJECT_BIND, 1850 EVAS_OBJ_TEXT_SUB_ID_FILTER_SOURCE_SET,
1851 EVAS_OBJ_TEXT_SUB_ID_LAST 1851 EVAS_OBJ_TEXT_SUB_ID_LAST
1852}; 1852};
1853 1853
@@ -2281,11 +2281,17 @@ enum
2281#define evas_obj_text_filter_program_set(str) EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET), EO_TYPECHECK(const char *, str) 2281#define evas_obj_text_filter_program_set(str) EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET), EO_TYPECHECK(const char *, str)
2282 2282
2283/** 2283/**
2284 * @def evas_obj_text_filter_object_bind 2284 *
2285 * @since 1.9 2285 * Bind an object to use as a mask or texture in special filter
2286 * @note EXPERIMENTAL code 2286 *
2287 * @param[in] name Object name as used in the program code
2288 * @param[in] obj Eo object to use through proxy rendering
2289 *
2290 * @see evas_obj_text_filter_program_set
2291 *
2292 * @note EXPERIMENTAL FEATURE.
2287 */ 2293 */
2288#define evas_obj_text_filter_object_bind(str, prxy) EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_OBJECT_BIND), EO_TYPECHECK(const char *, str), EO_TYPECHECK(Eo *, prxy) 2294#define evas_obj_text_filter_source_set(name, obj) EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_SOURCE_SET), EO_TYPECHECK(const char *, name), EO_TYPECHECK(Eo *, obj)
2289 2295
2290/** 2296/**
2291 * @} 2297 * @}
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index e6a9edb13c..a7bb4c61f3 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -2227,11 +2227,10 @@ evas_object_text_render(Evas_Object *eo_obj EINA_UNUSED,
2227 evas_filter_run(filter); 2227 evas_filter_run(filter);
2228 o->cur.filter.changed = EINA_FALSE; 2228 o->cur.filter.changed = EINA_FALSE;
2229 2229
2230 INF("Effect rendering done. Return."); 2230 DBG("Effect rendering done.");
2231 return; 2231 return;
2232 } 2232 }
2233 2233
2234
2235 /* End of the EXPERIMENTAL code */ 2234 /* End of the EXPERIMENTAL code */
2236 2235
2237normal_render: 2236normal_render:
@@ -2703,7 +2702,7 @@ _filter_program_set(Eo *eo_obj, void *_pd, va_list *list)
2703 if (arg) 2702 if (arg)
2704 { 2703 {
2705 pgm = evas_filter_program_new("Evas_Text: Filter Program"); 2704 pgm = evas_filter_program_new("Evas_Text: Filter Program");
2706 evas_filter_program_proxy_source_bind_all(pgm, o->cur.filter.sources); 2705 evas_filter_program_source_set_all(pgm, o->cur.filter.sources);
2707 if (!evas_filter_program_parse(pgm, arg)) 2706 if (!evas_filter_program_parse(pgm, arg))
2708 { 2707 {
2709 ERR("Parsing failed!"); 2708 ERR("Parsing failed!");
@@ -2726,7 +2725,7 @@ _filter_program_set(Eo *eo_obj, void *_pd, va_list *list)
2726} 2725}
2727 2726
2728static void 2727static void
2729_filter_object_bind(Eo *eo_obj, void *_pd, va_list *list) 2728_filter_source_set(Eo *eo_obj, void *_pd, va_list *list)
2730{ 2729{
2731 Evas_Object_Text *o = _pd; 2730 Evas_Object_Text *o = _pd;
2732 Evas_Object_Protected_Data *obj; 2731 Evas_Object_Protected_Data *obj;
@@ -2749,7 +2748,7 @@ _filter_object_bind(Eo *eo_obj, void *_pd, va_list *list)
2749 return; 2748 return;
2750 } 2749 }
2751 2750
2752 evas_filter_program_proxy_source_bind(pgm, name, proxy); 2751 evas_filter_program_source_set(pgm, name, proxy);
2753 o->cur.filter.changed = EINA_TRUE; 2752 o->cur.filter.changed = EINA_TRUE;
2754 2753
2755 // Update object 2754 // Update object
@@ -2806,7 +2805,7 @@ _class_constructor(Eo_Class *klass)
2806 EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_SET), _text_ellipsis_set), 2805 EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_SET), _text_ellipsis_set),
2807 EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_GET), _text_ellipsis_get), 2806 EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_GET), _text_ellipsis_get),
2808 EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET), _filter_program_set), 2807 EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET), _filter_program_set),
2809 EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_OBJECT_BIND), _filter_object_bind), 2808 EO_OP_FUNC(EVAS_OBJ_TEXT_ID(EVAS_OBJ_TEXT_SUB_ID_FILTER_SOURCE_SET), _filter_source_set),
2810 EO_OP_FUNC_SENTINEL 2809 EO_OP_FUNC_SENTINEL
2811 }; 2810 };
2812 eo_class_funcs_set(klass, func_desc); 2811 eo_class_funcs_set(klass, func_desc);
@@ -2845,7 +2844,7 @@ static const Eo_Op_Description op_desc[] = {
2845 EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_SET, "Gets the ellipsis of a text object."), 2844 EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_SET, "Gets the ellipsis of a text object."),
2846 EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_GET, "Sets the ellipsis of a text object."), 2845 EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_ELLIPSIS_GET, "Sets the ellipsis of a text object."),
2847 EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET, "Text special effects: Set the style program (string)."), 2846 EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_FILTER_PROGRAM_SET, "Text special effects: Set the style program (string)."),
2848 EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_FILTER_OBJECT_BIND, "Text special effects: Bind an Evas_Object to a name for proxy rendering."), 2847 EO_OP_DESCRIPTION(EVAS_OBJ_TEXT_SUB_ID_FILTER_SOURCE_SET, "Text special effects: Bind an Evas_Object to a name for proxy rendering."),
2849 EO_OP_DESCRIPTION_SENTINEL 2848 EO_OP_DESCRIPTION_SENTINEL
2850}; 2849};
2851static const Eo_Class_Description class_desc = { 2850static const Eo_Class_Description class_desc = {
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index 1d41f939e3..0811bd6701 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -122,7 +122,7 @@ _filter_buffer_backing_free(Evas_Filter_Buffer *fb)
122 122
123/** @hidden private bind proxy to context */ 123/** @hidden private bind proxy to context */
124void 124void
125evas_filter_context_proxy_bind(Evas_Filter_Context *ctx, Evas_Object *eo_proxy, 125evas_filter_context_source_set(Evas_Filter_Context *ctx, Evas_Object *eo_proxy,
126 Evas_Object *eo_source, int bufid, 126 Evas_Object *eo_source, int bufid,
127 Eina_Stringshare *name) 127 Eina_Stringshare *name)
128{ 128{
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 04298b3024..5c99384dac 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -1380,8 +1380,8 @@ evas_filter_program_new(const char *name)
1380/** Bind an object for proxy rendering */ 1380/** Bind an object for proxy rendering */
1381 1381
1382void 1382void
1383evas_filter_program_proxy_source_bind(Evas_Filter_Program *pgm, 1383evas_filter_program_source_set(Evas_Filter_Program *pgm,
1384 const char *name, Evas_Object *object) 1384 const char *name, Evas_Object *object)
1385{ 1385{
1386 Evas_Object *old; 1386 Evas_Object *old;
1387 1387
@@ -1392,10 +1392,39 @@ evas_filter_program_proxy_source_bind(Evas_Filter_Program *pgm,
1392 eina_hash_add(pgm->proxies, name, object); 1392 eina_hash_add(pgm->proxies, name, object);
1393} 1393}
1394 1394
1395void
1396evas_filter_program_source_set_all(Evas_Filter_Program *pgm,
1397 Eina_Hash *proxies)
1398{
1399 Eina_Hash_Tuple *tuple;
1400 Eina_Iterator *it;
1401 Evas_Object *old;
1402
1403 if (!pgm || !proxies) return;
1404
1405 it = eina_hash_iterator_tuple_new(proxies);
1406 EINA_ITERATOR_FOREACH(it, tuple)
1407 {
1408 Eina_Stringshare *name = tuple->key;
1409 Eo *source = tuple->data;
1410
1411 old = eina_hash_find(pgm->proxies, name);
1412 if (old)
1413 {
1414 INF("Buffer %s already exists, skipping proxy source.", name);
1415 continue;
1416 }
1417
1418 INF("Binding object %p as '%s'", source, name);
1419 evas_filter_program_source_set(pgm, name, source);
1420 }
1421 eina_iterator_free(it);
1422}
1423
1395/** Get object used for proxy rendering */ 1424/** Get object used for proxy rendering */
1396 1425
1397Evas_Object * 1426Evas_Object *
1398evas_filter_program_proxy_source_get(Evas_Filter_Program *pgm, const char *name) 1427evas_filter_program_source_get(Evas_Filter_Program *pgm, const char *name)
1399{ 1428{
1400 return (Evas_Object *) eina_hash_find(pgm->proxies, name); 1429 return (Evas_Object *) eina_hash_find(pgm->proxies, name);
1401} 1430}
@@ -1838,8 +1867,8 @@ evas_filter_context_program_use(Evas_Filter_Context *ctx, Evas_Object *eo_obj,
1838 buf->cid = evas_filter_buffer_empty_new(ctx, buf->alpha); 1867 buf->cid = evas_filter_buffer_empty_new(ctx, buf->alpha);
1839 if (buf->proxy) 1868 if (buf->proxy)
1840 { 1869 {
1841 Eo *eo_source = evas_filter_program_proxy_source_get(pgm, buf->proxy); 1870 Eo *eo_source = evas_filter_program_source_get(pgm, buf->proxy);
1842 evas_filter_context_proxy_bind(ctx, eo_obj, eo_source, buf->cid, buf->proxy); 1871 evas_filter_context_source_set(ctx, eo_obj, eo_source, buf->cid, buf->proxy);
1843 } 1872 }
1844 } 1873 }
1845 1874
diff --git a/src/lib/evas/filters/evas_filter_private.h b/src/lib/evas/filters/evas_filter_private.h
index f6ecc569f0..b3c0539981 100644
--- a/src/lib/evas/filters/evas_filter_private.h
+++ b/src/lib/evas/filters/evas_filter_private.h
@@ -167,7 +167,7 @@ enum _Evas_Filter_Interpolation_Mode
167}; 167};
168 168
169void evas_filter_context_clear(Evas_Filter_Context *ctx); 169void evas_filter_context_clear(Evas_Filter_Context *ctx);
170void evas_filter_context_proxy_bind(Evas_Filter_Context *ctx, Evas_Object *eo_proxy, Evas_Object *eo_source, int bufid, Eina_Stringshare *name); 170void evas_filter_context_source_set(Evas_Filter_Context *ctx, Evas_Object *eo_proxy, Evas_Object *eo_source, int bufid, Eina_Stringshare *name);
171 171
172/* FIXME: CPU filters entry points. Move these to the Evas Engine itself. */ 172/* FIXME: CPU filters entry points. Move these to the Evas Engine itself. */
173Evas_Filter_Apply_Func evas_filter_blend_cpu_func_get(Evas_Filter_Command *cmd); 173Evas_Filter_Apply_Func evas_filter_blend_cpu_func_get(Evas_Filter_Command *cmd);
diff --git a/src/lib/evas/include/evas_filter.h b/src/lib/evas/include/evas_filter.h
index 12d62c8613..453cd53d83 100644
--- a/src/lib/evas/include/evas_filter.h
+++ b/src/lib/evas/include/evas_filter.h
@@ -95,8 +95,9 @@ Eina_Bool evas_filter_program_parse(Evas_Filter_Program *pgm, con
95void evas_filter_program_del(Evas_Filter_Program *pgm); 95void evas_filter_program_del(Evas_Filter_Program *pgm);
96Eina_Bool evas_filter_context_program_use(Evas_Filter_Context *ctx, Evas_Object *eo_obj, Evas_Filter_Program *pgm); 96Eina_Bool evas_filter_context_program_use(Evas_Filter_Context *ctx, Evas_Object *eo_obj, Evas_Filter_Program *pgm);
97Eina_Bool evas_filter_program_padding_get(Evas_Filter_Program *pgm, int *l, int *r, int *t, int *b); 97Eina_Bool evas_filter_program_padding_get(Evas_Filter_Program *pgm, int *l, int *r, int *t, int *b);
98void evas_filter_program_proxy_source_bind(Evas_Filter_Program *pgm, const char *name, Evas_Object *object); 98void evas_filter_program_source_set(Evas_Filter_Program *pgm, const char *name, Evas_Object *object);
99Evas_Object *evas_filter_program_proxy_source_get(Evas_Filter_Program *pgm, const char *name); 99void evas_filter_program_source_set_all(Evas_Filter_Program *pgm, Eina_Hash *sources);
100Evas_Object *evas_filter_program_source_get(Evas_Filter_Program *pgm, const char *name);
100void evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj, Eina_Bool do_async); 101void evas_filter_context_proxy_render_all(Evas_Filter_Context *ctx, Eo *eo_obj, Eina_Bool do_async);
101 102
102/* Filter context (low level) */ 103/* Filter context (low level) */