vg_common_json : Support image data of node
authorJunsuChoi <jsuya.choi@samsung.com>
Mon, 22 Jul 2019 04:53:21 +0000 (13:53 +0900)
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>
Tue, 23 Jul 2019 05:04:43 +0000 (14:04 +0900)
Summary:
When node has image data, it creates Efl.Canvas.Vg.Image class
and set transform information and data information.

Depends on
D9218 Ector.Renderer : Implement Ector.Renderer.(Software).Image class
D9219 Efl.Canvas.Vg : Implement Efl.Canvas.Vg.Image class

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9220

src/static_libs/vg_common/vg_common_json.c

index 94df54e..6ecac99 100644 (file)
@@ -42,6 +42,31 @@ _construct_drawable_nodes(Efl_Canvas_Vg_Container *parent, const LOTLayerNode *l
         LOTNode *node = layer->mNodeList.ptr[i];
         if (!node) continue;
 
+        //Image object
+        if (node->mImageInfo.data)
+          {
+             char *key = _get_key_val(node);
+             Efl_Canvas_Vg_Image *image = efl_key_data_get(parent, key);
+             if (!image)
+               {
+                  image = efl_add(EFL_CANVAS_VG_IMAGE_CLASS, parent);
+                  efl_key_data_set(parent, key, image);
+               }
+             efl_gfx_entity_visible_set(image, EINA_TRUE);
+
+             Eina_Matrix3 m;
+             eina_matrix3_identity(&m);
+             eina_matrix3_values_set( &m,
+                                      node->mImageInfo.mMatrix.m11,  node->mImageInfo.mMatrix.m12, node->mImageInfo.mMatrix.m13,
+                                      node->mImageInfo.mMatrix.m21,  node->mImageInfo.mMatrix.m22, node->mImageInfo.mMatrix.m23,
+                                      node->mImageInfo.mMatrix.m31,  node->mImageInfo.mMatrix.m32, node->mImageInfo.mMatrix.m33);
+             efl_canvas_vg_node_transformation_set(image, &m);
+
+             efl_canvas_vg_image_data_set(image, node->mImageInfo.data, node->mImageInfo.width, node->mImageInfo.height);
+
+             continue;
+          }
+
         //Skip Invisible Stroke?
         if (node->mStroke.enable && node->mStroke.width == 0)
           {
@@ -64,7 +89,7 @@ _construct_drawable_nodes(Efl_Canvas_Vg_Container *parent, const LOTLayerNode *l
         else
           efl_gfx_path_reset(shape);
 
-         efl_gfx_entity_visible_set(shape, EINA_TRUE);
+        efl_gfx_entity_visible_set(shape, EINA_TRUE);
 #if DEBUG
         for (int i = 0; i < depth; i++) printf("    ");
         printf("%s (%p)\n", efl_class_name_get(efl_class_get(shape)), shape);