diff options
author | JunsuChoi <jsuya.choi@samsung.com> | 2020-02-17 19:05:22 +0900 |
---|---|---|
committer | JunsuChoi <jsuya.choi@samsung.com> | 2020-02-17 19:14:14 +0900 |
commit | a4311f73ee956653182c5bd5f047d5043e5bd894 (patch) | |
tree | 20d2fa39824d2d8510d63420feee487b628f473d /src/lib/edje/edje_calc.c | |
parent | 2fe158ce652860b2aa5a2e883e6b2beb0ee1c670 (diff) |
edje: Disable the json vector animation feature with a flag.
Summary:
Json vector animation requires the json loader to be loaded.
Therefore, if the loader does not load,
it prints an appropriate error message and disables the feature.
Depends on D11228
Test Plan: N/A
Reviewers: Hermet, Jaehyun_Cho, id213sin
Reviewed By: Hermet
Subscribers: raster, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11230
Diffstat (limited to '')
-rw-r--r-- | src/lib/edje/edje_calc.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index eba505b721..30f556d722 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c | |||
@@ -3279,6 +3279,7 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj | |||
3279 | evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_SOLID); | 3279 | evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_SOLID); |
3280 | } | 3280 | } |
3281 | 3281 | ||
3282 | #ifdef BUILD_VG_LOADER_JSON | ||
3282 | static void | 3283 | static void |
3283 | _edje_vector_animation_running_cb(void *data, const Efl_Event *event) | 3284 | _edje_vector_animation_running_cb(void *data, const Efl_Event *event) |
3284 | { | 3285 | { |
@@ -3363,6 +3364,7 @@ _edje_vector_load_json(Edje *ed, Edje_Real_Part *ep, const char *key) | |||
3363 | efl_gfx_frame_controller_frame_set(ep->object, (int)(frame_count * desc->vg.frame)); | 3364 | efl_gfx_frame_controller_frame_set(ep->object, (int)(frame_count * desc->vg.frame)); |
3364 | } | 3365 | } |
3365 | } | 3366 | } |
3367 | #endif | ||
3366 | 3368 | ||
3367 | static void | 3369 | static void |
3368 | _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EINA_UNUSED, Edje_Part_Description_Vector *chosen_desc, FLOAT_T pos) | 3370 | _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EINA_UNUSED, Edje_Part_Description_Vector *chosen_desc, FLOAT_T pos) |
@@ -3381,8 +3383,11 @@ _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EIN | |||
3381 | 3383 | ||
3382 | if (type == EDJE_VECTOR_FILE_TYPE_JSON) | 3384 | if (type == EDJE_VECTOR_FILE_TYPE_JSON) |
3383 | { | 3385 | { |
3386 | #ifdef BUILD_VG_LOADER_JSON | ||
3384 | _edje_vector_load_json(ed, ep, src_key); | 3387 | _edje_vector_load_json(ed, ep, src_key); |
3385 | 3388 | #else | |
3389 | ERR("Evas Vg Json (Lottie) Loader is not supported, Only Static Vector Image(SVG) is available!"); | ||
3390 | #endif | ||
3386 | return; | 3391 | return; |
3387 | } | 3392 | } |
3388 | 3393 | ||
@@ -3402,7 +3407,12 @@ _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EIN | |||
3402 | 3407 | ||
3403 | if ((new_id < 0) || (new_type == EDJE_VECTOR_FILE_TYPE_JSON)) | 3408 | if ((new_id < 0) || (new_type == EDJE_VECTOR_FILE_TYPE_JSON)) |
3404 | { | 3409 | { |
3405 | efl_file_simple_load(ep->object, ed->file->path, src_key); | 3410 | #ifndef BUILD_VG_LOADER_JSON |
3411 | if (new_type == EDJE_VECTOR_FILE_TYPE_JSON) | ||
3412 | ERR("Evas Vg Json (Lottie) Loader is not supported, Only Static Vector Image(SVG) is available!"); | ||
3413 | else | ||
3414 | #endif | ||
3415 | efl_file_simple_load(ep->object, ed->file->path, src_key); | ||
3406 | } | 3416 | } |
3407 | else | 3417 | else |
3408 | { | 3418 | { |
@@ -3428,6 +3438,7 @@ _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EIN | |||
3428 | } | 3438 | } |
3429 | } | 3439 | } |
3430 | 3440 | ||
3441 | #ifdef BUILD_VG_LOADER_JSON | ||
3431 | void | 3442 | void |
3432 | _edje_part_vector_anim_stop(Edje *ed EINA_UNUSED, Edje_Real_Part *rp) | 3443 | _edje_part_vector_anim_stop(Edje *ed EINA_UNUSED, Edje_Real_Part *rp) |
3433 | { | 3444 | { |
@@ -3464,6 +3475,7 @@ _edje_part_vector_anim_play(Edje *ed EINA_UNUSED, Edje_Real_Part *rp, Eina_Bool | |||
3464 | rp->typedata.vector->is_playing = EINA_TRUE; | 3475 | rp->typedata.vector->is_playing = EINA_TRUE; |
3465 | efl_canvas_object_animation_start(rp->object, rp->typedata.vector->anim, 1.0, 0.0); | 3476 | efl_canvas_object_animation_start(rp->object, rp->typedata.vector->anim, 1.0, 0.0); |
3466 | } | 3477 | } |
3478 | #endif | ||
3467 | 3479 | ||
3468 | static Edje_Real_Part * | 3480 | static Edje_Real_Part * |
3469 | _edje_real_part_state_get(Edje *ed, Edje_Real_Part *ep, int flags, int id, int *state) | 3481 | _edje_real_part_state_get(Edje *ed, Edje_Real_Part *ep, int flags, int id, int *state) |