summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_vg_private.h
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2018-12-20 14:42:38 +0900
committerHermet Park <hermetpark@gmail.com>2018-12-20 14:42:38 +0900
commit149dcb17cbd641a34eb36b500df4511b6bd8d297 (patch)
tree87fef12cf6b3a73d3aa724271bc7bf986eedcbd9 /src/lib/evas/canvas/evas_vg_private.h
parentd9a222ecf59622ec9cf80a908b0a987d18f87b0f (diff)
evas vg: optimize vg object internal connections.
Dectected huge amount of unnecessray internal events triggering which were signaled via vg nodes. By events, nodes were connected with each others, and finally reaches to vg object to update its rendering properly. However GFX_PATH_CHANGE signal is too commonly triggered for scenarios, listening and response it is too burdensome. We acutally don't need to do this if all nodes could share the vg object. Nodes directly notify vg object to update it. Next patch will come to remove stupid GFX_PATH_CHANGE that's aweful in performance wise.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_private.h')
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index b2283d3c6a..fa122fa587 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -42,6 +42,7 @@ struct _Efl_Canvas_Vg_Object_Data
42 Efl_VG *root; 42 Efl_VG *root;
43 Vg_Cache_Entry *vg_entry; 43 Vg_Cache_Entry *vg_entry;
44 Vg_User_Entry *user_entry; //holds the user set vg tree 44 Vg_User_Entry *user_entry; //holds the user set vg tree
45 Evas_Object_Protected_Data *obj;
45 Eina_Rect fill; 46 Eina_Rect fill;
46 Eina_Rect viewbox; 47 Eina_Rect viewbox;
47 unsigned int width, height; 48 unsigned int width, height;
@@ -59,7 +60,8 @@ struct _Efl_Canvas_Vg_Node_Data
59 60
60 Ector_Renderer *renderer; 61 Ector_Renderer *renderer;
61 62
62 Efl_VG *vg_obj; //...Not necessary!! 63 Efl_VG *vg_obj;
64 Efl_Canvas_Vg_Object_Data *vd;
63 65
64 void (*render_pre)(Evas_Object_Protected_Data *vg_pd, Efl_VG *node, 66 void (*render_pre)(Evas_Object_Protected_Data *vg_pd, Efl_VG *node,
65 Efl_Canvas_Vg_Node_Data *nd, Ector_Surface *surface, 67 Efl_Canvas_Vg_Node_Data *nd, Ector_Surface *surface,
@@ -72,7 +74,6 @@ struct _Efl_Canvas_Vg_Node_Data
72 74
73 Eina_Bool visibility : 1; 75 Eina_Bool visibility : 1;
74 Eina_Bool changed : 1; 76 Eina_Bool changed : 1;
75 Eina_Bool parenting : 1;
76}; 77};
77 78
78typedef struct _Vg_Mask 79typedef struct _Vg_Mask
@@ -124,7 +125,17 @@ void evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry);
124Vg_File_Data * evas_cache_vg_file_open(const char *file, const char *key); 125Vg_File_Data * evas_cache_vg_file_open(const char *file, const char *key);
125Eina_Bool evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const char *flags); 126Eina_Bool evas_cache_vg_file_save(Efl_VG *root, int w, int h, const char *file, const char *key, const char *flags);
126Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const char *flags); 127Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_entry, const char *file, const char *key, const char *flags);
127void efl_canvas_vg_node_root_set(Efl_VG *node, Efl_VG *vg_obj); 128void efl_canvas_vg_node_vg_obj_set(Efl_VG *node, Efl_VG *vg_obj, Efl_Canvas_Vg_Object_Data *vd);
129void efl_canvas_vg_node_change(Efl_VG *node);
130void efl_canvas_vg_container_vg_obj_update(Efl_VG *obj, Efl_Canvas_Vg_Node_Data *nd);
131
132static inline void
133efl_canvas_vg_object_change(Efl_Canvas_Vg_Object_Data *vd)
134{
135 if (!vd || vd->changed) return;
136 vd->changed = EINA_TRUE;
137 evas_object_change(vd->obj->object, vd->obj);
138}
128 139
129static inline Efl_Canvas_Vg_Node_Data * 140static inline Efl_Canvas_Vg_Node_Data *
130_evas_vg_render_pre(Evas_Object_Protected_Data *vg_pd, Efl_VG *child, Ector_Surface *surface, Eina_Matrix3 *transform, Ector_Buffer *mask, int mask_op) 141_evas_vg_render_pre(Evas_Object_Protected_Data *vg_pd, Efl_VG *child, Ector_Surface *surface, Eina_Matrix3 *transform, Ector_Buffer *mask, int mask_op)
@@ -135,14 +146,6 @@ _evas_vg_render_pre(Evas_Object_Protected_Data *vg_pd, Efl_VG *child, Ector_Surf
135 return nd; 146 return nd;
136} 147}
137 148
138static inline void
139_efl_canvas_vg_node_changed(Eo *obj)
140{
141 Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_FILL };
142
143 if (obj) efl_event_callback_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
144}
145
146#define EFL_CANVAS_VG_COMPUTE_MATRIX(Current, Parent, Nd) \ 149#define EFL_CANVAS_VG_COMPUTE_MATRIX(Current, Parent, Nd) \
147 Eina_Matrix3 *Current = Nd->m; \ 150 Eina_Matrix3 *Current = Nd->m; \
148 Eina_Matrix3 _matrix_tmp; \ 151 Eina_Matrix3 _matrix_tmp; \