summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_vg_private.h
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2018-12-07 19:38:48 +0900
committerHermet Park <hermetpark@gmail.com>2018-12-07 19:50:08 +0900
commitfbe92aa67f18f8c0401cdc6d4440ed512c43b131 (patch)
tree0a681b5f232105491183dfdb4efcc5d5d7050689 /src/lib/evas/canvas/evas_vg_private.h
parent4d6f20d714ea083471be163f67af518eced4028c (diff)
evas ector: add software implmentation for masking feature.
This implementation uses Ector_Buffer to generate mask image from vg container, and pass it to Ector engine. Ector renderer could blend this image as a mask. Yet only vg container works as a mask, we could extend shape to support masking later. Still vector gl drawing is not completed, We use software ector buffer to draw on it. This is on progessing.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_private.h')
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index a4d11d06cb..10b8b49b25 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -57,12 +57,13 @@ struct _Efl_Canvas_Vg_Node_Data
57 Eina_Matrix3 *m; 57 Eina_Matrix3 *m;
58 Efl_Canvas_Vg_Interpolation *intp; 58 Efl_Canvas_Vg_Interpolation *intp;
59 59
60 Efl_Canvas_Vg_Node *mask;
61 Ector_Renderer *renderer; 60 Ector_Renderer *renderer;
62 61
63 Efl_VG *vg_obj; //...Not necessary!! 62 Efl_VG *vg_obj; //...Not necessary!!
64 63
65 void (*render_pre)(Eo *obj, Eina_Matrix3 *parent, Ector_Surface *s, void *data, Efl_Canvas_Vg_Node_Data *nd); 64 void (*render_pre)(Evas_Object_Protected_Data *vg_pd, Efl_VG *node,
65 Efl_Canvas_Vg_Node_Data *nd, Ector_Surface *surface,
66 Eina_Matrix3 *ptransform, Ector_Buffer *mask, int mask_op, void *data);
66 void *data; 67 void *data;
67 68
68 double x, y; 69 double x, y;
@@ -74,11 +75,25 @@ struct _Efl_Canvas_Vg_Node_Data
74 Eina_Bool parenting : 1; 75 Eina_Bool parenting : 1;
75}; 76};
76 77
78typedef struct _Vg_Mask
79{
80 Evas_Object_Protected_Data *vg_pd; //Vector Object (for accessing backend engine)
81 Ector_Buffer *buffer; //Mask Ector Buffer
82 void *pixels; //Mask pixel buffer (actual data)
83 Eina_Rect bound; //Mask boundary
84 Eina_List *target; //Mask target
85 int option; //Mask option
86 Eina_Bool dirty : 1; //Need to update mask image.
87} Vg_Mask;
88
77struct _Efl_Canvas_Vg_Container_Data 89struct _Efl_Canvas_Vg_Container_Data
78{ 90{
79 Eina_List *children; 91 Eina_List *children;
80
81 Eina_Hash *names; 92 Eina_Hash *names;
93
94 //Masking feature.
95 Efl_Canvas_Vg_Node *mask_src; //Mask Source
96 Vg_Mask mask; //Mask source data
82}; 97};
83 98
84struct _Efl_Canvas_Vg_Gradient_Data 99struct _Efl_Canvas_Vg_Gradient_Data
@@ -112,13 +127,12 @@ Eina_Bool evas_cache_vg_entry_file_save(Vg_Cache_Entry *vg_ent
112void efl_canvas_vg_node_root_set(Efl_VG *node, Efl_VG *vg_obj); 127void efl_canvas_vg_node_root_set(Efl_VG *node, Efl_VG *vg_obj);
113 128
114static inline Efl_Canvas_Vg_Node_Data * 129static inline Efl_Canvas_Vg_Node_Data *
115_evas_vg_render_pre(Efl_VG *child, Ector_Surface *s, Eina_Matrix3 *m) 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)
116{ 131{
117 if (!child) return NULL; 132 if (!child) return NULL;
118 133 Efl_Canvas_Vg_Node_Data *nd = efl_data_scope_get(child, EFL_CANVAS_VG_NODE_CLASS);
119 Efl_Canvas_Vg_Node_Data *child_nd = efl_data_scope_get(child, EFL_CANVAS_VG_NODE_CLASS); 134 if (nd) nd->render_pre(vg_pd, child, nd, surface, transform, mask, mask_op, nd->data);
120 if (child_nd) child_nd->render_pre(child, m, s, child_nd->data, child_nd); 135 return nd;
121 return child_nd;
122} 136}
123 137
124static inline void 138static inline void