summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_vg_private.h
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2018-06-15 01:00:53 +0900
committerHermet Park <hermetpark@gmail.com>2018-06-15 01:11:26 +0900
commitc8c0dbb32bd7f38b0faf524b1a55585f99d1cb17 (patch)
tree02a62d8ad449840d2e09f556459c12bf48b68f33 /src/lib/evas/canvas/evas_vg_private.h
parentbd5174b6003506b7c8aae3a58d7e83d931188dca (diff)
evas vg: prevent a corner-case crash.
tbh, current vg interfaces a little bit bad... here is one scenario to this stupid case. efl_parent_set() and evas_object_vg_root_node_set() both do re-parent job. They could be conflicted if user calls both apis in either way. efl_parent_set(root_node, NULL); but Vg Object still keeps the root node which is just a dangling pointer that occurs a crash while rendering.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_private.h')
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index 4ff8b2bb45..cc43fb03ab 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -62,6 +62,8 @@ struct _Efl_Canvas_Vg_Node_Data
62 Efl_Canvas_Vg_Node *mask; 62 Efl_Canvas_Vg_Node *mask;
63 Ector_Renderer *renderer; 63 Ector_Renderer *renderer;
64 64
65 Efl_VG *vg_obj;
66
65 void (*render_pre)(Eo *obj, Eina_Matrix3 *parent, Ector_Surface *s, void *data, Efl_Canvas_Vg_Node_Data *nd); 67 void (*render_pre)(Eo *obj, Eina_Matrix3 *parent, Ector_Surface *s, void *data, Efl_Canvas_Vg_Node_Data *nd);
66 void *data; 68 void *data;
67 69
@@ -71,6 +73,7 @@ struct _Efl_Canvas_Vg_Node_Data
71 73
72 Eina_Bool visibility : 1; 74 Eina_Bool visibility : 1;
73 Eina_Bool changed : 1; 75 Eina_Bool changed : 1;
76 Eina_Bool parenting : 1;
74}; 77};
75 78
76struct _Efl_Canvas_Vg_Container_Data 79struct _Efl_Canvas_Vg_Container_Data
@@ -108,6 +111,8 @@ Vg_File_Data * evas_cache_vg_file_info(const char *file, const char
108 111
109Eina_Bool evas_vg_save_to_file(Vg_File_Data *evg_data, const char *file, const char *key, const char *flags); 112Eina_Bool evas_vg_save_to_file(Vg_File_Data *evg_data, const char *file, const char *key, const char *flags);
110 113
114void efl_canvas_vg_node_root_set(Efl_VG *node, Efl_VG *vg_obj);
115
111static inline Efl_Canvas_Vg_Node_Data * 116static inline Efl_Canvas_Vg_Node_Data *
112_evas_vg_render_pre(Efl_VG *child, Ector_Surface *s, Eina_Matrix3 *m) 117_evas_vg_render_pre(Efl_VG *child, Ector_Surface *s, Eina_Matrix3 *m)
113{ 118{