summaryrefslogtreecommitdiff
path: root/src/lib/ector
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-08-20 20:24:27 +0900
committerHermet Park <hermetpark@gmail.com>2019-08-20 20:24:27 +0900
commitb0737c743458818ea79338c15c15d0c3d4819051 (patch)
tree45fcd6f0413e4b6caf3449e0916a0b8c5677f012 /src/lib/ector
parentdad166f84a02cfffc2a07bc804e7b7e35ed4a40d (diff)
Revert "ector: code refactoring."
This reverts commit dad166f84a02cfffc2a07bc804e7b7e35ed4a40d. Ector is not public, this breaks enlightenment compilation,
Diffstat (limited to 'src/lib/ector')
-rw-r--r--src/lib/ector/Ector.h2
-rw-r--r--src/lib/ector/ector_renderer.c8
-rw-r--r--src/lib/ector/ector_renderer.eo9
-rw-r--r--src/lib/ector/ector_renderer_gradient.eo2
-rw-r--r--src/lib/ector/ector_types.eot10
-rw-r--r--src/lib/ector/software/ector_renderer_software_image.c28
-rw-r--r--src/lib/ector/software/ector_renderer_software_image.eo2
-rw-r--r--src/lib/ector/software/ector_renderer_software_shape.c32
-rw-r--r--src/lib/ector/software/ector_renderer_software_shape.eo2
-rw-r--r--src/lib/ector/software/ector_software_private.h8
-rw-r--r--src/lib/ector/software/ector_software_rasterizer.c137
11 files changed, 120 insertions, 120 deletions
diff --git a/src/lib/ector/Ector.h b/src/lib/ector/Ector.h
index 2a391a7..01a71d6 100644
--- a/src/lib/ector/Ector.h
+++ b/src/lib/ector/Ector.h
@@ -86,8 +86,6 @@ extern "C" {
86 86
87#ifdef EFL_BETA_API_SUPPORT 87#ifdef EFL_BETA_API_SUPPORT
88 88
89#include "ector_types.eot.h"
90
91/** 89/**
92 * @typedef Ector_Surface 90 * @typedef Ector_Surface
93 * The base type to render content into. 91 * The base type to render content into.
diff --git a/src/lib/ector/ector_renderer.c b/src/lib/ector/ector_renderer.c
index cc7e0ec..d0efab6 100644
--- a/src/lib/ector/ector_renderer.c
+++ b/src/lib/ector/ector_renderer.c
@@ -146,10 +146,10 @@ _ector_renderer_crc_get(const Eo *obj EINA_UNUSED,
146} 146}
147 147
148static void 148static void
149_ector_renderer_comp_method_set(Eo *obj EINA_UNUSED, 149_ector_renderer_mask_set(Eo *obj EINA_UNUSED,
150 Ector_Renderer_Data *pd EINA_UNUSED, 150 Ector_Renderer_Data *pd EINA_UNUSED,
151 Ector_Buffer *comp EINA_UNUSED, 151 Ector_Buffer *mask EINA_UNUSED,
152 Ector_Renderer_Composite_Method method EINA_UNUSED) 152 int op EINA_UNUSED)
153{ 153{
154} 154}
155 155
diff --git a/src/lib/ector/ector_renderer.eo b/src/lib/ector/ector_renderer.eo
index 8d702ae..57726f3 100644
--- a/src/lib/ector/ector_renderer.eo
+++ b/src/lib/ector/ector_renderer.eo
@@ -1,5 +1,4 @@
1import eina_types; 1import eina_types;
2import ector_types;
3 2
4abstract @beta Ector.Renderer extends Efl.Object 3abstract @beta Ector.Renderer extends Efl.Object
5{ 4{
@@ -79,13 +78,13 @@ abstract @beta Ector.Renderer extends Efl.Object
79 return: uint; [[CRC value]] 78 return: uint; [[CRC value]]
80 } 79 }
81 } 80 }
82 @property comp_method { 81 @property mask {
83 [[Set Composite Buffer to this Renderer]] 82 [[Set Mask Image to this Renderer]]
84 set { 83 set {
85 } 84 }
86 values { 85 values {
87 comp: Ector.Buffer; [[Composite Buffer]] 86 mask: Ector.Buffer; [[Mask Image Buffer]]
88 method: Ector.Renderer.Composite_Method; [[Composite method]] 87 op: int; [[Masking option]]
89 } 88 }
90 } 89 }
91 draw @pure_virtual { 90 draw @pure_virtual {
diff --git a/src/lib/ector/ector_renderer_gradient.eo b/src/lib/ector/ector_renderer_gradient.eo
index 376326f..fda0e33 100644
--- a/src/lib/ector/ector_renderer_gradient.eo
+++ b/src/lib/ector/ector_renderer_gradient.eo
@@ -1,5 +1,3 @@
1import ector_types;
2
3mixin @beta Ector.Renderer.Gradient requires Efl.Object extends Efl.Gfx.Gradient 1mixin @beta Ector.Renderer.Gradient requires Efl.Object extends Efl.Gfx.Gradient
4{ 2{
5 [[Ector gradient renderer mixin]] 3 [[Ector gradient renderer mixin]]
diff --git a/src/lib/ector/ector_types.eot b/src/lib/ector/ector_types.eot
index c051d16..1e1a96b 100644
--- a/src/lib/ector/ector_types.eot
+++ b/src/lib/ector/ector_types.eot
@@ -1,12 +1,2 @@
1type @extern GLshort: short; [[GLshort type]] /* FIXME: We should not expose this in the API but probably redefine it. */ 1type @extern GLshort: short; [[GLshort type]] /* FIXME: We should not expose this in the API but probably redefine it. */
2 2
3enum @beta Ector.Renderer.Composite_Method
4{
5 none,
6 matte_alpha,
7 matte_alpha_inverse,
8 mask_add,
9 mask_substract,
10 mask_intersect,
11 mask_difference
12}
diff --git a/src/lib/ector/software/ector_renderer_software_image.c b/src/lib/ector/software/ector_renderer_software_image.c
index bc45c38..cb8d93a 100644
--- a/src/lib/ector/software/ector_renderer_software_image.c
+++ b/src/lib/ector/software/ector_renderer_software_image.c
@@ -21,10 +21,10 @@ struct _Ector_Renderer_Software_Image_Data
21 Ector_Software_Surface_Data *surface; 21 Ector_Software_Surface_Data *surface;
22 Ector_Renderer_Image_Data *image; 22 Ector_Renderer_Image_Data *image;
23 Ector_Renderer_Data *base; 23 Ector_Renderer_Data *base;
24 Ector_Buffer *comp; 24 Ector_Buffer *mask;
25 Ector_Renderer_Composite_Method comp_method; 25 int mask_op;
26 int opacity; 26 int opacity;
27 Eina_Matrix3 inv_m; 27 Eina_Matrix3 inv_m;
28 struct { 28 struct {
29 int x1, y1, x2, y2; 29 int x1, y1, x2, y2;
30 } boundary; 30 } boundary;
@@ -101,7 +101,7 @@ _ector_renderer_software_image_ector_renderer_draw(Eo *obj EINA_UNUSED,
101 return EINA_TRUE; 101 return EINA_TRUE;
102 102
103 const int pix_stride = pd->surface->rasterizer->fill_data.raster_buffer->stride / 4; 103 const int pix_stride = pd->surface->rasterizer->fill_data.raster_buffer->stride / 4;
104 Ector_Software_Buffer_Base_Data *comp = pd->comp ? efl_data_scope_get(pd->comp, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN) : NULL; 104 Ector_Software_Buffer_Base_Data *mask = pd->mask ? efl_data_scope_get(pd->mask, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN) : NULL;
105 Ector_Software_Buffer_Base_Data *bpd = efl_data_scope_get(pd->image->buffer, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN); 105 Ector_Software_Buffer_Base_Data *bpd = efl_data_scope_get(pd->image->buffer, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN);
106 double im11, im12, im21, im22, im31, im32; 106 double im11, im12, im21, im22, im31, im32;
107 uint32_t *dst_buf, *src_buf; 107 uint32_t *dst_buf, *src_buf;
@@ -128,10 +128,10 @@ _ector_renderer_software_image_ector_renderer_draw(Eo *obj EINA_UNUSED,
128 continue; 128 continue;
129 uint32_t *src = src_buf + (rx + (ry * image_w)); //FIXME: use to stride 129 uint32_t *src = src_buf + (rx + (ry * image_w)); //FIXME: use to stride
130 uint32_t temp = 0x0; 130 uint32_t temp = 0x0;
131 if (comp) 131 if (mask)
132 { 132 {
133 uint32_t *m = comp->pixels.u32 + ((int)local_x + ((int)local_y * comp->generic->w)); 133 uint32_t *m = mask->pixels.u32 + ((int)local_x + ((int)local_y * mask->generic->w));
134 //FIXME : This comping can work only matte case. 134 //FIXME : This masking can work only matte case.
135 // We need consider to inverse matte case. 135 // We need consider to inverse matte case.
136 temp = draw_mul_256((((*m)>>24) * pd->opacity)>>8, *src); 136 temp = draw_mul_256((((*m)>>24) * pd->opacity)>>8, *src);
137 } 137 }
@@ -182,13 +182,13 @@ _ector_renderer_software_image_ector_renderer_crc_get(const Eo *obj,
182} 182}
183 183
184static void 184static void
185_ector_renderer_software_image_ector_renderer_comp_method_set(Eo *obj EINA_UNUSED, 185_ector_renderer_software_image_ector_renderer_mask_set(Eo *obj EINA_UNUSED,
186 Ector_Renderer_Software_Image_Data *pd, 186 Ector_Renderer_Software_Image_Data *pd,
187 Ector_Buffer *comp, 187 Ector_Buffer *mask,
188 Ector_Renderer_Composite_Method method) 188 int op)
189{ 189{
190 pd->comp = comp; 190 pd->mask = mask;
191 pd->comp_method = method; 191 pd->mask_op = op;
192} 192}
193 193
194#include "ector_renderer_software_image.eo.c" 194#include "ector_renderer_software_image.eo.c"
diff --git a/src/lib/ector/software/ector_renderer_software_image.eo b/src/lib/ector/software/ector_renderer_software_image.eo
index 4771702..8a3f9c5 100644
--- a/src/lib/ector/software/ector_renderer_software_image.eo
+++ b/src/lib/ector/software/ector_renderer_software_image.eo
@@ -5,7 +5,7 @@ class @beta Ector.Renderer.Software.Image extends Ector.Renderer.Software implem
5 implements { 5 implements {
6 Ector.Renderer.prepare; 6 Ector.Renderer.prepare;
7 Ector.Renderer.draw; 7 Ector.Renderer.draw;
8 Ector.Renderer.comp_method { set; } 8 Ector.Renderer.mask { set; }
9 Ector.Renderer.crc { get; } 9 Ector.Renderer.crc { get; }
10 Efl.Object.constructor; 10 Efl.Object.constructor;
11 Efl.Object.destructor; 11 Efl.Object.destructor;
diff --git a/src/lib/ector/software/ector_renderer_software_shape.c b/src/lib/ector/software/ector_renderer_software_shape.c
index 00a95b8..b9cf1fa 100644
--- a/src/lib/ector/software/ector_renderer_software_shape.c
+++ b/src/lib/ector/software/ector_renderer_software_shape.c
@@ -38,8 +38,8 @@ struct _Ector_Renderer_Software_Shape_Data
38 Shape_Rle_Data *shape_data; 38 Shape_Rle_Data *shape_data;
39 Shape_Rle_Data *outline_data; 39 Shape_Rle_Data *outline_data;
40 40
41 Ector_Buffer *comp; 41 Ector_Buffer *mask;
42 Ector_Renderer_Composite_Method comp_method; 42 int mask_op;
43 43
44 Ector_Software_Shape_Task *task; 44 Ector_Software_Shape_Task *task;
45 45
@@ -674,8 +674,8 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj,
674 ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer, 674 ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer,
675 x, y, mul_col, op, 675 x, y, mul_col, op,
676 pd->shape_data, 676 pd->shape_data,
677 pd->comp, 677 pd->mask,
678 pd->comp_method); 678 pd->mask_op);
679 } 679 }
680 else 680 else
681 { 681 {
@@ -689,8 +689,8 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj,
689 ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer, 689 ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer,
690 x, y, mul_col, op, 690 x, y, mul_col, op,
691 pd->shape_data, 691 pd->shape_data,
692 pd->comp, 692 pd->mask,
693 pd->comp_method); 693 pd->mask_op);
694 } 694 }
695 } 695 }
696 696
@@ -702,8 +702,8 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj,
702 ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer, 702 ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer,
703 x, y, mul_col, op, 703 x, y, mul_col, op,
704 pd->outline_data, 704 pd->outline_data,
705 pd->comp, 705 pd->mask,
706 pd->comp_method); 706 pd->mask_op);
707 } 707 }
708 else 708 else
709 { 709 {
@@ -717,8 +717,8 @@ _ector_renderer_software_shape_ector_renderer_draw(Eo *obj,
717 ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer, 717 ector_software_rasterizer_draw_rle_data(pd->surface->rasterizer,
718 x, y, mul_col, op, 718 x, y, mul_col, op,
719 pd->outline_data, 719 pd->outline_data,
720 pd->comp, 720 pd->mask,
721 pd->comp_method); 721 pd->mask_op);
722 } 722 }
723 } 723 }
724 724
@@ -828,14 +828,14 @@ _ector_renderer_software_shape_ector_renderer_crc_get(const Eo *obj,
828} 828}
829 829
830static void 830static void
831_ector_renderer_software_shape_ector_renderer_comp_method_set(Eo *obj EINA_UNUSED, 831_ector_renderer_software_shape_ector_renderer_mask_set(Eo *obj EINA_UNUSED,
832 Ector_Renderer_Software_Shape_Data *pd, 832 Ector_Renderer_Software_Shape_Data *pd,
833 Ector_Buffer *comp, 833 Ector_Buffer *mask,
834 Ector_Renderer_Composite_Method method) 834 int op)
835{ 835{
836 //Use ref/unref. 836 //Use ref/unref.
837 pd->comp = comp; 837 pd->mask = mask;
838 pd->comp_method = method; 838 pd->mask_op = op;
839} 839}
840 840
841#include "ector_renderer_software_shape.eo.c" 841#include "ector_renderer_software_shape.eo.c"
diff --git a/src/lib/ector/software/ector_renderer_software_shape.eo b/src/lib/ector/software/ector_renderer_software_shape.eo
index 83b87c0..4ea56f9 100644
--- a/src/lib/ector/software/ector_renderer_software_shape.eo
+++ b/src/lib/ector/software/ector_renderer_software_shape.eo
@@ -6,7 +6,7 @@ class @beta Ector.Renderer.Software.Shape extends Ector.Renderer.Software implem
6 Ector.Renderer.prepare; 6 Ector.Renderer.prepare;
7 Ector.Renderer.draw; 7 Ector.Renderer.draw;
8 Ector.Renderer.Software.op_fill; 8 Ector.Renderer.Software.op_fill;
9 Ector.Renderer.comp_method { set; } 9 Ector.Renderer.mask { set; }
10 Ector.Renderer.crc { get; } 10 Ector.Renderer.crc { get; }
11 Efl.Gfx.Path.commit; 11 Efl.Gfx.Path.commit;
12 Efl.Object.constructor; 12 Efl.Object.constructor;
diff --git a/src/lib/ector/software/ector_software_private.h b/src/lib/ector/software/ector_software_private.h
index 7ac63b5..62d1c3f 100644
--- a/src/lib/ector/software/ector_software_private.h
+++ b/src/lib/ector/software/ector_software_private.h
@@ -83,8 +83,8 @@ typedef struct _Span_Data
83 83
84 int offx, offy; 84 int offx, offy;
85 Clip_Data clip; 85 Clip_Data clip;
86 Ector_Software_Buffer_Base_Data *comp; 86 Ector_Software_Buffer_Base_Data *mask;
87 Ector_Renderer_Composite_Method comp_method; 87 int mask_op;
88 Eina_Matrix3 inv; 88 Eina_Matrix3 inv;
89 Span_Data_Type type; 89 Span_Data_Type type;
90 Eina_Bool fast_matrix; 90 Eina_Bool fast_matrix;
@@ -136,8 +136,8 @@ void ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer,
136 int x, int y, uint32_t mul_col, 136 int x, int y, uint32_t mul_col,
137 Efl_Gfx_Render_Op op, 137 Efl_Gfx_Render_Op op,
138 Shape_Rle_Data* rle, 138 Shape_Rle_Data* rle,
139 Ector_Buffer *comp, 139 Ector_Buffer *mask,
140 Ector_Renderer_Composite_Method comp_method); 140 int mask_op);
141 141
142void ector_software_rasterizer_destroy_rle_data(Shape_Rle_Data *rle); 142void ector_software_rasterizer_destroy_rle_data(Shape_Rle_Data *rle);
143 143
diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c
index d4b6756..2b995c9 100644
--- a/src/lib/ector/software/ector_software_rasterizer.c
+++ b/src/lib/ector/software/ector_software_rasterizer.c
@@ -11,6 +11,21 @@
11 11
12#include "draw.h" 12#include "draw.h"
13 13
14//FIXME: This enum add temporarily to help understanding of additional code
15//related to masking in prepare_mask.
16//This needs to be formally declared through the eo class.
17typedef enum _EFL_CANVAS_VG_NODE_BLEND_TYPE
18{
19 EFL_CANVAS_VG_NODE_BLEND_TYPE_NONE = 0,
20 EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA,
21 EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV,
22 EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD,
23 EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT,
24 EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT,
25 EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE
26}EFL_CANVAS_VG_NODE_BLEND_TYPE;
27//
28
14static void 29static void
15_blend_argb(int count, const SW_FT_Span *spans, void *user_data) 30_blend_argb(int count, const SW_FT_Span *spans, void *user_data)
16{ 31{
@@ -34,12 +49,12 @@ _blend_argb(int count, const SW_FT_Span *spans, void *user_data)
34} 49}
35 50
36static void 51static void
37_comp_matte_alpha(int count, const SW_FT_Span *spans, void *user_data) 52_blend_alpha(int count, const SW_FT_Span *spans, void *user_data)
38{ 53{
39 Span_Data *sd = user_data; 54 Span_Data *sd = user_data;
40 const int pix_stride = sd->raster_buffer->stride / 4; 55 const int pix_stride = sd->raster_buffer->stride / 4;
41 Ector_Software_Buffer_Base_Data *comp = sd->comp; 56 Ector_Software_Buffer_Base_Data *mask = sd->mask;
42 if (!comp || !comp->pixels.u32) return; 57 if (!mask || !mask->pixels.u32) return;
43 58
44 // multiply the color with mul_col if any 59 // multiply the color with mul_col if any
45 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); 60 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col);
@@ -48,7 +63,7 @@ _comp_matte_alpha(int count, const SW_FT_Span *spans, void *user_data)
48 // move to the offset location 63 // move to the offset location
49 uint32_t *buffer = 64 uint32_t *buffer =
50 sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx); 65 sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx);
51 uint32_t *mbuffer = comp->pixels.u32; 66 uint32_t *mbuffer = mask->pixels.u32;
52 67
53 //Temp buffer for intermediate processing 68 //Temp buffer for intermediate processing
54 int tsize = sd->raster_buffer->generic->w; 69 int tsize = sd->raster_buffer->generic->w;
@@ -58,12 +73,12 @@ _comp_matte_alpha(int count, const SW_FT_Span *spans, void *user_data)
58 { 73 {
59 uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x); 74 uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x);
60 uint32_t *mtarget = 75 uint32_t *mtarget =
61 mbuffer + ((comp->generic->w * spans->y) + spans->x); 76 mbuffer + ((mask->generic->w * spans->y) + spans->x);
62 uint32_t *temp = tbuffer; 77 uint32_t *temp = tbuffer;
63 memset(temp, 0x00, sizeof(uint32_t) * spans->len); 78 memset(temp, 0x00, sizeof(uint32_t) * spans->len);
64 comp_func(temp, spans->len, color, spans->coverage); 79 comp_func(temp, spans->len, color, spans->coverage);
65 80
66 //composite 81 //masking
67 for (int i = 0; i < spans->len; i++) 82 for (int i = 0; i < spans->len; i++)
68 { 83 {
69 *temp = draw_mul_256(((*mtarget)>>24), *temp); 84 *temp = draw_mul_256(((*mtarget)>>24), *temp);
@@ -78,12 +93,12 @@ _comp_matte_alpha(int count, const SW_FT_Span *spans, void *user_data)
78} 93}
79 94
80static void 95static void
81_comp_matte_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) 96_blend_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
82{ 97{
83 Span_Data *sd = user_data; 98 Span_Data *sd = user_data;
84 const int pix_stride = sd->raster_buffer->stride / 4; 99 const int pix_stride = sd->raster_buffer->stride / 4;
85 Ector_Software_Buffer_Base_Data *comp = sd->comp; 100 Ector_Software_Buffer_Base_Data *mask = sd->mask;
86 if (!comp || !comp->pixels.u32) return; 101 if (!mask || !mask->pixels.u32) return;
87 102
88 // multiply the color with mul_col if any 103 // multiply the color with mul_col if any
89 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); 104 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col);
@@ -92,7 +107,7 @@ _comp_matte_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
92 // move to the offset location 107 // move to the offset location
93 uint32_t *buffer = 108 uint32_t *buffer =
94 sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx); 109 sd->raster_buffer->pixels.u32 + ((pix_stride * sd->offy) + sd->offx);
95 uint32_t *mbuffer = comp->pixels.u32; 110 uint32_t *mbuffer = mask->pixels.u32;
96 111
97 //Temp buffer for intermediate processing 112 //Temp buffer for intermediate processing
98 int tsize = sd->raster_buffer->generic->w; 113 int tsize = sd->raster_buffer->generic->w;
@@ -102,12 +117,12 @@ _comp_matte_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
102 { 117 {
103 uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x); 118 uint32_t *target = buffer + ((pix_stride * spans->y) + spans->x);
104 uint32_t *mtarget = 119 uint32_t *mtarget =
105 mbuffer + ((comp->generic->w * spans->y) + spans->x); 120 mbuffer + ((mask->generic->w * spans->y) + spans->x);
106 uint32_t *temp = tbuffer; 121 uint32_t *temp = tbuffer;
107 memset(temp, 0x00, sizeof(uint32_t) * spans->len); 122 memset(temp, 0x00, sizeof(uint32_t) * spans->len);
108 comp_func(temp, spans->len, color, spans->coverage); 123 comp_func(temp, spans->len, color, spans->coverage);
109 124
110 //composite 125 //masking
111 for (int i = 0; i < spans->len; i++) 126 for (int i = 0; i < spans->len; i++)
112 { 127 {
113 if (*mtarget) 128 if (*mtarget)
@@ -123,22 +138,22 @@ _comp_matte_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
123} 138}
124 139
125static void 140static void
126_comp_mask_add(int count, const SW_FT_Span *spans, void *user_data) 141_blend_mask_add(int count, const SW_FT_Span *spans, void *user_data)
127{ 142{
128 Span_Data *sd = user_data; 143 Span_Data *sd = user_data;
129 Ector_Software_Buffer_Base_Data *comp = sd->comp; 144 Ector_Software_Buffer_Base_Data *mask = sd->mask;
130 if (!comp || !comp->pixels.u32) return; 145 if (!mask || !mask->pixels.u32) return;
131 146
132 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); 147 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col);
133 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); 148 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color);
134 uint32_t *mbuffer = comp->pixels.u32; 149 uint32_t *mbuffer = mask->pixels.u32;
135 150
136 int tsize = sd->raster_buffer->generic->w; 151 int tsize = sd->raster_buffer->generic->w;
137 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize); 152 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize);
138 153
139 while (count--) 154 while (count--)
140 { 155 {
141 uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); 156 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
142 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); 157 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len);
143 comp_func(ttarget, spans->len, color, spans->coverage); 158 comp_func(ttarget, spans->len, color, spans->coverage);
144 for (int i = 0; i < spans->len; i++) 159 for (int i = 0; i < spans->len; i++)
@@ -148,22 +163,22 @@ _comp_mask_add(int count, const SW_FT_Span *spans, void *user_data)
148} 163}
149 164
150static void 165static void
151_comp_mask_sub(int count, const SW_FT_Span *spans, void *user_data) 166_blend_mask_sub(int count, const SW_FT_Span *spans, void *user_data)
152{ 167{
153 Span_Data *sd = user_data; 168 Span_Data *sd = user_data;
154 Ector_Software_Buffer_Base_Data *comp = sd->comp; 169 Ector_Software_Buffer_Base_Data *mask = sd->mask;
155 if (!comp || !comp->pixels.u32) return; 170 if (!mask || !mask->pixels.u32) return;
156 171
157 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); 172 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col);
158 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); 173 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color);
159 uint32_t *mbuffer = comp->pixels.u32; 174 uint32_t *mbuffer = mask->pixels.u32;
160 175
161 int tsize = sd->raster_buffer->generic->w; 176 int tsize = sd->raster_buffer->generic->w;
162 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize); 177 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize);
163 178
164 while (count--) 179 while (count--)
165 { 180 {
166 uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); 181 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
167 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); 182 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len);
168 comp_func(ttarget, spans->len, color, spans->coverage); 183 comp_func(ttarget, spans->len, color, spans->coverage);
169 for (int i = 0; i < spans->len; i++) 184 for (int i = 0; i < spans->len; i++)
@@ -174,28 +189,28 @@ _comp_mask_sub(int count, const SW_FT_Span *spans, void *user_data)
174 189
175 190
176static void 191static void
177_comp_mask_ins(int count, const SW_FT_Span *spans, void *user_data) 192_blend_mask_ins(int count, const SW_FT_Span *spans, void *user_data)
178{ 193{
179 Span_Data *sd = user_data; 194 Span_Data *sd = user_data;
180 Ector_Software_Buffer_Base_Data *comp = sd->comp; 195 Ector_Software_Buffer_Base_Data *mask = sd->mask;
181 if (!comp || !comp->pixels.u32) return; 196 if (!mask || !mask->pixels.u32) return;
182 197
183 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); 198 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col);
184 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); 199 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color);
185 uint32_t *mbuffer = comp->pixels.u32; 200 uint32_t *mbuffer = mask->pixels.u32;
186 201
187 int tsize = sd->raster_buffer->generic->w; 202 int tsize = sd->raster_buffer->generic->w;
188 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize); 203 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize);
189 204
190 for(unsigned int y = 0; y < comp->generic->h; y++) 205 for(unsigned int y = 0; y < mask->generic->h; y++)
191 { 206 {
192 for(unsigned int x = 0; x < comp->generic->w; x++) 207 for(unsigned int x = 0; x < mask->generic->w; x++)
193 { 208 {
194 if (x == (unsigned int)spans->x && x + spans->len <= comp->generic->w && 209 if (x == (unsigned int)spans->x && x + spans->len <= mask->generic->w &&
195 y == (unsigned int)spans->y && count > 0) 210 y == (unsigned int)spans->y && count > 0)
196 { 211 {
197 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); 212 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len);
198 uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); 213 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
199 comp_func(ttarget, spans->len, color, spans->coverage); 214 comp_func(ttarget, spans->len, color, spans->coverage);
200 for (int c = 0; c < spans->len; c++) 215 for (int c = 0; c < spans->len; c++)
201 mtarget[c] = draw_mul_256(ttarget[c]>>24, mtarget[c]); 216 mtarget[c] = draw_mul_256(ttarget[c]>>24, mtarget[c]);
@@ -205,7 +220,7 @@ _comp_mask_ins(int count, const SW_FT_Span *spans, void *user_data)
205 } 220 }
206 else 221 else
207 { 222 {
208 mbuffer[x + (comp->generic->w * y)] = (0x00FFFFFF & mbuffer[x + (comp->generic->w * y)]); 223 mbuffer[x + (mask->generic->w * y)] = (0x00FFFFFF & mbuffer[x + (mask->generic->w * y)]);
209 } 224 }
210 } 225 }
211 } 226 }
@@ -213,15 +228,15 @@ _comp_mask_ins(int count, const SW_FT_Span *spans, void *user_data)
213 228
214 229
215static void 230static void
216_comp_mask_diff(int count, const SW_FT_Span *spans, void *user_data) 231_blend_mask_diff(int count, const SW_FT_Span *spans, void *user_data)
217{ 232{
218 Span_Data *sd = user_data; 233 Span_Data *sd = user_data;
219 Ector_Software_Buffer_Base_Data *comp = sd->comp; 234 Ector_Software_Buffer_Base_Data *mask = sd->mask;
220 if (!comp || !comp->pixels.u32) return; 235 if (!mask || !mask->pixels.u32) return;
221 236
222 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); 237 uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col);
223 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); 238 RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color);
224 uint32_t *mbuffer = comp->pixels.u32; 239 uint32_t *mbuffer = mask->pixels.u32;
225 240
226 int tsize = sd->raster_buffer->generic->w; 241 int tsize = sd->raster_buffer->generic->w;
227 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize); 242 uint32_t *ttarget = alloca(sizeof(uint32_t) * tsize);
@@ -229,7 +244,7 @@ _comp_mask_diff(int count, const SW_FT_Span *spans, void *user_data)
229 while (count--) 244 while (count--)
230 { 245 {
231 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len); 246 memset(ttarget, 0x00, sizeof(uint32_t) * spans->len);
232 uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); 247 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
233 comp_func(ttarget, spans->len, color, spans->coverage); 248 comp_func(ttarget, spans->len, color, spans->coverage);
234 for (int i = 0; i < spans->len; i++) 249 for (int i = 0; i < spans->len; i++)
235 mtarget[i] = draw_mul_256(0xFF - (mtarget[i]>>24), ttarget[i]) + draw_mul_256(0xFF - (ttarget[i]>>24), mtarget[i]); 250 mtarget[i] = draw_mul_256(0xFF - (mtarget[i]>>24), ttarget[i]) + draw_mul_256(0xFF - (ttarget[i]>>24), mtarget[i]);
@@ -295,8 +310,8 @@ _blend_gradient_alpha(int count, const SW_FT_Span *spans, void *user_data)
295 if (!fetchfunc) 310 if (!fetchfunc)
296 return; 311 return;
297 312
298 Ector_Software_Buffer_Base_Data *comp = data->comp; 313 Ector_Software_Buffer_Base_Data *mask = data->mask;
299 uint32_t *mbuffer = comp->pixels.u32; 314 uint32_t *mbuffer = mask->pixels.u32;
300 315
301 //Temp buffer for intermediate processing 316 //Temp buffer for intermediate processing
302 uint32_t *tbuffer = malloc(sizeof(uint32_t) * data->raster_buffer->generic->w); 317 uint32_t *tbuffer = malloc(sizeof(uint32_t) * data->raster_buffer->generic->w);
@@ -309,7 +324,7 @@ _blend_gradient_alpha(int count, const SW_FT_Span *spans, void *user_data)
309 while (count--) 324 while (count--)
310 { 325 {
311 uint32_t *target = buffer + ((data->raster_buffer->generic->w * spans->y) + spans->x); 326 uint32_t *target = buffer + ((data->raster_buffer->generic->w * spans->y) + spans->x);
312 uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); 327 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
313 uint32_t *temp = tbuffer; 328 uint32_t *temp = tbuffer;
314 int length = spans->len; 329 int length = spans->len;
315 memset(temp, 0x00, sizeof(uint32_t) * spans->len); 330 memset(temp, 0x00, sizeof(uint32_t) * spans->len);
@@ -352,8 +367,8 @@ _blend_gradient_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
352 if (!fetchfunc) 367 if (!fetchfunc)
353 return; 368 return;
354 369
355 Ector_Software_Buffer_Base_Data *comp = data->comp; 370 Ector_Software_Buffer_Base_Data *mask = data->mask;
356 uint32_t *mbuffer = comp->pixels.u32; 371 uint32_t *mbuffer = mask->pixels.u32;
357 372
358 //Temp buffer for intermediate processing 373 //Temp buffer for intermediate processing
359 uint32_t *tbuffer = malloc(sizeof(uint32_t) * data->raster_buffer->generic->w); 374 uint32_t *tbuffer = malloc(sizeof(uint32_t) * data->raster_buffer->generic->w);
@@ -366,7 +381,7 @@ _blend_gradient_alpha_inv(int count, const SW_FT_Span *spans, void *user_data)
366 while (count--) 381 while (count--)
367 { 382 {
368 uint32_t *target = buffer + ((data->raster_buffer->generic->w * spans->y) + spans->x); 383 uint32_t *target = buffer + ((data->raster_buffer->generic->w * spans->y) + spans->x);
369 uint32_t *mtarget = mbuffer + ((comp->generic->w * spans->y) + spans->x); 384 uint32_t *mtarget = mbuffer + ((mask->generic->w * spans->y) + spans->x);
370 uint32_t *temp = tbuffer; 385 uint32_t *temp = tbuffer;
371 int length = spans->len; 386 int length = spans->len;
372 memset(temp, 0x00, sizeof(uint32_t) * spans->len); 387 memset(temp, 0x00, sizeof(uint32_t) * spans->len);
@@ -584,38 +599,38 @@ static void
584_adjust_span_fill_methods(Span_Data *spdata) 599_adjust_span_fill_methods(Span_Data *spdata)
585{ 600{
586 //Blending Function 601 //Blending Function
587 if (spdata->comp) 602 if (spdata->mask)
588 { 603 {
589 switch (spdata->comp_method) 604 switch (spdata->mask_op)
590 { 605 {
591 default: 606 default:
592 case ECTOR_RENDERER_COMPOSITE_METHOD_MATTE_ALPHA: 607 case EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA:
593 if (spdata->type == Solid) 608 if (spdata->type == Solid)
594 spdata->unclipped_blend = &_comp_matte_alpha; 609 spdata->unclipped_blend = &_blend_alpha;
595 else if (spdata->type == LinearGradient || spdata->type == RadialGradient) 610 else if (spdata->type == LinearGradient || spdata->type == RadialGradient)
596 spdata->unclipped_blend = &_blend_gradient_alpha; 611 spdata->unclipped_blend = &_blend_gradient_alpha;
597 else //None 612 else //None
598 spdata->unclipped_blend = NULL; 613 spdata->unclipped_blend = NULL;
599 break; 614 break;
600 case ECTOR_RENDERER_COMPOSITE_METHOD_MATTE_ALPHA_INVERSE: 615 case EFL_CANVAS_VG_NODE_BLEND_TYPE_ALPHA_INV:
601 if (spdata->type == Solid) 616 if (spdata->type == Solid)
602 spdata->unclipped_blend = &_comp_matte_alpha_inv; 617 spdata->unclipped_blend = &_blend_alpha_inv;
603 else if (spdata->type == LinearGradient || spdata->type == RadialGradient) 618 else if (spdata->type == LinearGradient || spdata->type == RadialGradient)
604 spdata->unclipped_blend = &_blend_gradient_alpha_inv; 619 spdata->unclipped_blend = &_blend_gradient_alpha_inv;
605 else //None 620 else //None
606 spdata->unclipped_blend = NULL; 621 spdata->unclipped_blend = NULL;
607 break; 622 break;
608 case ECTOR_RENDERER_COMPOSITE_METHOD_MASK_ADD: 623 case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_ADD:
609 spdata->unclipped_blend = &_comp_mask_add; 624 spdata->unclipped_blend = &_blend_mask_add;
610 break; 625 break;
611 case ECTOR_RENDERER_COMPOSITE_METHOD_MASK_SUBSTRACT: 626 case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_SUBSTRACT:
612 spdata->unclipped_blend = &_comp_mask_sub; 627 spdata->unclipped_blend = &_blend_mask_sub;
613 break; 628 break;
614 case ECTOR_RENDERER_COMPOSITE_METHOD_MASK_INTERSECT: 629 case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_INTERSECT:
615 spdata->unclipped_blend = &_comp_mask_ins; 630 spdata->unclipped_blend = &_blend_mask_ins;
616 break; 631 break;
617 case ECTOR_RENDERER_COMPOSITE_METHOD_MASK_DIFFERENCE: 632 case EFL_CANVAS_VG_NODE_BLEND_TYPE_MASK_DIFFERENCE:
618 spdata->unclipped_blend = &_comp_mask_diff; 633 spdata->unclipped_blend = &_blend_mask_diff;
619 break; 634 break;
620 } 635 }
621 } 636 }
@@ -895,8 +910,8 @@ void
895ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer, 910ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer,
896 int x, int y, uint32_t mul_col, 911 int x, int y, uint32_t mul_col,
897 Efl_Gfx_Render_Op op, Shape_Rle_Data* rle, 912 Efl_Gfx_Render_Op op, Shape_Rle_Data* rle,
898 Ector_Buffer *comp, 913 Ector_Buffer *mask,
899 Ector_Renderer_Composite_Method comp_method) 914 int mask_op)
900{ 915{
901 if (!rle) return; 916 if (!rle) return;
902 if (!rasterizer->fill_data.raster_buffer->pixels.u32) return; 917 if (!rasterizer->fill_data.raster_buffer->pixels.u32) return;
@@ -905,9 +920,9 @@ ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer,
905 rasterizer->fill_data.offy = y; 920 rasterizer->fill_data.offy = y;
906 rasterizer->fill_data.mul_col = mul_col; 921 rasterizer->fill_data.mul_col = mul_col;
907 rasterizer->fill_data.op = op; 922 rasterizer->fill_data.op = op;
908 rasterizer->fill_data.comp = 923 rasterizer->fill_data.mask =
909 comp ? efl_data_scope_get(comp, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN) : NULL; 924 mask ? efl_data_scope_get(mask, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN) : NULL;
910 rasterizer->fill_data.comp_method = comp_method; 925 rasterizer->fill_data.mask_op = mask_op;
911 926
912 _setup_span_fill_matrix(rasterizer); 927 _setup_span_fill_matrix(rasterizer);
913 _adjust_span_fill_methods(&rasterizer->fill_data); 928 _adjust_span_fill_methods(&rasterizer->fill_data);