summaryrefslogtreecommitdiff
path: root/src/static_libs
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-10-02 14:30:06 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2019-10-02 14:30:06 +0900
commit779bd0539eb6ab8050289da83d0792670a15422c (patch)
treed40a315662f3fc92cd47d5aa404859f7b26a8aca /src/static_libs
parent6deb21f9f9e326921c16dabbd774b8d1666867c8 (diff)
vg_common_json: Override value_provider list
Summary: If value_provider is applied to Efl.Ui.Animation_View, it is passed as vector object. The passed value_provider list passes to Vg_File_Data. If there is a value_Provider list in Vg_File_Data, it apply the property to Lottie_Animation using lottie_animation_property_override api. Depends on D9874 Test Plan: ... Eo *vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, p); efl_gfx_vg_value_provider_keypath_set(vp, "**"); efl_gfx_vg_value_provider_fill_color_set(vp, 100, 0 ,0 ,255); efl_ui_animation_view_value_provider_override(anim_view, vp); vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, p); efl_gfx_vg_value_provider_keypath_set(vp, "**"); efl_gfx_vg_value_provider_stroke_width_set(vp, 50.0); efl_gfx_vg_value_provider_stroke_color_set(vp, 0, 255, 0, 100); efl_ui_animation_view_value_provider_override(anim_view, vp); ... Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9897
Diffstat (limited to 'src/static_libs')
-rw-r--r--src/static_libs/vg_common/vg_common.h1
-rw-r--r--src/static_libs/vg_common/vg_common_json.c55
2 files changed, 56 insertions, 0 deletions
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,