summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-06-23 12:21:20 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-25 14:36:09 +0900
commit15afea293ffeeba7a7157b6663e0fdeb28c15e61 (patch)
treedfbc149ab6b3add14624ea4d9b11877715959557 /src/lib/evas
parent0df37da435150bc84ae46e77cb9949e6ca489ada (diff)
Edje & evas filters: Properly pass data from EDC to Lua
Also fix a few issues
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/canvas/evas_filter.eo1
-rw-r--r--src/lib/evas/canvas/evas_filter_mixin.c4
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c28
3 files changed, 22 insertions, 11 deletions
diff --git a/src/lib/evas/canvas/evas_filter.eo b/src/lib/evas/canvas/evas_filter.eo
index 2750e10..b461de9 100644
--- a/src/lib/evas/canvas/evas_filter.eo
+++ b/src/lib/evas/canvas/evas_filter.eo
@@ -65,6 +65,7 @@ mixin Evas.Filter (Efl.Gfx.Filter)
65 Efl.Gfx.Filter.padding.get; 65 Efl.Gfx.Filter.padding.get;
66 Efl.Gfx.Filter.source_set; 66 Efl.Gfx.Filter.source_set;
67 Efl.Gfx.Filter.source_get; 67 Efl.Gfx.Filter.source_get;
68 Efl.Gfx.Filter.data_set;
68 @virtual .input_alpha; 69 @virtual .input_alpha;
69 @virtual .input_render; 70 @virtual .input_render;
70 @virtual .dirty; 71 @virtual .dirty;
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c
index 5a76b1e..5c47468 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -520,7 +520,7 @@ _evas_filter_efl_gfx_filter_data_set(Eo *obj EINA_UNUSED, Evas_Filter_Data *pd,
520 return; 520 return;
521 } 521 }
522 522
523 EINA_COW_WRITE_BEGIN(evas_object_filter_cow, fcow, Evas_Object_Filter_Data, fcow) 523 EINA_COW_WRITE_BEGIN(evas_object_filter_cow, pd->data, Evas_Object_Filter_Data, fcow)
524 { 524 {
525 if (!fcow->data) 525 if (!fcow->data)
526 fcow->data = eina_hash_string_small_new(free); 526 fcow->data = eina_hash_string_small_new(free);
@@ -529,7 +529,7 @@ _evas_filter_efl_gfx_filter_data_set(Eo *obj EINA_UNUSED, Evas_Filter_Data *pd,
529 evas_filter_program_data_set_all(fcow->chain, fcow->data); 529 evas_filter_program_data_set_all(fcow->chain, fcow->data);
530 fcow->changed = 1; 530 fcow->changed = 1;
531 } 531 }
532 EINA_COW_WRITE_END(evas_object_filter_cow, fcow, fcow); 532 EINA_COW_WRITE_END(evas_object_filter_cow, pd->data, fcow);
533} 533}
534 534
535#include "evas_filter.eo.c" 535#include "evas_filter.eo.c"
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 2352d5d..58f75b8 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -2570,7 +2570,7 @@ _legacy_strdup(const char *str)
2570} 2570}
2571#endif 2571#endif
2572 2572
2573static void 2573static Eina_Bool
2574_filter_program_state_set(Evas_Filter_Program *pgm) 2574_filter_program_state_set(Evas_Filter_Program *pgm)
2575{ 2575{
2576 lua_State *L = pgm->L; 2576 lua_State *L = pgm->L;
@@ -2646,8 +2646,12 @@ _filter_program_state_set(Evas_Filter_Program *pgm)
2646 { 2646 {
2647 if ((value[0] == '-') && (value[1] == '-') && value[2] == '\n') 2647 if ((value[0] == '-') && (value[1] == '-') && value[2] == '\n')
2648 { 2648 {
2649 int i = luaL_dostring(L, value); 2649 if (luaL_dostring(L, value) != 0)
2650 ERR("i %d", i); 2650 {
2651 eina_iterator_free(it);
2652 ERR("Failed to run value: %s", lua_tostring(L, -1));
2653 return EINA_FALSE;
2654 }
2651 } 2655 }
2652 else 2656 else
2653 { 2657 {
@@ -2658,17 +2662,20 @@ _filter_program_state_set(Evas_Filter_Program *pgm)
2658 else 2662 else
2659 { 2663 {
2660 lua_pushnil(L); 2664 lua_pushnil(L);
2665 lua_setglobal(L, name);
2661 } 2666 }
2662 } 2667 }
2663 eina_iterator_free(it); 2668 eina_iterator_free(it);
2664 } 2669 }
2665 2670
2671 return EINA_TRUE;
2672
2666#undef JOINC 2673#undef JOINC
2667#undef SETFIELD 2674#undef SETFIELD
2668#undef SETCOLOR 2675#undef SETCOLOR
2669} 2676}
2670 2677
2671static void 2678static Eina_Bool
2672_filter_program_reset(Evas_Filter_Program *pgm) 2679_filter_program_reset(Evas_Filter_Program *pgm)
2673{ 2680{
2674 Evas_Filter_Instruction *instr; 2681 Evas_Filter_Instruction *instr;
@@ -2696,7 +2703,7 @@ _filter_program_reset(Evas_Filter_Program *pgm)
2696 _filter_program_buffers_set(pgm); 2703 _filter_program_buffers_set(pgm);
2697 2704
2698 // Reset state table 2705 // Reset state table
2699 _filter_program_state_set(pgm); 2706 return _filter_program_state_set(pgm);
2700} 2707}
2701 2708
2702/** Parse a style program */ 2709/** Parse a style program */
@@ -2733,10 +2740,13 @@ evas_filter_program_parse(Evas_Filter_Program *pgm, const char *str)
2733 if (ok) 2740 if (ok)
2734 { 2741 {
2735 pgm->lua_func = luaL_ref(L, LUA_REGISTRYINDEX); 2742 pgm->lua_func = luaL_ref(L, LUA_REGISTRYINDEX);
2736 _filter_program_reset(pgm); 2743 ok =_filter_program_reset(pgm);
2737 lua_getglobal(L, _lua_errfunc_name); 2744 if (ok)
2738 lua_rawgeti(L, LUA_REGISTRYINDEX, pgm->lua_func); 2745 {
2739 ok = !lua_pcall(L, 0, LUA_MULTRET, -2); 2746 lua_getglobal(L, _lua_errfunc_name);
2747 lua_rawgeti(L, LUA_REGISTRYINDEX, pgm->lua_func);
2748 ok = !lua_pcall(L, 0, LUA_MULTRET, -2);
2749 }
2740 } 2750 }
2741 2751
2742 if (!ok) 2752 if (!ok)