summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-05-28 15:59:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-25 14:36:08 +0900
commit4ade39c0ea5ef7ea3716c67841801f8eacf6c31c (patch)
tree360875f939b4f95bb5536aa17c59c9bf432c05f3 /src
parent70efb699a5c53d2e5b17fcf669ae8852a1038ce3 (diff)
Evas filters: Pass object scale to Lua state
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/filters/evas_filter_parser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/evas/filters/evas_filter_parser.c b/src/lib/evas/filters/evas_filter_parser.c
index 0972e7c..c27569d 100644
--- a/src/lib/evas/filters/evas_filter_parser.c
+++ b/src/lib/evas/filters/evas_filter_parser.c
@@ -342,6 +342,7 @@ struct _Evas_Filter_Program_State
342 } text; 342 } text;
343 struct { int a, r, g, b; } color; 343 struct { int a, r, g, b; } color;
344 int w, h; 344 int w, h;
345 double scale;
345}; 346};
346 347
347struct _Evas_Filter_Program 348struct _Evas_Filter_Program
@@ -2533,7 +2534,7 @@ _filter_program_state_set(Evas_Filter_Program *pgm)
2533 */ 2534 */
2534 2535
2535#define JOINC(k) ARGB_JOIN(pgm->state.k.a, pgm->state.k.r, pgm->state.k.g, pgm->state.k.b) 2536#define JOINC(k) ARGB_JOIN(pgm->state.k.a, pgm->state.k.r, pgm->state.k.g, pgm->state.k.b)
2536#define SETFIELD(name, val) do { lua_pushinteger(L, val); lua_setfield(L, -2, name); } while(0) 2537#define SETFIELD(name, val) do { lua_pushnumber(L, val); lua_setfield(L, -2, name); } while(0)
2537 2538
2538 // TODO: Mark program as dependent on some values so we can improve 2539 // TODO: Mark program as dependent on some values so we can improve
2539 // the changed flag (ie. re-run the filter only when required) 2540 // the changed flag (ie. re-run the filter only when required)
@@ -2543,6 +2544,7 @@ _filter_program_state_set(Evas_Filter_Program *pgm)
2543 lua_newtable(L); // "state" 2544 lua_newtable(L); // "state"
2544 { 2545 {
2545 SETFIELD("color", JOINC(color)); 2546 SETFIELD("color", JOINC(color));
2547 SETFIELD("scale", pgm->state.scale);
2546 lua_newtable(L); // "text" 2548 lua_newtable(L); // "text"
2547 { 2549 {
2548 SETFIELD("outline", JOINC(text.outline)); 2550 SETFIELD("outline", JOINC(text.outline));
@@ -2765,6 +2767,7 @@ evas_filter_program_new(const char *name, Eina_Bool input_alpha)
2765 pgm->state.color.g = 255; 2767 pgm->state.color.g = 255;
2766 pgm->state.color.b = 255; 2768 pgm->state.color.b = 255;
2767 pgm->state.color.a = 255; 2769 pgm->state.color.a = 255;
2770 pgm->state.scale = 1.0;
2768 2771
2769 return pgm; 2772 return pgm;
2770} 2773}
@@ -2781,6 +2784,7 @@ evas_filter_program_state_set(Evas_Filter_Program *pgm, Evas_Object *eo_obj,
2781 2784
2782 pgm->state.w = obj->cur->geometry.w; 2785 pgm->state.w = obj->cur->geometry.w;
2783 pgm->state.h = obj->cur->geometry.h; 2786 pgm->state.h = obj->cur->geometry.h;
2787 pgm->state.scale = obj->cur->scale;
2784 2788
2785 eo_do(eo_obj, 2789 eo_do(eo_obj,
2786 efl_gfx_color_get(&pgm->state.color.r, 2790 efl_gfx_color_get(&pgm->state.color.r,