hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e97d3c08ea83b611c8b4fd06e1fe5fdd24a1dca9
commit e97d3c08ea83b611c8b4fd06e1fe5fdd24a1dca9 Author: JunsuChoi <jsuya.c...@samsung.com> Date: Mon Jul 22 13:54:25 2019 +0900 evas_vg_json: Add image embedded example Summary: add example code and json resource. plus) Add ECTOR_BACKEND="default" Environment variable because cairo backend is not supported. Depends on D9218 Ector.Renderer : Implement Ector.Renderer.(Software).Image class D9219 Efl.Canvas.Vg : Implement Efl.Canvas.Vg.Image class D9220 vg_common_json : Support image data of node Test Plan: cd .src/examples/evas/ gcc -o evas_vg_json evas-vg-json.c `pkg-config --libs --cflags evas ecore ecore-evas eina ector eo efl` ./evas_vg_json Reviewers: Hermet, kimcinoo, smohanty Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9351 --- src/examples/evas/evas-vg-json.c | 17 ++++++++++++++--- src/examples/evas/resources/vg/image_embedded.json | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/examples/evas/evas-vg-json.c b/src/examples/evas/evas-vg-json.c index 42047292ea..d0176dbd72 100644 --- a/src/examples/evas/evas-vg-json.c +++ b/src/examples/evas/evas-vg-json.c @@ -30,9 +30,9 @@ #include "evas-common.h" #define WIDTH 400 -#define HEIGHT 400 +#define HEIGHT 600 -static Eo *gvg[4]; +static Eo *gvg[5]; static void running_cb(void *data EINA_UNUSED, const Efl_Event *event) @@ -41,7 +41,7 @@ running_cb(void *data EINA_UNUSED, const Efl_Event *event) double progress = event_running->progress; int i; - for (i = 0; i < 4; i++) + for (i = 0; i < 5; i++) { double frameCnt = (double) (efl_gfx_frame_controller_frame_count_get(gvg[i]) - 1); int frame = (int) (frameCnt * progress); @@ -58,6 +58,9 @@ _on_delete(Ecore_Evas *ee EINA_UNUSED) int main(void) { + //Cairo backend is not supported. + setenv("ECTOR_BACKEND", "default", 1); + if (!ecore_evas_init()) return EXIT_FAILURE; @@ -109,6 +112,14 @@ main(void) efl_gfx_entity_size_set(vg4, EINA_SIZE2D(200, 200)); efl_gfx_entity_visible_set(vg4, EINA_TRUE); + //5 + Eo* vg5 = gvg[4] = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, evas); + snprintf(buf, sizeof(buf), "%s/image_embedded.json", PACKAGE_EXAMPLES_DIR EVAS_VG_FOLDER); + efl_file_simple_load(vg5, buf, NULL); + efl_gfx_entity_position_set(vg5, EINA_POSITION2D(0, 400)); + efl_gfx_entity_size_set(vg5, EINA_SIZE2D(200, 200)); + efl_gfx_entity_visible_set(vg5, EINA_TRUE); + //Play custom animation Eo *anim = efl_add(EFL_CANVAS_ANIMATION_CLASS, evas); efl_animation_duration_set(anim, efl_gfx_frame_controller_frame_duration_get(vg, 0, 0)); diff --git a/src/examples/evas/resources/vg/image_embedded.json b/src/examples/evas/resources/vg/image_embedded.json new file mode 100644 index 0000000000..c3d48387f1 --- /dev/null +++ b/src/examples/evas/resources/vg/image_embedded.json @@ -0,0 +1 @@ +{"v":"5.4.3","fr":60,"ip":0,"op":60,"w":800,"h":800,"nm":"Comp 1","ddd":0,"assets":[{"id":"image_0","w":200,"h":300,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAEsCAYAAACG+vy+AAAgAElEQVR4Xly9C7Tla1Xd+e29zzlVdYsLl6cKAZLWaKsdjenWoR0HaKImrQ61Y8zQ1iHa7StttH00GMVHHAYBjSIxoh0RENELKEoUFUFIIgiIBLHTLYo61PYBmiCPW7fqPPajx5y/Ob//xpJrVZ06Z+/9/75vrTXXXHOtb/XtX/nDh/1YjcPqZBzGGPrz/jDGYTXGdr8f+7HWv+qr42ysx3rsx9DfV2v/vh+HcTiMsfLPHcb2cPDP7w76Pn1N3zHGejXGyt+n/9ZjvR5jtVqNlb4+eK3NajXWeu9xGG [...] \ No newline at end of file --