summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/elementary/efl_ui_animation_view.c1
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.c2
-rw-r--r--src/lib/evas/include/evas_private.h1
-rw-r--r--src/static_libs/vg_common/vg_common.h1
-rw-r--r--src/static_libs/vg_common/vg_common_json.c55
5 files changed, 60 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c
index bca8c1d..82aba0f 100644
--- a/src/lib/elementary/efl_ui_animation_view.c
+++ b/src/lib/elementary/efl_ui_animation_view.c
@@ -741,6 +741,7 @@ _efl_ui_animation_view_value_provider_override(Eo *obj EINA_UNUSED, Efl_Ui_Anima
741 741
742 efl_ref(value_provider); 742 efl_ref(value_provider);
743 pd->vp_list = eina_list_append(pd->vp_list, value_provider); 743 pd->vp_list = eina_list_append(pd->vp_list, value_provider);
744 efl_key_data_set(pd->vg, "_vg_value_providers", pd->vp_list);
744} 745}
745 746
746EAPI Elm_Animation_View* 747EAPI Elm_Animation_View*
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c
index 0c8e50b..660d1eb 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -616,6 +616,8 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj,
616 h = size.h; 616 h = size.h;
617 617
618 } 618 }
619 if (pd->vg_entry->vfd)
620 pd->vg_entry->vfd->vp_list = efl_key_data_get(obj->object, "_vg_value_providers");
619 root = evas_cache_vg_tree_get(vg_entry, pd->frame_idx); 621 root = evas_cache_vg_tree_get(vg_entry, pd->frame_idx);
620 if (!root) return; 622 if (!root) return;
621 623
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index c80053c..86bb885 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1541,6 +1541,7 @@ struct _Vg_File_Data
1541 Vg_File_Anim_Data *anim_data; //only when animation supported. 1541 Vg_File_Anim_Data *anim_data; //only when animation supported.
1542 int ref; 1542 int ref;
1543 int w, h; //default size 1543 int w, h; //default size
1544 Eina_List *vp_list; //Value providers.
1544 1545
1545 void *loader_data; //loader specific local data 1546 void *loader_data; //loader specific local data
1546 1547
diff --git a/src/static_libs/vg_common/vg_common.h b/src/static_libs/vg_common/vg_common.h
index 520fcdb..83f9224 100644
--- a/src/static_libs/vg_common/vg_common.h
+++ b/src/static_libs/vg_common/vg_common.h
@@ -7,6 +7,7 @@
7 7
8#include "evas_common_private.h" 8#include "evas_common_private.h"
9#include "evas_private.h" 9#include "evas_private.h"
10#include "evas_vg_private.h"
10 11
11/****************************************************************************************** 12/******************************************************************************************
12 * SVG Compatible feature implementation 13 * SVG Compatible feature implementation
diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c
index 3b3d114..5ad4150 100644
--- a/src/static_libs/vg_common/vg_common_json.c
+++ b/src/static_libs/vg_common/vg_common_json.c
@@ -443,6 +443,59 @@ _update_vg_tree(Efl_Canvas_Vg_Container *root, const LOTLayerNode *layer, int de
443} 443}
444#endif 444#endif
445 445
446#ifdef BUILD_VG_LOADER_JSON
447void
448_value_provider_override(Vg_File_Data *vfd)
449{
450 Lottie_Animation *lot_anim = (Lottie_Animation *) vfd->loader_data;
451
452 Eina_List *l;
453 Efl_Gfx_Vg_Value_Provider *vp;
454 EINA_LIST_FOREACH(vfd->vp_list, l, vp)
455 {
456 const char *keypath;
457 Efl_Gfx_Vg_Value_Provider_Change_Flag flag;
458 flag = efl_gfx_vg_value_provider_changed_flag_get(vp);
459
460 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_FILL_COLOR)
461 {
462 int r, g, b, a;
463 r = g = b = a = 0;
464 efl_gfx_vg_value_provider_fill_color_get(vp, &r, &g, &b, &a);
465 keypath = efl_gfx_vg_value_provider_keypath_get(vp);
466
467 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_FILLCOLOR, (char*)keypath, r / 255.0, g / 255.0, b / 255.0);
468 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_FILLOPACITY, (char*)keypath, (a / 255.0) * 100.0);
469 }
470 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_STROKE_COLOR)
471 {
472 int r, g, b, a;
473 r = g = b = a = 0;
474 efl_gfx_vg_value_provider_stroke_color_get(vp, &r, &g, &b, &a);
475 keypath = efl_gfx_vg_value_provider_keypath_get(vp);
476
477 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_STROKECOLOR, (char*)keypath, r / 255.0, g / 255.0, b / 255.0);
478 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_STROKEOPACITY, (char*)keypath, (a / 255.0) * 100.0);
479 }
480 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_STROKE_WIDTH)
481 {
482 double w;
483 w = efl_gfx_vg_value_provider_stroke_width_get(vp);
484 keypath = efl_gfx_vg_value_provider_keypath_get(vp);
485
486 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_STROKEWIDTH, (char*)keypath, w);
487 }
488 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_TRANSFORM_MATRIX)
489 {
490 //TODO: When the lottie animation's transform property is implemented,
491 // the transform property override function have to added.
492 }
493 }
494}
495
496#endif
497
498
446Eina_Bool 499Eina_Bool
447vg_common_json_create_vg_node(Vg_File_Data *vfd) 500vg_common_json_create_vg_node(Vg_File_Data *vfd)
448{ 501{
@@ -450,6 +503,8 @@ vg_common_json_create_vg_node(Vg_File_Data *vfd)
450 Lottie_Animation *lot_anim = (Lottie_Animation *) vfd->loader_data; 503 Lottie_Animation *lot_anim = (Lottie_Animation *) vfd->loader_data;
451 if (!lot_anim) return EINA_FALSE; 504 if (!lot_anim) return EINA_FALSE;
452 505
506 if (vfd->vp_list) _value_provider_override(vfd);
507
453 unsigned int frame_num = (vfd->anim_data) ? vfd->anim_data->frame_num : 0; 508 unsigned int frame_num = (vfd->anim_data) ? vfd->anim_data->frame_num : 0;
454 const LOTLayerNode *tree = 509 const LOTLayerNode *tree =
455 lottie_animation_render_tree(lot_anim, frame_num, 510 lottie_animation_render_tree(lot_anim, frame_num,