summaryrefslogtreecommitdiff
path: root/src/lib/ector
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-01-18 11:47:25 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-04-14 11:26:43 +0900
commit2ef8d6f39af839c23551239216cea100254f80df (patch)
tree415581d3cb5245012225777926638827051bc3c2 /src/lib/ector
parentfb52c15e8513cc1458341da13e570d231a886551 (diff)
evas filters: Refactor ector and gfx filters A LOT
Alright, so this is a massive patch that is the result of trying to get rid of unused or poorly implemented classes in ector. Originally ector was meant to support VG but extend to things like filters as well. At the moment, ector's design makes it quite hard to plug in the filters. For now I think it's easier to implement the GL support for the filters directly in the engine, where I hope to interfere as little as possible. This massive patch keeps only the required minimum to support a versatile gl buffer that can be mapped, drawn or rendered to (FBO). It's extremely inefficient as it relies on glReadPixels and lots of texture uploads, as well as conversions between ARGB and Alpha. Another type of GL buffer is a wrap around an existing GL image, but that one is read-only (map or draw: no write map, no FBO). No, all the filters run fine, and the high-level implementation (evas_filters.c) does not need to know whether the underlying engine is SW or GL. One problem though appears with the blending or blurring of some Alpha buffers, the colors are wrong. This patch removes more lines than it adds so it must be good ;)
Diffstat (limited to 'src/lib/ector')
-rw-r--r--src/lib/ector/cairo/ector_cairo_software_surface.c7
-rw-r--r--src/lib/ector/ector_buffer.c9
-rw-r--r--src/lib/ector/ector_buffer.eo38
-rw-r--r--src/lib/ector/ector_buffer.h15
-rw-r--r--src/lib/ector/ector_renderer.h1
-rw-r--r--src/lib/ector/ector_renderer_buffer.c45
-rw-r--r--src/lib/ector/ector_renderer_buffer.eo17
-rw-r--r--src/lib/ector/gl/Ector_GL.h1
-rw-r--r--src/lib/ector/gl/ector_gl_buffer.eo2
-rw-r--r--src/lib/ector/gl/ector_gl_buffer_base.c65
-rw-r--r--src/lib/ector/gl/ector_gl_buffer_base.eo60
-rw-r--r--src/lib/ector/software/Ector_Software.h1
-rw-r--r--src/lib/ector/software/ector_renderer_software_buffer.c72
-rw-r--r--src/lib/ector/software/ector_renderer_software_buffer.eo20
-rw-r--r--src/lib/ector/software/ector_software_buffer.c138
-rw-r--r--src/lib/ector/software/ector_software_buffer_base.eo2
-rw-r--r--src/lib/ector/software/ector_software_private.h2
-rw-r--r--src/lib/ector/software/ector_software_rasterizer.c49
-rw-r--r--src/lib/ector/software/ector_software_surface.c13
19 files changed, 58 insertions, 499 deletions
diff --git a/src/lib/ector/cairo/ector_cairo_software_surface.c b/src/lib/ector/cairo/ector_cairo_software_surface.c
index d96fdd517e..98dd8e0a4f 100644
--- a/src/lib/ector/cairo/ector_cairo_software_surface.c
+++ b/src/lib/ector/cairo/ector_cairo_software_surface.c
@@ -51,9 +51,8 @@ struct _Ector_Cairo_Software_Surface_Data
51 51
52EOLIAN static Eina_Bool 52EOLIAN static Eina_Bool
53_ector_cairo_software_surface_ector_buffer_pixels_set(Eo *obj, Ector_Cairo_Software_Surface_Data *pd, 53_ector_cairo_software_surface_ector_buffer_pixels_set(Eo *obj, Ector_Cairo_Software_Surface_Data *pd,
54 void *pixels, int width, int height, int stride, 54 void *pixels, int width, int height,
55 Efl_Gfx_Colorspace cspace, Eina_Bool writable, 55 Efl_Gfx_Colorspace cspace, Eina_Bool writable)
56 unsigned char l, unsigned char r, unsigned char t, unsigned char b)
57{ 56{
58 cairo_t *ctx = NULL; 57 cairo_t *ctx = NULL;
59 Eina_Bool ok = EINA_FALSE; 58 Eina_Bool ok = EINA_FALSE;
@@ -73,7 +72,7 @@ _ector_cairo_software_surface_ector_buffer_pixels_set(Eo *obj, Ector_Cairo_Softw
73 cairo_surface_destroy(pd->surface); 72 cairo_surface_destroy(pd->surface);
74 pd->surface = NULL; 73 pd->surface = NULL;
75 74
76 ok = ector_buffer_pixels_set(efl_super(obj, MY_CLASS), pixels, width, height, stride, cspace, writable, l, r, t, b); 75 ok = ector_buffer_pixels_set(efl_super(obj, MY_CLASS), pixels, width, height, cspace, writable);
77 76
78 if (ok && pixels) 77 if (ok && pixels)
79 { 78 {
diff --git a/src/lib/ector/ector_buffer.c b/src/lib/ector/ector_buffer.c
index 9fe9ed6930..51dbd1496a 100644
--- a/src/lib/ector/ector_buffer.c
+++ b/src/lib/ector/ector_buffer.c
@@ -15,15 +15,6 @@ _ector_buffer_cspace_get(Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd)
15} 15}
16 16
17EOLIAN static void 17EOLIAN static void
18_ector_buffer_border_get(Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd EINA_UNUSED, int *l, int *r, int *t, int *b)
19{
20 if (l) *l = pd->l;
21 if (r) *r = pd->r;
22 if (t) *t = pd->t;
23 if (b) *b = pd->b;
24}
25
26EOLIAN static void
27_ector_buffer_size_get(Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd, int *w, int *h) 18_ector_buffer_size_get(Eo *obj EINA_UNUSED, Ector_Buffer_Data *pd, int *w, int *h)
28{ 19{
29 if (w) *w = pd->w; 20 if (w) *w = pd->w;
diff --git a/src/lib/ector/ector_buffer.eo b/src/lib/ector/ector_buffer.eo
index 0b8782ff68..f90bb1df1d 100644
--- a/src/lib/ector/ector_buffer.eo
+++ b/src/lib/ector/ector_buffer.eo
@@ -24,6 +24,7 @@ enum Ector.Buffer.Access_Flag {
24mixin Ector.Buffer 24mixin Ector.Buffer
25{ 25{
26 [[2D pixel buffer interface for Ector 26 [[2D pixel buffer interface for Ector
27
27 @since 1.17 28 @since 1.17
28 ]] 29 ]]
29 eo_prefix: ector_buffer; 30 eo_prefix: ector_buffer;
@@ -76,38 +77,11 @@ mixin Ector.Buffer
76 @in pixels: void_ptr; [[If $null, allocates an empty buffer]] 77 @in pixels: void_ptr; [[If $null, allocates an empty buffer]]
77 @in width: int; [[Buffer width]] 78 @in width: int; [[Buffer width]]
78 @in height: int; [[Buffer height]] 79 @in height: int; [[Buffer height]]
79 @in stride: int; [[Can be 0]]
80 @in cspace: Efl.Gfx.Colorspace; [[Buffer colorspace]] 80 @in cspace: Efl.Gfx.Colorspace; [[Buffer colorspace]]
81 @in writable: bool; [[Buffer is writable]] 81 @in writable: bool; [[Buffer is writable]]
82 @in l: ubyte; [[Left border pixels, usually 0 or 1]]
83 @in r: ubyte; [[Right border pixels, usually 0 or 1]]
84 @in t: ubyte; [[Top border pixels, usually 0 or 1]]
85 @in b: ubyte; [[Bottom border pixels, usually 0 or 1]]
86 } 82 }
87 return: bool; [[True if pixels_set was successful]] 83 return: bool; [[True if pixels_set was successful]]
88 } 84 }
89 span_get @pure_virtual {
90 [[Get a single horizontal span of length w starting from (x,y)
91
92 Call span_free() to release it. This function will try not to
93 allocate any new buffer, whenever possible. This means the data
94 might be mapped directly from the backing memory buffer.
95 ]]
96 params {
97 @in x: int; [[Ranges from -l to w+r-1]]
98 @in y: int; [[Ranges from -t to h+b-1]]
99 @in w: uint; [[Ranges from 1 to w+l+r]]
100 @in cspace: Efl.Gfx.Colorspace; [[Requested colorspace, may trigger conversion on the fly.]]
101 @out length: uint; [[Length in bytes of the returned buffer]]
102 }
103 return: ptr(uint8); [[A temporary memory buffer containing the pixels requested.]]
104 }
105 span_free @pure_virtual {
106 [[Must be called as soon as possible after span_get]]
107 params {
108 data: ptr(uint8); [[Data to be freed]]
109 }
110 }
111 @property flags { 85 @property flags {
112 [[The capabilities of this buffer]] 86 [[The capabilities of this buffer]]
113 get {} 87 get {}
@@ -115,16 +89,6 @@ mixin Ector.Buffer
115 flag: Ector.Buffer.Flag; [[A bitmask of capability flags]] 89 flag: Ector.Buffer.Flag; [[A bitmask of capability flags]]
116 } 90 }
117 } 91 }
118 @property border {
119 [[Duplicated pixel borders of this buffer, used for GL scaling]]
120 get {}
121 values {
122 l: int; [[Left border]]
123 r: int; [[Right border]]
124 t: int; [[Top border]]
125 b: int; [[Bottom border]]
126 }
127 }
128 } 92 }
129 events { 93 events {
130 detached; [[Emitted whenever the previously attached pixels are detached during pixels_set]] 94 detached; [[Emitted whenever the previously attached pixels are detached during pixels_set]]
diff --git a/src/lib/ector/ector_buffer.h b/src/lib/ector/ector_buffer.h
index e19c7fe4a6..9c91bfd4a4 100644
--- a/src/lib/ector/ector_buffer.h
+++ b/src/lib/ector/ector_buffer.h
@@ -18,13 +18,11 @@ typedef Eo Ector_Buffer;
18 18
19typedef struct _Ector_Buffer_Data Ector_Buffer_Data; 19typedef struct _Ector_Buffer_Data Ector_Buffer_Data;
20typedef struct _Ector_Software_Buffer_Base_Data Ector_Software_Buffer_Base_Data; 20typedef struct _Ector_Software_Buffer_Base_Data Ector_Software_Buffer_Base_Data;
21typedef struct _Ector_GL_Buffer_Base_Data Ector_GL_Buffer_Base_Data;
22 21
23struct _Ector_Buffer_Data 22struct _Ector_Buffer_Data
24{ 23{
25 Ector_Buffer *eo; 24 Ector_Buffer *eo;
26 unsigned int w, h; 25 unsigned int w, h;
27 unsigned char l, r, t, b;
28 Efl_Gfx_Colorspace cspace; 26 Efl_Gfx_Colorspace cspace;
29 Eina_Bool immutable : 1; // pixels_set is forbidden 27 Eina_Bool immutable : 1; // pixels_set is forbidden
30}; 28};
@@ -45,17 +43,4 @@ struct _Ector_Software_Buffer_Base_Data
45 Eina_Bool nofree : 1; // pixel data should not be free()'ed 43 Eina_Bool nofree : 1; // pixel data should not be free()'ed
46}; 44};
47 45
48struct _Ector_GL_Buffer_Base_Data
49{
50 Ector_Buffer_Data *generic;
51 int texid;
52 int fboid;
53 struct {
54 // x,y offset within the atlas
55 // w,h size of the atlas itself
56 int x, y, w, h;
57 } atlas;
58 Eina_Bool whole : 1;
59};
60
61#endif 46#endif
diff --git a/src/lib/ector/ector_renderer.h b/src/lib/ector/ector_renderer.h
index e2e2e65f58..c8d20d2fb3 100644
--- a/src/lib/ector/ector_renderer.h
+++ b/src/lib/ector/ector_renderer.h
@@ -3,7 +3,6 @@
3 3
4#include "ector_renderer.eo.h" 4#include "ector_renderer.eo.h"
5#include "ector_renderer_shape.eo.h" 5#include "ector_renderer_shape.eo.h"
6#include "ector_renderer_buffer.eo.h"
7#include "ector_renderer_gradient.eo.h" 6#include "ector_renderer_gradient.eo.h"
8#include "ector_renderer_gradient_linear.eo.h" 7#include "ector_renderer_gradient_linear.eo.h"
9#include "ector_renderer_gradient_radial.eo.h" 8#include "ector_renderer_gradient_radial.eo.h"
diff --git a/src/lib/ector/ector_renderer_buffer.c b/src/lib/ector/ector_renderer_buffer.c
deleted file mode 100644
index 56bb6f13e1..0000000000
--- a/src/lib/ector/ector_renderer_buffer.c
+++ /dev/null
@@ -1,45 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#else
4# define EFL_BETA_API_SUPPORT
5#endif
6
7#include <Eo.h>
8#include "ector_private.h"
9#include "ector_renderer_buffer.eo.h"
10
11#define MY_CLASS ECTOR_RENDERER_BUFFER_MIXIN
12
13EOLIAN static void
14_ector_renderer_buffer_efl_gfx_fill_fill_get(Eo *obj EINA_UNUSED, Ector_Renderer_Buffer_Data *pd, int *x, int *y, int *w, int *h)
15{
16 if (x) *x = pd->fill.x;
17 if (y) *y = pd->fill.y;
18 if (w) *w = pd->fill.w;
19 if (h) *h = pd->fill.h;
20}
21
22EOLIAN static void
23_ector_renderer_buffer_efl_gfx_fill_fill_set(Eo *obj EINA_UNUSED, Ector_Renderer_Buffer_Data *pd, int x, int y, int w, int h)
24{
25 if (w < 0) w = 0;
26 if (h < 0) h = 0;
27 pd->fill.x = x;
28 pd->fill.y = y;
29 pd->fill.w = w;
30 pd->fill.h = h;
31}
32
33EOLIAN static void
34_ector_renderer_buffer_buffer_set(Eo *obj EINA_UNUSED, Ector_Renderer_Buffer_Data *pd, Ector_Buffer *buf)
35{
36 _efl_xrefplace(&pd->eo_buffer, buf, obj);
37}
38
39EOLIAN static Ector_Buffer *
40_ector_renderer_buffer_buffer_get(Eo *obj EINA_UNUSED, Ector_Renderer_Buffer_Data *pd)
41{
42 return pd->eo_buffer;
43}
44
45#include "ector_renderer_buffer.eo.c"
diff --git a/src/lib/ector/ector_renderer_buffer.eo b/src/lib/ector/ector_renderer_buffer.eo
deleted file mode 100644
index b3e97d2053..0000000000
--- a/src/lib/ector/ector_renderer_buffer.eo
+++ /dev/null
@@ -1,17 +0,0 @@
1mixin Ector.Renderer.Buffer (Efl.Interface, Ector.Renderer, Efl.Gfx.Fill)
2{
3 [[Ector buffers have a default fill set to repeat]]
4 eo_prefix: ector_renderer_buffer;
5 methods {
6 @property buffer {
7 set { [[Sets the source buffer for this renderer, adds a ref]] }
8 get { [[Return the current source, no ref change]] }
9 values {
10 buf: Ector.Buffer; [[Buffer]]
11 }
12 }
13 }
14 implements {
15 Efl.Gfx.Fill.fill { get; set; }
16 }
17}
diff --git a/src/lib/ector/gl/Ector_GL.h b/src/lib/ector/gl/Ector_GL.h
index 04d76c0af1..df6ece47b7 100644
--- a/src/lib/ector/gl/Ector_GL.h
+++ b/src/lib/ector/gl/Ector_GL.h
@@ -15,7 +15,6 @@ typedef Eo Ector_Cairo_Surface;
15typedef unsigned int GLuint; 15typedef unsigned int GLuint;
16typedef short GLshort; 16typedef short GLshort;
17 17
18#include "gl/ector_gl_buffer_base.eo.h"
19#include "gl/ector_gl_buffer.eo.h" 18#include "gl/ector_gl_buffer.eo.h"
20#include "gl/ector_gl_surface.eo.h" 19#include "gl/ector_gl_surface.eo.h"
21#include "gl/ector_renderer_gl.eo.h" 20#include "gl/ector_renderer_gl.eo.h"
diff --git a/src/lib/ector/gl/ector_gl_buffer.eo b/src/lib/ector/gl/ector_gl_buffer.eo
index 67b96ae4e9..03171eac8c 100644
--- a/src/lib/ector/gl/ector_gl_buffer.eo
+++ b/src/lib/ector/gl/ector_gl_buffer.eo
@@ -1,4 +1,4 @@
1class Ector.GL.Buffer (Efl.Object, Ector.GL.Buffer.Base) 1class Ector.GL.Buffer (Efl.Object, Ector.Buffer)
2{ 2{
3 [[Ector GL buffer class]] 3 [[Ector GL buffer class]]
4 data: null; 4 data: null;
diff --git a/src/lib/ector/gl/ector_gl_buffer_base.c b/src/lib/ector/gl/ector_gl_buffer_base.c
deleted file mode 100644
index 954988a0fb..0000000000
--- a/src/lib/ector/gl/ector_gl_buffer_base.c
+++ /dev/null
@@ -1,65 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include "Ector_GL.h"
6#include "ector_gl_private.h"
7#include "ector_buffer.h"
8#include "ector_gl_buffer_base.eo.h"
9
10#define MY_CLASS ECTOR_GL_BUFFER_BASE_MIXIN
11
12EOLIAN static int
13_ector_gl_buffer_base_texture_get(Eo *obj EINA_UNUSED, Ector_GL_Buffer_Base_Data *pd)
14{
15 return pd->texid;
16}
17
18EOLIAN static int
19_ector_gl_buffer_base_fbo_get(Eo *obj EINA_UNUSED, Ector_GL_Buffer_Base_Data *pd)
20{
21 return pd->fboid;
22}
23
24EOLIAN static Eina_Bool
25_ector_gl_buffer_base_whole_get(Eo *obj EINA_UNUSED, Ector_GL_Buffer_Base_Data *pd)
26{
27 return pd->whole;
28}
29
30EOLIAN static void
31_ector_gl_buffer_base_vertices_get(Eo *obj EINA_UNUSED, Ector_GL_Buffer_Base_Data *pd, double *x, double *y, double *w, double *h)
32{
33 if (x) *x = (double) pd->atlas.x / pd->atlas.w;
34 if (y) *y = (double) pd->atlas.y / pd->atlas.h;
35 if (w) *w = (double) pd->generic->w / pd->atlas.w;
36 if (h) *h = (double) pd->generic->h / pd->atlas.h;
37}
38
39EOLIAN static void
40_ector_gl_buffer_base_attach(Eo *obj EINA_UNUSED, Ector_GL_Buffer_Base_Data *pd,
41 int texid, int fboid, Efl_Gfx_Colorspace cspace,
42 int imw, int imh, int tx, int ty, int tw, int th,
43 int l, int r, int t, int b)
44{
45 EINA_SAFETY_ON_NULL_RETURN(pd->generic);
46 EINA_SAFETY_ON_FALSE_RETURN(!pd->generic->immutable);
47
48 pd->generic->cspace = cspace;
49 pd->generic->w = imw;
50 pd->generic->h = imh;
51 pd->atlas.x = tx;
52 pd->atlas.y = ty;
53 pd->atlas.w = tw;
54 pd->atlas.h = th;
55 pd->generic->l = l;
56 pd->generic->r = r;
57 pd->generic->t = t;
58 pd->generic->b = b;
59 if (!(tx - l) && !(ty - t) && ((tw + l + r) == imw) && ((th + t + b) == imh))
60 pd->whole = EINA_TRUE;
61 pd->fboid = fboid;
62 pd->texid = texid;
63}
64
65#include "ector_gl_buffer_base.eo.c"
diff --git a/src/lib/ector/gl/ector_gl_buffer_base.eo b/src/lib/ector/gl/ector_gl_buffer_base.eo
deleted file mode 100644
index 2a1718246b..0000000000
--- a/src/lib/ector/gl/ector_gl_buffer_base.eo
+++ /dev/null
@@ -1,60 +0,0 @@
1mixin Ector.GL.Buffer.Base (Ector.Buffer)
2{
3 [[Ector GL buffer base class]]
4 methods {
5 @property texture {
6 [[GL texture ID]]
7 get {}
8 values {
9 texid: int; [[GL texture ID]]
10 }
11 }
12 @property fbo {
13 [[Framebuffer object ID]]
14 get {}
15 values {
16 fboid: int; [[GL framebuffer ID, 0 if there is no FBO]]
17 }
18 }
19 @property whole {
20 [[If $true, the image is covering the entire GL texture, ie. it's not
21 part of an atlas.
22 ]]
23 get {}
24 values {
25 is_whole: bool; [[$true if the image is covering the whole GL texture, $false otherwise]]
26 }
27 }
28 @property vertices {
29 [[Returns the texture vertices to draw this image with no rotation
30
31 The 4 points are then defined as (x,y), (x+w,y), (x,y+h), (x+w,y+h).
32 ]]
33 get {}
34 values {
35 x: double; [[X position of this image inside the texture atlas, from 0 to 1]]
36 y: double; [[Y position of this image inside the texture atlas, from 0 to 1]]
37 w: double; [[Width of this image inside the texture atlas, from 0 to 1]]
38 h: double; [[Height of this image inside the texture atlas, from 0 to 1]]
39 }
40 }
41 attach @protected {
42 [[Attach to an existing texture (or FBO). Used from child classes.]]
43 params {
44 texid: int; [[GL texture ID]]
45 fboid: int; [[Framebuffer object ID]]
46 cspace: Efl.Gfx.Colorspace; [[Colorspace]]
47 imw: int; [[Image width]]
48 imh: int; [[Image height]]
49 tx: int; [[Texture X coordinate]]
50 ty: int; [[Texture Y coordinate]]
51 tw: int; [[Texture width]]
52 th: int; [[Texture height]]
53 l: int; [[Left padding]]
54 r: int; [[Right padding]]
55 t: int; [[Top padding]]
56 b: int; [[Bottom padding]]
57 }
58 }
59 }
60}
diff --git a/src/lib/ector/software/Ector_Software.h b/src/lib/ector/software/Ector_Software.h
index f53526c5b2..7c94b895cf 100644
--- a/src/lib/ector/software/Ector_Software.h
+++ b/src/lib/ector/software/Ector_Software.h
@@ -10,7 +10,6 @@
10#include "software/ector_software_buffer_base.eo.h" 10#include "software/ector_software_buffer_base.eo.h"
11#include "software/ector_renderer_software.eo.h" 11#include "software/ector_renderer_software.eo.h"
12#include "software/ector_renderer_software_shape.eo.h" 12#include "software/ector_renderer_software_shape.eo.h"
13#include "software/ector_renderer_software_buffer.eo.h"
14#include "software/ector_renderer_software_gradient_linear.eo.h" 13#include "software/ector_renderer_software_gradient_linear.eo.h"
15#include "software/ector_renderer_software_gradient_radial.eo.h" 14#include "software/ector_renderer_software_gradient_radial.eo.h"
16 15
diff --git a/src/lib/ector/software/ector_renderer_software_buffer.c b/src/lib/ector/software/ector_renderer_software_buffer.c
deleted file mode 100644
index 9d524af72e..0000000000
--- a/src/lib/ector/software/ector_renderer_software_buffer.c
+++ /dev/null
@@ -1,72 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#else
4# define EFL_BETA_API_SUPPORT
5#endif
6
7#include <Eo.h>
8#include "Ector_Software.h"
9#include "ector_private.h"
10#include "ector_software_private.h"
11
12#define MY_CLASS ECTOR_RENDERER_SOFTWARE_BUFFER_CLASS
13
14typedef struct
15{
16 Ector_Renderer_Data *base;
17 Software_Rasterizer *surface;
18 Ector_Buffer *eo_buffer;
19} Ector_Renderer_Software_Buffer_Data;
20
21
22EOLIAN static void
23_ector_renderer_software_buffer_buffer_set(Eo *obj, Ector_Renderer_Software_Buffer_Data *pd, Ector_Buffer *buf)
24{
25 _efl_xrefplace(&pd->eo_buffer, buf, obj);
26}
27
28EOLIAN static Ector_Buffer *
29_ector_renderer_software_buffer_buffer_get(Eo *obj EINA_UNUSED, Ector_Renderer_Software_Buffer_Data *pd)
30{
31 return pd->eo_buffer;
32}
33
34EOLIAN static Eina_Bool
35_ector_renderer_software_buffer_ector_renderer_software_fill(Eo *obj, Ector_Renderer_Software_Buffer_Data *pd)
36{
37 Ector_Software_Buffer *buffer = efl_data_scope_get(obj, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN);
38 ector_software_rasterizer_buffer_set(pd->surface, buffer);
39 return EINA_TRUE;
40}
41
42EOLIAN static Eina_Bool
43_ector_renderer_software_buffer_ector_renderer_prepare(Eo *obj, Ector_Renderer_Software_Buffer_Data *pd)
44{
45 if (!pd->surface)
46 pd->surface = efl_data_xref(pd->base->surface, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
47
48 return EINA_TRUE;
49}
50
51EOLIAN static unsigned int
52_ector_renderer_software_buffer_ector_renderer_crc_get(Eo *obj, Ector_Renderer_Software_Buffer_Data *pd)
53{
54 Ector_Software_Buffer_Base_Data *buffer = efl_data_scope_get(pd->eo_buffer, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN);
55 unsigned int crc;
56
57 crc = ector_renderer_crc_get(efl_super(obj, MY_CLASS));
58 crc = eina_crc((const char *) buffer, sizeof(*buffer), crc, EINA_FALSE);
59 if (pd->surface)
60 crc = eina_crc((const char *) pd->surface, sizeof(*pd->surface), crc, EINA_FALSE);
61
62 return crc;
63}
64
65EOLIAN static void
66_ector_renderer_software_buffer_efl_object_destructor(Eo *obj, Ector_Renderer_Software_Buffer_Data *pd)
67{
68 efl_data_xunref(pd->base->surface, pd->surface, obj);
69 efl_destructor(efl_super(obj, MY_CLASS));
70}
71
72#include "ector_renderer_software_buffer.eo.c"
diff --git a/src/lib/ector/software/ector_renderer_software_buffer.eo b/src/lib/ector/software/ector_renderer_software_buffer.eo
deleted file mode 100644
index 91878f2286..0000000000
--- a/src/lib/ector/software/ector_renderer_software_buffer.eo
+++ /dev/null
@@ -1,20 +0,0 @@
1class Ector.Renderer.Software.Buffer (Ector.Renderer.Software, Ector.Renderer.Buffer)
2{
3 [[Ecto software renderer buffer class]]
4 methods {
5 @property buffer {
6 [[Buffer property]]
7 set {}
8 get {}
9 values {
10 buf: Ector.Buffer; [[Buffer]]
11 }
12 }
13 }
14 implements {
15 Ector.Renderer.prepare;
16 Ector.Renderer.crc { get; }
17 Ector.Renderer.Software.fill;
18 Efl.Object.destructor;
19 }
20}
diff --git a/src/lib/ector/software/ector_software_buffer.c b/src/lib/ector/software/ector_software_buffer.c
index 499206309d..d44962bbec 100644
--- a/src/lib/ector/software/ector_software_buffer.c
+++ b/src/lib/ector/software/ector_software_buffer.c
@@ -16,24 +16,13 @@ typedef struct _Ector_Software_Buffer_Map
16{ 16{
17 EINA_INLIST; 17 EINA_INLIST;
18 uint8_t *ptr; 18 uint8_t *ptr;
19 unsigned int size; // in bytes 19 unsigned int size, stride; // in bytes
20 unsigned int x, y, w, h; 20 unsigned int x, y, w, h;
21 Efl_Gfx_Colorspace cspace; 21 Efl_Gfx_Colorspace cspace;
22 Eina_Bool allocated; 22 Eina_Bool allocated;
23 Ector_Buffer_Access_Flag mode; 23 Ector_Buffer_Access_Flag mode;
24} Ector_Software_Buffer_Map; 24} Ector_Software_Buffer_Map;
25 25
26static inline int
27_min_stride_calc(int width, Efl_Gfx_Colorspace cspace)
28{
29 switch (cspace)
30 {
31 case EFL_GFX_COLORSPACE_ARGB8888: return width * 4;
32 case EFL_GFX_COLORSPACE_GRY8: return width;
33 default: return 0;
34 }
35}
36
37/* FIXME: Conversion routines don't belong here */ 26/* FIXME: Conversion routines don't belong here */
38static inline void 27static inline void
39_pixels_argb_to_gry8_convert(uint8_t *dst, const uint32_t *src, int len) 28_pixels_argb_to_gry8_convert(uint8_t *dst, const uint32_t *src, int len)
@@ -64,10 +53,7 @@ _ector_software_buffer_base_pixels_clear(Eo *obj, Ector_Software_Buffer_Base_Dat
64 return; 53 return;
65 54
66 if (pd->internal.maps) 55 if (pd->internal.maps)
67 { 56 fail("Can not call pixels_clear when the buffer is mapped.");
68 CRI("Can not call pixels_clear when the buffer is mapped.");
69 return;
70 }
71 57
72 efl_event_callback_call(obj, ECTOR_BUFFER_EVENT_DETACHED, pd->pixels.u8); 58 efl_event_callback_call(obj, ECTOR_BUFFER_EVENT_DETACHED, pd->pixels.u8);
73 if (!pd->nofree) 59 if (!pd->nofree)
@@ -76,54 +62,37 @@ _ector_software_buffer_base_pixels_clear(Eo *obj, Ector_Software_Buffer_Base_Dat
76 } 62 }
77 pd->pixels.u8 = NULL; 63 pd->pixels.u8 = NULL;
78 pd->nofree = EINA_FALSE; 64 pd->nofree = EINA_FALSE;
65
66 return;
67
68on_fail:
69 return;
79} 70}
80 71
81EOLIAN static Eina_Bool 72EOLIAN static Eina_Bool
82_ector_software_buffer_base_ector_buffer_pixels_set(Eo *obj, Ector_Software_Buffer_Base_Data *pd, 73_ector_software_buffer_base_ector_buffer_pixels_set(Eo *obj, Ector_Software_Buffer_Base_Data *pd,
83 void *pixels, int width, int height, int stride, 74 void *pixels, int width, int height,
84 Efl_Gfx_Colorspace cspace, Eina_Bool writable, 75 Efl_Gfx_Colorspace cspace, Eina_Bool writable)
85 unsigned char l, unsigned char r,
86 unsigned char t, unsigned char b)
87{ 76{
88 unsigned px; 77 unsigned pxs, stride;
89 78
90 if (pd->generic->immutable) 79 if (pd->generic->immutable)
91 { 80 fail("This buffer is immutable.");
92 ERR("This buffer is immutable.");
93 return EINA_FALSE;
94 }
95 81
96 if (pd->internal.maps) 82 if (pd->internal.maps)
97 { 83 fail("Can not call pixels_set when the buffer is mapped.");
98 ERR("Can not call pixels_set when the buffer is mapped.");
99 return EINA_FALSE;
100 }
101
102 // safety check
103 px = _min_stride_calc(1, cspace);
104 if (px && ((unsigned long long)(uintptr_t)pixels) & (px - 1))
105 ERR("Pixel data is not aligned to %u bytes!", px);
106
107 if ((cspace != EFL_GFX_COLORSPACE_ARGB8888) &&
108 (cspace != EFL_GFX_COLORSPACE_GRY8))
109 {
110 ERR("Unsupported colorspace: %u", cspace);
111 return EINA_FALSE;
112 }
113 84
114 if (!stride) 85 if (cspace == EFL_GFX_COLORSPACE_ARGB8888)
115 stride = _min_stride_calc(width + l + r, cspace); 86 pxs = 4;
116 else if (stride < _min_stride_calc(width + l + r, cspace)) 87 else if (cspace == EFL_GFX_COLORSPACE_GRY8)
117 { 88 pxs = 1;
118 ERR("Invalid stride %u for width %u (+%u+%u) cspace %u. pixels_set failed.", 89 else
119 stride, width, l, r, cspace); 90 fail("Unsupported colorspace: %u", cspace);
120 _ector_software_buffer_base_pixels_clear(obj, pd);
121 return EINA_FALSE;
122 }
123 91
124 if ((px > 1) && (stride & (px - 1))) 92 if (((unsigned long long)(uintptr_t)pixels) & (pxs - 1))
125 ERR("Stride (%d) is not aligned to the pixel size (%d)", stride, px); 93 fail ("Pixel data is not aligned to %u bytes!", pxs);
126 94
95 stride = width * pxs;
127 if (pd->pixels.u8 && (pd->pixels.u8 != pixels)) 96 if (pd->pixels.u8 && (pd->pixels.u8 != pixels))
128 _ector_software_buffer_base_pixels_clear(obj, pd); 97 _ector_software_buffer_base_pixels_clear(obj, pd);
129 98
@@ -135,31 +104,30 @@ _ector_software_buffer_base_ector_buffer_pixels_set(Eo *obj, Ector_Software_Buff
135 } 104 }
136 else 105 else
137 { 106 {
138 pd->pixels.u8 = calloc(stride * (height + t + b), 1); 107 pd->pixels.u8 = calloc(stride * height, 1);
139 pd->nofree = EINA_FALSE; 108 pd->nofree = EINA_FALSE;
140 pd->writable = EINA_TRUE; 109 pd->writable = EINA_TRUE;
141 } 110 }
142 pd->generic->w = width; 111 pd->generic->w = width;
143 pd->generic->h = height; 112 pd->generic->h = height;
144 pd->generic->l = l;
145 pd->generic->r = r;
146 pd->generic->t = t;
147 pd->generic->b = b;
148 pd->generic->cspace = cspace; 113 pd->generic->cspace = cspace;
149 pd->stride = stride; 114 pd->stride = stride;
150 pd->pixel_size = px; 115 pd->pixel_size = pxs;
151 return EINA_TRUE; 116 return EINA_TRUE;
117
118on_fail:
119 return EINA_FALSE;
152} 120}
153 121
154EOLIAN static void * 122EOLIAN static void *
155_ector_software_buffer_base_ector_buffer_map(Eo *obj EINA_UNUSED, Ector_Software_Buffer_Base_Data *pd, 123_ector_software_buffer_base_ector_buffer_map(Eo *obj EINA_UNUSED, Ector_Software_Buffer_Base_Data *pd,
156 unsigned int *length, Ector_Buffer_Access_Flag mode, 124 unsigned int *length, Ector_Buffer_Access_Flag mode,
157 unsigned int x, unsigned int y, unsigned int w, unsigned int h, 125 unsigned int x, unsigned int y, unsigned int w, unsigned int h,
158 Efl_Gfx_Colorspace cspace EINA_UNUSED, unsigned int *stride) 126 Efl_Gfx_Colorspace cspace EINA_UNUSED, unsigned int *stride)
159{ 127{
160 Ector_Software_Buffer_Map *map = NULL; 128 Ector_Software_Buffer_Map *map = NULL;
161 Eina_Bool need_cow = EINA_FALSE; 129 Eina_Bool need_cow = EINA_FALSE;
162 unsigned int off, k, dst_stride; 130 unsigned int off, k, dst_stride, pxs, pxs_dest;
163 131
164 if (!w) w = pd->generic->w; 132 if (!w) w = pd->generic->w;
165 if (!h) h = pd->generic->h; 133 if (!h) h = pd->generic->h;
@@ -172,6 +140,14 @@ _ector_software_buffer_base_ector_buffer_map(Eo *obj EINA_UNUSED, Ector_Software
172 if ((mode & ECTOR_BUFFER_ACCESS_FLAG_WRITE) && !pd->writable) 140 if ((mode & ECTOR_BUFFER_ACCESS_FLAG_WRITE) && !pd->writable)
173 fail("Can not map a read-only buffer for writing"); 141 fail("Can not map a read-only buffer for writing");
174 142
143 pxs = (pd->generic->cspace == EFL_GFX_COLORSPACE_ARGB8888) ? 4 : 1;
144 if (cspace == EFL_GFX_COLORSPACE_ARGB8888)
145 pxs_dest = 4;
146 else if (cspace == EFL_GFX_COLORSPACE_GRY8)
147 pxs_dest = 1;
148 else
149 fail("Unsupported colorspace: %u", cspace);
150
175 if ((mode & ECTOR_BUFFER_ACCESS_FLAG_WRITE) && 151 if ((mode & ECTOR_BUFFER_ACCESS_FLAG_WRITE) &&
176 (mode & ECTOR_BUFFER_ACCESS_FLAG_COW)) 152 (mode & ECTOR_BUFFER_ACCESS_FLAG_COW))
177 { 153 {
@@ -186,20 +162,21 @@ _ector_software_buffer_base_ector_buffer_map(Eo *obj EINA_UNUSED, Ector_Software
186 map = calloc(1, sizeof(*map)); 162 map = calloc(1, sizeof(*map));
187 if (!map) fail("Out of memory"); 163 if (!map) fail("Out of memory");
188 164
165 off = (pxs * x) + (pd->stride * y);
166 dst_stride = w * pxs_dest;
167
189 map->mode = mode; 168 map->mode = mode;
190 map->cspace = cspace; 169 map->cspace = cspace;
170 map->stride = dst_stride;
191 map->x = x; 171 map->x = x;
192 map->y = y; 172 map->y = y;
193 map->w = w; 173 map->w = w;
194 map->h = h; 174 map->h = h;
195 175
196 off = _min_stride_calc(x + pd->generic->l, pd->generic->cspace) + (pd->stride * (y + pd->generic->t));
197 dst_stride = _min_stride_calc(w, cspace);
198
199 if (cspace != pd->generic->cspace) 176 if (cspace != pd->generic->cspace)
200 { 177 {
201 // convert on the fly 178 // convert on the fly
202 map->size = _min_stride_calc(w, cspace) * h; 179 map->size = w * h * pxs_dest;
203 map->allocated = EINA_TRUE; 180 map->allocated = EINA_TRUE;
204 map->ptr = malloc(map->size); 181 map->ptr = malloc(map->size);
205 if (!map->ptr) fail("Out of memory"); 182 if (!map->ptr) fail("Out of memory");
@@ -218,7 +195,7 @@ _ector_software_buffer_base_ector_buffer_map(Eo *obj EINA_UNUSED, Ector_Software
218 else if (need_cow) 195 else if (need_cow)
219 { 196 {
220 // copy-on-write access 197 // copy-on-write access
221 map->size = _min_stride_calc(w, cspace) * h; 198 map->size = w * h * pxs_dest;
222 map->allocated = EINA_TRUE; 199 map->allocated = EINA_TRUE;
223 map->ptr = malloc(map->size); 200 map->ptr = malloc(map->size);
224 if (!map->ptr) fail("Out of memory"); 201 if (!map->ptr) fail("Out of memory");
@@ -261,7 +238,7 @@ _ector_software_buffer_base_ector_buffer_unmap(Eo *obj EINA_UNUSED, Ector_Softwa
261 { 238 {
262 if (map->mode & ECTOR_BUFFER_ACCESS_FLAG_WRITE) 239 if (map->mode & ECTOR_BUFFER_ACCESS_FLAG_WRITE)
263 { 240 {
264 unsigned k, dst_stride; 241 unsigned k;
265 242
266 if (map->cspace != pd->generic->cspace) 243 if (map->cspace != pd->generic->cspace)
267 { 244 {
@@ -282,12 +259,10 @@ _ector_software_buffer_base_ector_buffer_unmap(Eo *obj EINA_UNUSED, Ector_Softwa
282 } 259 }
283 else 260 else
284 { 261 {
285 dst_stride = _min_stride_calc(map->w, map->cspace);
286 for (k = 0; k < map->h; k++) 262 for (k = 0; k < map->h; k++)
287 { 263 {
288 memcpy(pd->pixels.u8 + map->x + (k + map->y) * pd->stride, 264 memcpy(pd->pixels.u8 + map->x + (k + map->y) * pd->stride,
289 map->ptr + k * dst_stride, 265 map->ptr + k * map->stride, map->stride);
290 dst_stride);
291 } 266 }
292 } 267 }
293 } 268 }
@@ -301,33 +276,14 @@ _ector_software_buffer_base_ector_buffer_unmap(Eo *obj EINA_UNUSED, Ector_Softwa
301 CRI("Tried to unmap a non-mapped region!"); 276 CRI("Tried to unmap a non-mapped region!");
302} 277}
303 278
304EOLIAN static uint8_t *
305_ector_software_buffer_base_ector_buffer_span_get(Eo *obj, Ector_Software_Buffer_Base_Data *pd,
306 int x, int y, unsigned int w, Efl_Gfx_Colorspace cspace,
307 unsigned int *length)
308{
309 // ector_buffer_map
310 return _ector_software_buffer_base_ector_buffer_map
311 (obj, pd, length, ECTOR_BUFFER_ACCESS_FLAG_READ, x, y, w, 1, cspace, NULL);
312}
313
314EOLIAN static void
315_ector_software_buffer_base_ector_buffer_span_free(Eo *obj, Ector_Software_Buffer_Base_Data *pd,
316 uint8_t *data)
317{
318 // ector_buffer_unmap
319 return _ector_software_buffer_base_ector_buffer_unmap
320 (obj, pd, data, (unsigned int) -1);
321}
322
323EOLIAN static Ector_Buffer_Flag 279EOLIAN static Ector_Buffer_Flag
324_ector_software_buffer_base_ector_buffer_flags_get(Eo *obj EINA_UNUSED, Ector_Software_Buffer_Base_Data *pd) 280_ector_software_buffer_base_ector_buffer_flags_get(Eo *obj EINA_UNUSED, Ector_Software_Buffer_Base_Data *pd)
325{ 281{
326 return ECTOR_BUFFER_FLAG_CPU_READABLE | 282 return ECTOR_BUFFER_FLAG_CPU_READABLE |
327 ECTOR_BUFFER_FLAG_DRAWABLE | 283 ECTOR_BUFFER_FLAG_DRAWABLE |
328 ECTOR_BUFFER_FLAG_CPU_READABLE_FAST | 284 ECTOR_BUFFER_FLAG_CPU_READABLE_FAST |
329 ECTOR_BUFFER_FLAG_RENDERABLE |
330 (pd->writable ? (ECTOR_BUFFER_FLAG_CPU_WRITABLE | 285 (pd->writable ? (ECTOR_BUFFER_FLAG_CPU_WRITABLE |
286 ECTOR_BUFFER_FLAG_RENDERABLE |
331 ECTOR_BUFFER_FLAG_CPU_WRITABLE_FAST) 287 ECTOR_BUFFER_FLAG_CPU_WRITABLE_FAST)
332 : 0); 288 : 0);
333} 289}
diff --git a/src/lib/ector/software/ector_software_buffer_base.eo b/src/lib/ector/software/ector_software_buffer_base.eo
index f3145d87aa..2a3b63ee67 100644
--- a/src/lib/ector/software/ector_software_buffer_base.eo
+++ b/src/lib/ector/software/ector_software_buffer_base.eo
@@ -10,8 +10,6 @@ mixin Ector.Software.Buffer.Base (Ector.Buffer)
10 implements { 10 implements {
11 Ector.Buffer.flags { get; } 11 Ector.Buffer.flags { get; }
12 Ector.Buffer.pixels_set; 12 Ector.Buffer.pixels_set;
13 Ector.Buffer.span_get;
14 Ector.Buffer.span_free;
15 Ector.Buffer.map; 13 Ector.Buffer.map;
16 Ector.Buffer.unmap; 14 Ector.Buffer.unmap;
17 } 15 }
diff --git a/src/lib/ector/software/ector_software_private.h b/src/lib/ector/software/ector_software_private.h
index d11ba3adc0..459de0105d 100644
--- a/src/lib/ector/software/ector_software_private.h
+++ b/src/lib/ector/software/ector_software_private.h
@@ -61,7 +61,6 @@ typedef enum _Span_Data_Type {
61 Solid, 61 Solid,
62 LinearGradient, 62 LinearGradient,
63 RadialGradient, 63 RadialGradient,
64 Image
65} Span_Data_Type; 64} Span_Data_Type;
66 65
67typedef struct _Span_Data 66typedef struct _Span_Data
@@ -114,7 +113,6 @@ void ector_software_rasterizer_transform_set(Software_Rasterizer *rasterizer, Ei
114void ector_software_rasterizer_color_set(Software_Rasterizer *rasterizer, int r, int g, int b, int a); 113void ector_software_rasterizer_color_set(Software_Rasterizer *rasterizer, int r, int g, int b, int a);
115void ector_software_rasterizer_linear_gradient_set(Software_Rasterizer *rasterizer, Ector_Renderer_Software_Gradient_Data *linear); 114void ector_software_rasterizer_linear_gradient_set(Software_Rasterizer *rasterizer, Ector_Renderer_Software_Gradient_Data *linear);
116void ector_software_rasterizer_radial_gradient_set(Software_Rasterizer *rasterizer, Ector_Renderer_Software_Gradient_Data *radial); 115void ector_software_rasterizer_radial_gradient_set(Software_Rasterizer *rasterizer, Ector_Renderer_Software_Gradient_Data *radial);
117void ector_software_rasterizer_buffer_set(Software_Rasterizer *rasterizer, Ector_Software_Buffer *image);
118void ector_software_rasterizer_clip_rect_set(Software_Rasterizer *rasterizer, Eina_Array *clips); 116void ector_software_rasterizer_clip_rect_set(Software_Rasterizer *rasterizer, Eina_Array *clips);
119void ector_software_rasterizer_clip_shape_set(Software_Rasterizer *rasterizer, Shape_Rle_Data *clip); 117void ector_software_rasterizer_clip_shape_set(Software_Rasterizer *rasterizer, Shape_Rle_Data *clip);
120 118
diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c
index b0ea4834af..9c91856ebb 100644
--- a/src/lib/ector/software/ector_software_rasterizer.c
+++ b/src/lib/ector/software/ector_software_rasterizer.c
@@ -76,45 +76,6 @@ _blend_gradient(int count, const SW_FT_Span *spans, void *user_data)
76 } 76 }
77} 77}
78 78
79static void
80_blend_image_argb(int count, const SW_FT_Span *spans, void *user_data)
81{
82 Span_Data *data = user_data;
83 RGBA_Comp_Func comp_func;
84 uint32_t *buffer, *target;
85 uint8_t *src8;
86 unsigned int l, length, sy = 0;
87 const int pix_stride = data->raster_buffer->stride / 4;
88
89 /* FIXME:
90 * optimize eo call
91 * implement image scaling
92 * tile and repeat image properly
93 */
94
95 comp_func = efl_draw_func_span_get(data->op, data->mul_col, EINA_TRUE);
96 buffer = data->raster_buffer->pixels.u32 + ((pix_stride * data->offy) + data->offx);
97
98 while (count--)
99 {
100 target = buffer + ((pix_stride * spans->y) + spans->x);
101 length = spans->len;
102 while (length)
103 {
104 l = MIN(length, data->buffer->generic->w);
105 src8 = ector_buffer_span_get(data->buffer->generic->eo, 0, sy, l, EFL_GFX_COLORSPACE_ARGB8888, NULL);
106 comp_func(target, (uint32_t *) src8, l, data->mul_col, spans->coverage);
107 ector_buffer_span_free(data->buffer->generic->eo, src8);
108 target += l;
109 length -= l;
110 }
111 ++spans;
112 ++sy;
113 if (sy >= data->buffer->generic->h)
114 sy = 0;
115 }
116}
117
118/*! 79/*!
119 \internal 80 \internal
120 spans must be sorted on y 81 spans must be sorted on y
@@ -318,9 +279,6 @@ _adjust_span_fill_methods(Span_Data *spdata)
318 case RadialGradient: 279 case RadialGradient:
319 spdata->unclipped_blend = &_blend_gradient; 280 spdata->unclipped_blend = &_blend_gradient;
320 break; 281 break;
321 case Image:
322 spdata->unclipped_blend = &_blend_image_argb;
323 break;
324 } 282 }
325 283
326 // setup clipping 284 // setup clipping
@@ -568,13 +526,6 @@ void ector_software_rasterizer_radial_gradient_set(Software_Rasterizer *rasteriz
568 rasterizer->fill_data.type = RadialGradient; 526 rasterizer->fill_data.type = RadialGradient;
569} 527}
570 528
571void ector_software_rasterizer_buffer_set(Software_Rasterizer *rasterizer,
572 Ector_Software_Buffer *buffer)
573{
574 rasterizer->fill_data.buffer = efl_data_scope_get(buffer, ECTOR_SOFTWARE_BUFFER_BASE_MIXIN);
575 rasterizer->fill_data.type = Image;
576}
577
578void ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer, 529void ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer,
579 int x, int y, uint32_t mul_col, 530 int x, int y, uint32_t mul_col,
580 Efl_Gfx_Render_Op op, Shape_Rle_Data* rle) 531 Efl_Gfx_Render_Op op, Shape_Rle_Data* rle)
diff --git a/src/lib/ector/software/ector_software_surface.c b/src/lib/ector/software/ector_software_surface.c
index f1492a2a28..1631449a73 100644
--- a/src/lib/ector/software/ector_software_surface.c
+++ b/src/lib/ector/software/ector_software_surface.c
@@ -12,8 +12,8 @@
12 12
13static Ector_Renderer * 13static Ector_Renderer *
14_ector_software_surface_ector_surface_renderer_factory_new(Eo *obj, 14_ector_software_surface_ector_surface_renderer_factory_new(Eo *obj,
15 Ector_Software_Surface_Data *pd EINA_UNUSED, 15 Ector_Software_Surface_Data *pd EINA_UNUSED,
16 const Efl_Class *type) 16 const Efl_Class *type)
17{ 17{
18 if (type == ECTOR_RENDERER_SHAPE_MIXIN) 18 if (type == ECTOR_RENDERER_SHAPE_MIXIN)
19 return efl_add(ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, NULL, ector_renderer_surface_set(efl_added, obj)); 19 return efl_add(ECTOR_RENDERER_SOFTWARE_SHAPE_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
@@ -21,9 +21,8 @@ _ector_software_surface_ector_surface_renderer_factory_new(Eo *obj,
21 return efl_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(efl_added, obj)); 21 return efl_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_LINEAR_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
22 else if (type == ECTOR_RENDERER_GRADIENT_RADIAL_MIXIN) 22 else if (type == ECTOR_RENDERER_GRADIENT_RADIAL_MIXIN)
23 return efl_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(efl_added, obj)); 23 return efl_add(ECTOR_RENDERER_SOFTWARE_GRADIENT_RADIAL_CLASS, NULL, ector_renderer_surface_set(efl_added, obj));
24 else if (type == ECTOR_RENDERER_BUFFER_MIXIN) 24
25 return efl_add(ECTOR_RENDERER_SOFTWARE_BUFFER_CLASS, NULL, ector_renderer_surface_set(efl_added, obj)); 25 ERR("Couldn't find class for type: %s", efl_class_name_get(type));
26 ERR("Couldn't find class for type: %s\n", efl_class_name_get(type));
27 return NULL; 26 return NULL;
28} 27}
29 28
@@ -49,8 +48,8 @@ _ector_software_surface_efl_object_destructor(Eo *obj, Ector_Software_Surface_Da
49 48
50static void 49static void
51_ector_software_surface_ector_surface_reference_point_set(Eo *obj EINA_UNUSED, 50_ector_software_surface_ector_surface_reference_point_set(Eo *obj EINA_UNUSED,
52 Ector_Software_Surface_Data *pd, 51 Ector_Software_Surface_Data *pd,
53 int x, int y) 52 int x, int y)
54{ 53{
55 pd->x = x; 54 pd->x = x;
56 pd->y = y; 55 pd->y = y;