ector : merged ector library from master. 04/43304/1
authorSubhransu Mohanty <sub.mohanty@samsung.com>
Mon, 13 Apr 2015 07:53:13 +0000 (16:53 +0900)
committerSubhransu Mohanty <sub.mohanty@samsung.com>
Wed, 8 Jul 2015 02:14:35 +0000 (11:14 +0900)
Change-Id: I296ba44f4b516635028c00b621172f814f37e2fe

45 files changed:
src/Makefile.am
src/Makefile_Evas.am
src/lib/ector/Ector.h
src/lib/ector/cairo/ector_cairo_private.h
src/lib/ector/cairo/ector_cairo_surface.c
src/lib/ector/cairo/ector_renderer_cairo_base.c
src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.c
src/lib/ector/cairo/ector_renderer_cairo_gradient_linear.eo
src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.c
src/lib/ector/cairo/ector_renderer_cairo_gradient_radial.eo
src/lib/ector/cairo/ector_renderer_cairo_shape.c
src/lib/ector/cairo/ector_renderer_cairo_shape.eo
src/lib/ector/ector_generic_surface.eo
src/lib/ector/ector_private.h
src/lib/ector/ector_renderer_base.c
src/lib/ector/ector_renderer_generic_base.eo
src/lib/ector/ector_surface.c
src/lib/ector/ector_util.h
src/lib/ector/software/ector_drawhelper.c
src/lib/ector/software/ector_drawhelper_sse2.c
src/lib/ector/software/ector_renderer_software_gradient_linear.c
src/lib/ector/software/ector_renderer_software_gradient_radial.c
src/lib/ector/software/ector_renderer_software_shape.c
src/lib/ector/software/ector_software_gradient.c
src/lib/ector/software/ector_software_private.h
src/lib/ector/software/ector_software_rasterizer.c
src/lib/efl/Efl.h
src/lib/efl/interfaces/efl_gfx_shape.c
src/lib/efl/interfaces/efl_gfx_shape.eo
src/lib/evas/Evas_Eo.h
src/lib/evas/Evas_Legacy.h
src/lib/evas/canvas/efl_vg_base.eo
src/lib/evas/canvas/efl_vg_container.eo
src/lib/evas/canvas/efl_vg_gradient_linear.eo
src/lib/evas/canvas/efl_vg_gradient_radial.eo
src/lib/evas/canvas/efl_vg_shape.eo
src/lib/evas/canvas/evas_object_vg.c
src/lib/evas/canvas/evas_vg.eo
src/lib/evas/canvas/evas_vg_container.c
src/lib/evas/canvas/evas_vg_gradient_linear.c
src/lib/evas/canvas/evas_vg_gradient_radial.c
src/lib/evas/canvas/evas_vg_node.c
src/lib/evas/canvas/evas_vg_root_node.c
src/lib/evas/canvas/evas_vg_shape.c
src/modules/evas/engines/software_generic/evas_engine.c

index a2e744f..7cdfd61 100644 (file)
@@ -34,7 +34,6 @@ include Makefile_Eo.am
 include Makefile_Efl.am
 include Makefile_Eet.am
 include Makefile_Eolian.am
-include Makefile_Ector.am
 include Makefile_Ecore.am
 include Makefile_Ecore_Con.am
 include Makefile_Ecore_Ipc.am
index d3ad0f7..6db1d3d 100644 (file)
@@ -39,8 +39,7 @@ evas_eolian_files = \
        lib/evas/canvas/efl_vg_root_node.eo \
        lib/evas/canvas/efl_vg_gradient.eo \
        lib/evas/canvas/efl_vg_gradient_radial.eo \
-       lib/evas/canvas/efl_vg_gradient_linear.eo \
-       lib/evas/canvas/efl_vg_image.eo
+       lib/evas/canvas/efl_vg_gradient_linear.eo
 
 evas_eolian_c = $(evas_eolian_files:%.eo=%.eo.c)
 evas_eolian_h = $(evas_eolian_files:%.eo=%.eo.h) \
@@ -85,7 +84,8 @@ lib/evas/include/evas_macros.h \
 lib/evas/include/evas_mmx.h \
 lib/evas/include/evas_common_private.h \
 lib/evas/include/evas_blend_ops.h \
-lib/evas/include/evas_filter.h
+lib/evas/include/evas_filter.h \
+lib/evas/canvas/evas_vg_private.h
 
 # Linebreak
 
@@ -150,8 +150,7 @@ lib/evas/canvas/evas_stats.c \
 lib/evas/canvas/evas_touch_point.c \
 lib/evas/canvas/evas_map.c \
 lib/evas/canvas/evas_gl.c \
-lib/evas/canvas/evas_out.c \
-lib/evas/canvas/evas_vg_loader_svg.c
+lib/evas/canvas/evas_out.c
 
 # Cache
 lib_evas_libevas_la_SOURCES += \
@@ -222,7 +221,6 @@ lib/evas/canvas/evas_vg_gradient.c \
 lib/evas/canvas/evas_vg_gradient_linear.c \
 lib/evas/canvas/evas_vg_gradient_radial.c \
 lib/evas/canvas/evas_vg_utils.c \
-lib/evas/canvas/evas_vg_image.c \
 lib/evas/canvas/evas_vg_shape.c
 
 # Engine
index 0a53fac..e08c2ed 100644 (file)
@@ -92,6 +92,8 @@ extern "C" {
  * @{
  */
 
+#ifdef EFL_BETA_API_SUPPORT
+
 /**
  * @typedef Ector_Surface
  * The base type to render content into.
@@ -154,8 +156,6 @@ typedef enum _Ector_Update_Type
   ECTOR_UPDATE_OPAQUE = 8 /* Pushing some opaque pixels (this means that their is no need to read the under layer when blitting this surface) */
 } Ector_Update_Type;
 
-#ifdef EFL_BETA_API_SUPPORT
-
 /**
  * @brief Init the ector subsystem
  * @return @c EINA_TRUE on success.
index 07446a8..b5782ff 100644 (file)
@@ -3,7 +3,15 @@
 
 typedef void cairo_pattern_t;
 
+typedef struct {
+   double xx; double yx;
+   double xy; double yy;
+   double x0; double y0;
+} cairo_matrix_t;
+
 typedef struct _Ector_Cairo_Surface_Data Ector_Cairo_Surface_Data;
+typedef struct _Ector_Renderer_Cairo_Base_Data Ector_Renderer_Cairo_Base_Data;
+
 struct _Ector_Cairo_Surface_Data
 {
    cairo_t *cairo;
@@ -14,6 +22,37 @@ struct _Ector_Cairo_Surface_Data
    Eina_Bool internal : 1;
 };
 
+struct _Ector_Renderer_Cairo_Base_Data
+{
+   Ector_Cairo_Surface_Data *parent;
+   Ector_Renderer_Generic_Base_Data *generic;
+
+   cairo_matrix_t *m;
+};
+
+typedef enum _cairo_extend {
+    CAIRO_EXTEND_NONE,
+    CAIRO_EXTEND_REPEAT,
+    CAIRO_EXTEND_REFLECT,
+    CAIRO_EXTEND_PAD
+} cairo_extend_t;
+
+static inline cairo_extend_t
+_ector_cairo_extent_get(Efl_Gfx_Gradient_Spread s)
+{
+   switch (s)
+     {
+       case EFL_GFX_GRADIENT_SPREAD_PAD:
+          return CAIRO_EXTEND_PAD;
+       case EFL_GFX_GRADIENT_SPREAD_REFLECT:
+          return CAIRO_EXTEND_REFLECT;
+       case EFL_GFX_GRADIENT_SPREAD_REPEAT:
+          return CAIRO_EXTEND_REPEAT;
+       default:
+          return CAIRO_EXTEND_NONE;
+     }
+}
+
 #define CHECK_CAIRO(Parent) (!(Parent && Parent->cairo))
 
 #define USE(Obj, Sym, Error)                            \
index 8875c04..377fbbd 100644 (file)
@@ -73,7 +73,6 @@ _ector_cairo_surface_ector_generic_surface_renderer_factory_new(Eo *obj,
 
 typedef struct _cairo_surface_t cairo_surface_t;
 
-static void (*cairo_translate)(cairo_t *cr, double tx, double ty) = NULL;
 static void (*cairo_destroy)(cairo_t *cr) = NULL;
 static cairo_surface_t *(*cairo_image_surface_create)(int format,
                                                       int width,
@@ -118,11 +117,8 @@ _ector_cairo_surface_ector_generic_surface_reference_point_set(Eo *obj EINA_UNUS
                                                                Ector_Cairo_Surface_Data *pd,
                                                                int x, int y)
 {
-   if (pd->cairo)
-     {
-        USE(obj, cairo_translate, );
-        cairo_translate(pd->cairo, x, y);
-     }
+   pd->current.x = x;
+   pd->current.y = y;
 }
 
 static void
index 190fb8a..1580b4e 100644 (file)
 #include "ector_private.h"
 #include "ector_cairo_private.h"
 
-typedef struct {
-   double xx; double yx;
-   double xy; double yy;
-   double x0; double y0;
-} cairo_matrix_t;
-
 typedef enum {
   CAIRO_OPERATOR_CLEAR,
 
@@ -66,14 +60,10 @@ static void (*cairo_set_source_rgba)(cairo_t *cr,
 static void (*cairo_set_operator)(cairo_t *cr, cairo_operator_t op) = NULL;
 static void (*cairo_matrix_init_identity)(cairo_matrix_t *matrix) = NULL;
 
-typedef struct _Ector_Renderer_Cairo_Base_Data Ector_Renderer_Cairo_Base_Data;
-struct _Ector_Renderer_Cairo_Base_Data
-{
-   Ector_Cairo_Surface_Data *parent;
-   Ector_Renderer_Generic_Base_Data *generic;
-
-   cairo_matrix_t *m;
-};
+static void (*cairo_new_path)(cairo_t *cr) = NULL;
+static void (*cairo_rectangle)(cairo_t *cr, double x, double y, double width, double height) = NULL;
+static void (*cairo_clip)(cairo_t *cr) = NULL;
+static void (*cairo_device_to_user)(cairo_t *cr, double *x, double *y) = NULL;
 
 static cairo_matrix_t identity;
 
@@ -83,7 +73,6 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_color_set(Eo *obj EINA_UN
                                                                  Ector_Renderer_Cairo_Base_Data *pd,
                                                                  int r, int g, int b, int a)
 {
-   ector_color_argb_unpremul(a, &r ,&g, &b);
    pd->generic->color.r = r;
    pd->generic->color.g = g;
    pd->generic->color.b = b;
@@ -99,8 +88,6 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_color_get(Eo *obj EINA_UN
    if (g) *g = pd->generic->color.g;
    if (b) *b = pd->generic->color.b;
    if (a) *a = pd->generic->color.a;
-
-   ector_color_argb_premul(pd->generic->color.a, r, g, b);
 }
 
 static Eina_Bool
@@ -140,7 +127,7 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj,
                                                             Eina_Array *clips EINA_UNUSED,
                                                             unsigned int mul_col)
 {
-   double r, g, b, a;
+   int r, g, b, a;
    cairo_operator_t cop;
    double cx, cy;
 
@@ -160,21 +147,45 @@ _ector_renderer_cairo_base_ector_renderer_generic_base_draw(Eo *obj,
          break;
      }
 
-   r = ((double)((pd->generic->color.r * R_VAL(&mul_col)) >> 8)) / 255;
-   g = ((double)((pd->generic->color.g * G_VAL(&mul_col)) >> 8)) / 255;
-   b = ((double)((pd->generic->color.b * B_VAL(&mul_col)) >> 8)) / 255;
-   a = ((double)((pd->generic->color.a * A_VAL(&mul_col)) >> 8)) / 255;
+   r = ((pd->generic->color.r * R_VAL(&mul_col)) >> 8);
+   g = ((pd->generic->color.g * G_VAL(&mul_col)) >> 8);
+   b = ((pd->generic->color.b * B_VAL(&mul_col)) >> 8);
+   a = ((pd->generic->color.a * A_VAL(&mul_col)) >> 8);
+   ector_color_argb_unpremul(a, &r, &g, &b);
 
    cairo_set_operator(pd->parent->cairo, cop);
+
+
+   USE(obj, cairo_new_path, EINA_FALSE);
+   USE(obj, cairo_rectangle, EINA_FALSE);
+   USE(obj, cairo_clip, EINA_FALSE);
+   USE(obj, cairo_device_to_user, EINA_FALSE);
+   if (clips)
+     {
+        int clip_count =  eina_array_count(clips);
+        int i=0;
+        for (; i < clip_count ; i++)
+          {
+             Eina_Rectangle *clip = (Eina_Rectangle *)eina_array_data_get(clips, i);
+             double x = (double)clip->x;
+             double y = (double)clip->y;
+
+             cairo_new_path(pd->parent->cairo);
+             cairo_device_to_user(pd->parent->cairo, &x, &y);
+             cairo_rectangle(pd->parent->cairo, x, y, clip->w, clip->h);
+          }
+        cairo_clip(pd->parent->cairo);
+     }
+
    cairo_transform(pd->parent->cairo, &identity);
-   if (pd->m) cairo_transform(pd->parent->cairo, pd->m);
-   cx = pd->generic->origin.x - pd->parent->current.x;
-   cy = pd->generic->origin.y - pd->parent->current.y;
+   cx = pd->generic->origin.x + pd->parent->current.x;
+   cy = pd->generic->origin.y + pd->parent->current.y;
+
    cairo_translate(pd->parent->cairo, cx, cy);
-   pd->parent->current.x = pd->generic->origin.x;
-   pd->parent->current.y = pd->generic->origin.y;
 
-   cairo_set_source_rgba(pd->parent->cairo, r, g, b, a);
+   if (pd->m) cairo_transform(pd->parent->cairo, pd->m);
+
+   cairo_set_source_rgba(pd->parent->cairo, r/255.0, g/255.0, b/255.0, a/255.0);
 
    return EINA_TRUE;
 }
index 19f3055..15b4e42 100644 (file)
@@ -20,6 +20,8 @@ static void (*cairo_pattern_add_color_stop_rgba)(cairo_pattern_t *pattern, doubl
                                                  double red, double green, double blue, double alpha) = NULL;
 static void (*cairo_pattern_destroy)(cairo_pattern_t *pattern) = NULL;
 
+static void (*cairo_pattern_set_extend)(cairo_pattern_t *pattern, cairo_extend_t extend) = NULL;
+
 typedef struct _Ector_Renderer_Cairo_Gradient_Linear_Data Ector_Renderer_Cairo_Gradient_Linear_Data;
 struct _Ector_Renderer_Cairo_Gradient_Linear_Data
 {
@@ -48,10 +50,19 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_prepare(Eo *ob
 
    pd->pat = cairo_pattern_create_linear(gld->start.x, gld->start.y,
                                      gld->end.x, gld->end.y);
+   int r,g,b,a;
    for (i = 0; i < gd->colors_count; i++)
-     cairo_pattern_add_color_stop_rgba(pd->pat, gd->colors[i].offset,
-                                       gd->colors[i].r, gd->colors[i].g,
-                                       gd->colors[i].b, gd->colors[i].a);
+     {
+       r = gd->colors[i].r;
+       g = gd->colors[i].g;
+       b = gd->colors[i].b;
+       a = gd->colors[i].a;
+       ector_color_argb_unpremul(a, &r, &g, &b);
+       cairo_pattern_add_color_stop_rgba(pd->pat, gd->colors[i].offset, r/255.0, g/255.0, b/255.0, a/255.0);
+     }
+
+   USE(obj, cairo_pattern_set_extend, EINA_FALSE);
+   cairo_pattern_set_extend(pd->pat, _ector_cairo_extent_get(gd->s));
 
    if (!pd->parent)
      {
@@ -70,6 +81,8 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_draw(Eo *obj,
                                                                        Ector_Renderer_Cairo_Gradient_Linear_Data *pd,
                                                                        Ector_Rop op, Eina_Array *clips, unsigned int mul_col)
 {
+   if (pd->pat) return EINA_FALSE;
+
    Ector_Renderer_Generic_Gradient_Linear_Data *gld;
 
    // FIXME: don't ignore clipping !
@@ -103,6 +116,23 @@ _ector_renderer_cairo_gradient_linear_ector_renderer_cairo_base_fill(Eo *obj,
    return EINA_TRUE;
 }
 
+static void
+_ector_renderer_cairo_gradient_linear_ector_renderer_generic_base_bounds_get(Eo *obj,
+                                                                             Ector_Renderer_Cairo_Gradient_Linear_Data *pd EINA_UNUSED,
+                                                                             Eina_Rectangle *r)
+{
+   Ector_Renderer_Generic_Gradient_Linear_Data *gld;
+   Ector_Renderer_Cairo_Base_Data *bd;
+
+   gld = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN);
+   bd = eo_data_scope_get(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS);
+   EINA_RECTANGLE_SET(r,
+                      bd->generic->origin.x + gld->start.x,
+                      bd->generic->origin.y + gld->start.y,
+                      gld->end.x - gld->start.x,
+                      gld->end.y - gld->start.x);
+}
+
 void
 _ector_renderer_cairo_gradient_linear_eo_base_destructor(Eo *obj,
                                                          Ector_Renderer_Cairo_Gradient_Linear_Data *pd)
index 3d4ed9a..64c6056 100644 (file)
@@ -5,6 +5,7 @@ class Ector.Renderer.Cairo.Gradient_Linear (Ector.Renderer.Cairo.Base, Ector.Ren
    implements {
       Ector.Renderer.Generic.Base.prepare;
       Ector.Renderer.Generic.Base.draw;
+      Ector.Renderer.Generic.Base.bounds_get;
       Ector.Renderer.Cairo.Base.fill;
       Eo.Base.destructor;
       Efl.Gfx.Gradient.Base.stop.set;
index 521b06d..34a6d70 100644 (file)
@@ -23,6 +23,7 @@ static void (*cairo_pattern_add_color_stop_rgba)(cairo_pattern_t *pattern, doubl
                                                  double red, double green, double blue, double alpha) = NULL;
 static void (*cairo_pattern_destroy)(cairo_pattern_t *pattern) = NULL;
 
+static void (*cairo_pattern_set_extend)(cairo_pattern_t *pattern, cairo_extend_t extend) = NULL;
 
 // FIXME: as long as it is not possible to directly access the parent structure
 //  this will be duplicated from the linear gradient renderer
@@ -53,10 +54,20 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_prepare(Eo *ob
 
    pd->pat = cairo_pattern_create_radial(grd->focal.x, grd->focal.y, 0,
                                          grd->radial.x, grd->radial.y, grd->radius);
+
+   int r,g,b,a;
    for (i = 0; i < gd->colors_count; i++)
-     cairo_pattern_add_color_stop_rgba(pd->pat, gd->colors[i].offset,
-                                       gd->colors[i].r, gd->colors[i].g,
-                                       gd->colors[i].b, gd->colors[i].a);
+     {
+       r = gd->colors[i].r;
+       g = gd->colors[i].g;
+       b = gd->colors[i].b;
+       a = gd->colors[i].a;
+       ector_color_argb_unpremul(a, &r, &g, &b);
+       cairo_pattern_add_color_stop_rgba(pd->pat, gd->colors[i].offset, r/255.0, g/255.0, b/255.0, a/255.0);
+     }
+
+   USE(obj, cairo_pattern_set_extend, EINA_FALSE);
+   cairo_pattern_set_extend(pd->pat, _ector_cairo_extent_get(gd->s));
 
    if (!pd->parent)
      {
@@ -74,6 +85,8 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_prepare(Eo *ob
 static Eina_Bool
 _ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Gradient_Radial_Data *pd, Ector_Rop op, Eina_Array *clips, unsigned int mul_col)
 {
+   if (pd->pat) return EINA_FALSE;
+
    Ector_Renderer_Generic_Gradient_Radial_Data *gld;
 
    // FIXME: don't ignore clipping !
@@ -108,6 +121,22 @@ _ector_renderer_cairo_gradient_radial_ector_renderer_cairo_base_fill(Eo *obj, Ec
    return EINA_TRUE;
 }
 
+static void
+_ector_renderer_cairo_gradient_radial_ector_renderer_generic_base_bounds_get(Eo *obj EINA_UNUSED,
+                                                                             Ector_Renderer_Cairo_Gradient_Radial_Data *pd EINA_UNUSED,
+                                                                             Eina_Rectangle *r)
+{
+   Ector_Renderer_Generic_Gradient_Radial_Data *gld;
+   Ector_Renderer_Cairo_Base_Data *bd;
+
+   gld = eo_data_scope_get(obj, ECTOR_RENDERER_GENERIC_GRADIENT_RADIAL_MIXIN);
+   bd = eo_data_scope_get(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS);
+   EINA_RECTANGLE_SET(r,
+                      bd->generic->origin.x + gld->radial.x - gld->radius,
+                      bd->generic->origin.y + gld->radial.y - gld->radius,
+                      gld->radius * 2, gld->radius * 2);
+}
+
 void
 _ector_renderer_cairo_gradient_radial_eo_base_destructor(Eo *obj,
                                                          Ector_Renderer_Cairo_Gradient_Radial_Data *pd)
index fb79bec..c05ad9e 100644 (file)
@@ -5,6 +5,7 @@ class Ector.Renderer.Cairo.Gradient_Radial (Ector.Renderer.Cairo.Base, Ector.Ren
    implements {
       Ector.Renderer.Generic.Base.prepare;
       Ector.Renderer.Generic.Base.draw;
+      Ector.Renderer.Generic.Base.bounds_get;
       Ector.Renderer.Cairo.Base.fill;
       Eo.Base.destructor;
       Efl.Gfx.Gradient.Base.stop.set;
index babf113..abedd8c 100644 (file)
 
 typedef struct _cairo_path_t cairo_path_t;
 
+typedef enum _cairo_line_cap {
+  CAIRO_LINE_CAP_BUTT,
+  CAIRO_LINE_CAP_ROUND,
+  CAIRO_LINE_CAP_SQUARE
+} cairo_line_cap_t;
+
+typedef enum _cairo_line_join {
+  CAIRO_LINE_JOIN_MITER,
+  CAIRO_LINE_JOIN_ROUND,
+  CAIRO_LINE_JOIN_BEVEL
+} cairo_line_join_t;
+
 static void (*cairo_move_to)(cairo_t *cr, double x, double y) = NULL;
 static void (*cairo_line_to)(cairo_t *cr, double x, double y) = NULL;
 static void (*cairo_curve_to)(cairo_t *cr,
@@ -36,6 +48,15 @@ static void (*cairo_path_destroy)(cairo_path_t *path) = NULL;
 static void (*cairo_new_path)(cairo_t *cr) = NULL;
 static void (*cairo_append_path)(cairo_t *cr, const cairo_path_t *path) = NULL;
 
+static void (*cairo_set_line_width)(cairo_t *cr, double width) = NULL;
+static void (*cairo_set_line_cap)(cairo_t *cr, cairo_line_cap_t line_cap) = NULL;
+static void (*cairo_set_line_join)(cairo_t *cr, cairo_line_join_t line_join) = NULL;
+
+static void (*cairo_save)(cairo_t *cr) = NULL;
+static void (*cairo_restore)(cairo_t *cr) = NULL;
+
+static void (*cairo_set_dash) (cairo_t *cr, const double *dashes, int num_dashes, double offset) = NULL;
+
 typedef struct _Ector_Renderer_Cairo_Shape_Data Ector_Renderer_Cairo_Shape_Data;
 struct _Ector_Renderer_Cairo_Shape_Data
 {
@@ -46,7 +67,7 @@ struct _Ector_Renderer_Cairo_Shape_Data
 };
 
 static Eina_Bool
-_ector_renderer_cairo_shape_path_changed(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info)
+_ector_renderer_cairo_shape_path_changed(void *data, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info EINA_UNUSED)
 {
    Ector_Renderer_Cairo_Shape_Data *pd = data;
 
@@ -143,9 +164,12 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_prepare(Eo *obj, Ector_R
 static Eina_Bool
 _ector_renderer_cairo_shape_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Cairo_Shape_Data *pd, Ector_Rop op, Eina_Array *clips, unsigned int mul_col)
 {
+   int r, g, b, a;
    if (pd->path == NULL) return EINA_FALSE;
 
-   // FIXME: find a way to set multiple clips
+   USE(obj, cairo_save, EINA_FALSE);
+   cairo_save(pd->parent->cairo);
+
    eo_do_super(obj, ECTOR_RENDERER_CAIRO_SHAPE_CLASS, ector_renderer_draw(op, clips, mul_col));
 
    USE(obj, cairo_new_path, EINA_FALSE);
@@ -157,24 +181,46 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_draw(Eo *obj, Ector_Rend
    if (pd->shape->fill)
      eo_do(pd->shape->fill, ector_renderer_cairo_base_fill());
 
-   if (pd->shape->stroke.color.a > 0)
+   if (pd->shape->stroke.fill || pd->shape->stroke.color.a > 0)
      {
         USE(obj, cairo_fill_preserve, EINA_FALSE);
         USE(obj, cairo_set_source_rgba, EINA_FALSE);
         USE(obj, cairo_stroke, EINA_FALSE);
+        USE(obj, cairo_set_line_width, EINA_FALSE);
+        USE(obj, cairo_set_line_cap, EINA_FALSE);
+        USE(obj, cairo_set_line_join, EINA_FALSE);
 
         cairo_fill_preserve(pd->parent->cairo);
 
-        cairo_set_source_rgba(pd->parent->cairo,
-                              pd->shape->stroke.color.r / 255.0,
-                              pd->shape->stroke.color.g / 255.0,
-                              pd->shape->stroke.color.b / 255.0,
-                              pd->shape->stroke.color.a / 255.0);
-
         if (pd->shape->stroke.fill)
           eo_do(pd->shape->stroke.fill, ector_renderer_cairo_base_fill());
-        // Set dash, cap and join
-        cairo_stroke(pd->parent->cairo);
+       else
+         {
+            r = (((pd->shape->stroke.color.r * R_VAL(&mul_col)) + 0xff) >> 8);
+            g = (((pd->shape->stroke.color.g * G_VAL(&mul_col)) + 0xff) >> 8);
+            b = (((pd->shape->stroke.color.b * B_VAL(&mul_col)) + 0xff) >> 8);
+            a = (((pd->shape->stroke.color.a * A_VAL(&mul_col)) + 0xff) >> 8);
+            ector_color_argb_unpremul(a, &r, &g, &b);
+            cairo_set_source_rgba(pd->parent->cairo, r/255.0, g/255.0, b/255.0, a/255.0);
+            if (pd->shape->stroke.dash)
+              {
+                 unsigned int i = 0;
+                 double *dashinfo = (double *) malloc(2 * pd->shape->stroke.dash_length * sizeof(double));
+                 for (i = 0 ; i < pd->shape->stroke.dash_length ; i++)
+                   {
+                      dashinfo[i*2] = pd->shape->stroke.dash[i].length;
+                      dashinfo[i*2 + 1] = pd->shape->stroke.dash[i].gap;
+                   }
+                 USE(obj, cairo_set_dash, EINA_FALSE);
+                 cairo_set_dash(pd->parent->cairo, dashinfo, pd->shape->stroke.dash_length * 2, 0);
+              }
+         }
+
+       // Set dash, cap and join
+       cairo_set_line_width(pd->parent->cairo, (pd->shape->stroke.width * pd->shape->stroke.scale * 2));
+       cairo_set_line_cap(pd->parent->cairo, pd->shape->stroke.cap);
+       cairo_set_line_join(pd->parent->cairo, pd->shape->stroke.join);
+       cairo_stroke(pd->parent->cairo);
      }
    else
      {
@@ -182,6 +228,8 @@ _ector_renderer_cairo_shape_ector_renderer_generic_base_draw(Eo *obj, Ector_Rend
         cairo_fill(pd->parent->cairo);
      }
 
+   USE(obj, cairo_restore, EINA_FALSE);
+   cairo_restore(pd->parent->cairo);
    return EINA_TRUE;
 }
 
@@ -196,6 +244,21 @@ _ector_renderer_cairo_shape_ector_renderer_cairo_base_fill(Eo *obj EINA_UNUSED,
    return EINA_FALSE;
 }
 
+static void
+_ector_renderer_cairo_shape_ector_renderer_generic_base_bounds_get(Eo *obj,
+                                                                   Ector_Renderer_Cairo_Shape_Data *pd EINA_UNUSED,
+                                                                   Eina_Rectangle *r)
+{
+   Ector_Renderer_Cairo_Base_Data *bd;
+
+   // FIXME: It should be possible to actually ask cairo about that
+   eo_do(obj, efl_gfx_shape_bounds_get(r));
+
+   bd = eo_data_scope_get(obj, ECTOR_RENDERER_CAIRO_BASE_CLASS);
+   r->x += bd->generic->origin.x;
+   r->y += bd->generic->origin.y;
+}
+
 void
 _ector_renderer_cairo_shape_eo_base_constructor(Eo *obj, Ector_Renderer_Cairo_Shape_Data *pd)
 {
index 7dd1b31..e9d4a17 100644 (file)
@@ -5,6 +5,7 @@ class Ector.Renderer.Cairo.Shape (Ector.Renderer.Cairo.Base, Ector.Renderer.Gene
    implements {
       Ector.Renderer.Generic.Base.prepare;
       Ector.Renderer.Generic.Base.draw;
+      Ector.Renderer.Generic.Base.bounds_get;
       Ector.Renderer.Cairo.Base.fill;
       Eo.Base.constructor;
       Eo.Base.destructor;
index 42a5f3e..5415079 100644 (file)
@@ -31,16 +31,6 @@ abstract Ector.Generic.Surface (Eo.Base)
            @in const(Eo_Class) * type @nonull;
         }
       }
-      update_push {
-         return: bool;
-        params {
-           @in const(Eina_Rectangle) * r @nonull;
-           @in Ector_Update_Type type;
-        }
-      }
-      update_reset {
-         return: bool;
-      }
    }
    implements {
       @virtual .renderer_factory_new;
index 49f772b..ff97f77 100644 (file)
@@ -36,6 +36,8 @@ extern int _ector_log_dom_global;
 #endif /* ifdef CRI */
 #define CRI(...) EINA_LOG_DOM_CRIT(_ector_log_dom_global, __VA_ARGS__)
 
+/* The following macro are internal to Ector only at this stage */
+
 typedef unsigned char DATA8;
 typedef unsigned short DATA16;
 
@@ -64,25 +66,6 @@ typedef unsigned short DATA16;
   (((a) << 24) + ((r) << 16) + ((g) << 8) + (b))
 
 static inline void
-ector_color_argb_premul(int a, int *r, int *g, int *b)
-{
-   a++;
-   if (r) { *r = (a * *r) >> 8; }
-   if (g) { *g = (a * *g) >> 8; }
-   if (b) { *b = (a * *b) >> 8; }
-}
-
-static inline void
-ector_color_argb_unpremul(int a, int *r, int *g, int *b)
-{
-   if (!a) return;
-   if (r) { *r = (255 * *r) / a; }
-   if (g) { *g = (255 * *g) / a; }
-   if (b) { *b = (255 * *b) / a; }
-}
-
-
-static inline void
 _ector_renderer_replace(Ector_Renderer **d, const Ector_Renderer *s)
 {
    Ector_Renderer *tmp = *d;
index 4f45542..b4c44c9 100644 (file)
@@ -8,27 +8,29 @@
 #include "ector_private.h"
 
 static void
+_ector_renderer_generic_base_eo_base_destructor(Eo *obj, Ector_Renderer_Generic_Base_Data *pd)
+{
+   if (pd->m) free(pd->m);
+   eo_do_super(obj, ECTOR_RENDERER_GENERIC_BASE_CLASS, eo_destructor());
+}
+
+static void
 _ector_renderer_generic_base_transformation_set(Eo *obj EINA_UNUSED,
                                                 Ector_Renderer_Generic_Base_Data *pd,
                                                 const Eina_Matrix3 *m)
 {
-   Eina_Matrix3 *tmp = pd->m;
-
-   pd->m = NULL;
    if (!m)
      {
-        free(tmp);
-        tmp = NULL;
+        free(pd->m);
+        pd->m = NULL;
      }
    else
      {
-        if (!tmp) tmp = malloc(sizeof (Eina_Matrix3));
-        if (!tmp) return ;
+        if (!pd->m) pd->m = malloc(sizeof (Eina_Matrix3));
+        if (!pd->m) return ;
 
-        memcpy(tmp, m, sizeof (Eina_Matrix3));
+        memcpy(pd->m, m, sizeof (Eina_Matrix3));
      }
-
-   pd->m = tmp;
 }
 
 static const Eina_Matrix3 *
index 50e7e94..2e42fea 100644 (file)
@@ -86,9 +86,8 @@ abstract Ector.Renderer.Generic.Base (Eo.Base)
    }
    methods {
       bounds_get {
-         return: bool @warn_unused;
         params {
-           @out Eina_Rectangle *r;
+           @out Eina_Rectangle r;
         }
       }
       draw {
@@ -109,6 +108,7 @@ abstract Ector.Renderer.Generic.Base (Eo.Base)
       }
    }
    implements {
+      Eo.Base.destructor;
       @virtual .draw;
       @virtual .bounds_get;
       @virtual .done;
index eda912f..23ad7eb 100644 (file)
 typedef struct _Ector_Generic_Surface_Data Ector_Generic_Surface_Data;
 struct _Ector_Generic_Surface_Data
 {
+   int w, h;
 };
 
 void
-_ector_generic_surface_size_set(Eo *obj,
+_ector_generic_surface_size_set(Eo *obj EINA_UNUSED,
                                 Ector_Generic_Surface_Data *pd,
                                 int w, int h)
 {
+   pd->w = w;
+   pd->h = h;
 }
 
 void
-_ector_generic_surface_size_get(Eo *obj,
+_ector_generic_surface_size_get(Eo *obj EINA_UNUSED,
                                 Ector_Generic_Surface_Data *pd,
                                 int *w, int *h)
 {
-}
-
-Eina_Bool
-_ector_generic_surface_update_push(Eo *obj,
-                                   Ector_Generic_Surface_Data *pd,
-                                   const Eina_Rectangle *r,
-                                   Ector_Update_Type type)
-{
-}
-
-Eina_Bool
-_ector_generic_surface_update_reset(Eo *obj, Ector_Generic_Surface_Data *pd)
-{
+   if (w) *w = pd->w;
+   if (h) *h = pd->h;
 }
 
 #include "ector_generic_surface.eo.c"
index af8b591..2dafaaf 100644 (file)
@@ -1,6 +1,25 @@
 #ifndef ECTOR_UTIL_H
 # define ECTOR_UTIL_H
 
+static inline void
+ector_color_argb_premul(int a, int *r, int *g, int *b)
+{
+   a++;
+   if (r) { *r = (a * *r) >> 8; }
+   if (g) { *g = (a * *g) >> 8; }
+   if (b) { *b = (a * *b) >> 8; }
+}
+
+static inline void
+ector_color_argb_unpremul(int a, int *r, int *g, int *b)
+{
+   if (!a) return;
+   if (r) { *r = (255 * *r) / a; }
+   if (g) { *g = (255 * *g) / a; }
+   if (b) { *b = (255 * *b) / a; }
+}
+
+
 static inline unsigned int
 ector_color_multiply(unsigned int c1, unsigned int c2)
 {
index 8612199..857fb28 100644 (file)
@@ -1,3 +1,6 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <Ector.h>
 #include "ector_drawhelper_private.h"
index 1199cdb..b40b3ce 100644 (file)
@@ -1,3 +1,6 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include <Ector.h>
 #include "ector_drawhelper_private.h"
index a6e32b0..3854e3d 100644 (file)
@@ -13,7 +13,6 @@
 static void
 _update_linear_data(Ector_Renderer_Software_Gradient_Data *gdata)
 {
-   update_color_table(gdata);
    gdata->linear.x1 = gdata->gld->start.x;
    gdata->linear.y1 = gdata->gld->start.y;
 
@@ -66,6 +65,8 @@ static Eina_Bool
 _ector_renderer_software_gradient_linear_ector_renderer_software_base_fill(Eo *obj EINA_UNUSED,
                                                                            Ector_Renderer_Software_Gradient_Data *pd)
 {
+   // lazy creation of color table
+   update_color_table(pd);
    ector_software_rasterizer_linear_gradient_set(pd->surface->software, pd);
 
    return EINA_TRUE;
index a05b487..ccd7ad9 100644 (file)
@@ -12,8 +12,6 @@
 static void
 _update_radial_data(Ector_Renderer_Software_Gradient_Data *gdata)
 {
-   update_color_table(gdata);
-
    gdata->radial.cx = gdata->grd->radial.x;
    gdata->radial.cy = gdata->grd->radial.y;
    gdata->radial.cradius = gdata->grd->radius;
@@ -75,6 +73,8 @@ _ector_renderer_software_gradient_radial_ector_renderer_generic_base_draw(Eo *ob
 static Eina_Bool
 _ector_renderer_software_gradient_radial_ector_renderer_software_base_fill(Eo *obj EINA_UNUSED, Ector_Renderer_Software_Gradient_Data *pd)
 {
+   // lazy creation of color table
+   update_color_table(pd);
    ector_software_rasterizer_radial_gradient_set(pd->surface->software, pd);
    return EINA_TRUE;
 }
index 456e4e9..00230fe 100644 (file)
@@ -30,18 +30,35 @@ typedef struct _Outline
    int contours_alloc;
 }Outline;
 
+
+static inline void
+_grow_outline_contour(Outline *outline, int num)
+{
+   if ( outline->ft_outline.n_contours + num > outline->contours_alloc)
+     {
+        outline->contours_alloc += 5;
+        outline->ft_outline.contours = (short *) realloc(outline->ft_outline.contours, outline->contours_alloc * sizeof(short));
+     }
+}
+
+static inline void
+_grow_outline_points(Outline *outline, int num)
+{
+   if ( outline->ft_outline.n_points + num > outline->points_alloc)
+     {
+        outline->points_alloc += 50;
+        outline->ft_outline.points = (SW_FT_Vector *) realloc(outline->ft_outline.points, outline->points_alloc * sizeof(SW_FT_Vector));
+        outline->ft_outline.tags = (char *) realloc(outline->ft_outline.tags, outline->points_alloc * sizeof(char));
+     }
+}
 static Outline *
 _outline_create()
 {
    Outline *outline = (Outline *) calloc(1, sizeof(Outline));
-
-   outline->ft_outline.points = (SW_FT_Vector *) calloc(50, sizeof(SW_FT_Vector));
-   outline->ft_outline.tags = (char *) calloc(50, sizeof(char));
-
-   outline->ft_outline.contours = (short *) calloc(5, sizeof(short));
-
-   outline->points_alloc = 50;
-   outline->contours_alloc = 5;
+   outline->points_alloc = 0;
+   outline->contours_alloc = 0;
+   _grow_outline_contour(outline, 1);
+   _grow_outline_points(outline, 1);
    return outline;
 }
 
@@ -63,17 +80,14 @@ _outline_move_to(Outline *outline, double x, double y)
 {
    SW_FT_Outline *ft_outline = &outline->ft_outline;
 
-   if (ft_outline->n_contours == outline->contours_alloc)
-     {
-        outline->contours_alloc += 5;
-        ft_outline->contours = (short *) realloc(ft_outline->contours, outline->contours_alloc * sizeof(short));
-     }
+   _grow_outline_points(outline, 1);
    ft_outline->points[ft_outline->n_points].x = x;
    ft_outline->points[ft_outline->n_points].y = y;
    ft_outline->tags[ft_outline->n_points] = SW_FT_CURVE_TAG_ON;
 
    if (ft_outline->n_points)
      {
+        _grow_outline_contour(outline, 1);
         ft_outline->contours[ft_outline->n_contours] = ft_outline->n_points - 1;
         ft_outline->n_contours++;
      }
@@ -86,11 +100,7 @@ _outline_end(Outline *outline)
 {
    SW_FT_Outline *ft_outline = &outline->ft_outline;
 
-   if (ft_outline->n_contours == outline->contours_alloc)
-     {
-        outline->contours_alloc += 1;
-        ft_outline->contours = (short *) realloc(ft_outline->contours, outline->contours_alloc * sizeof(short));
-     }
+   _grow_outline_contour(outline, 1);
 
    if (ft_outline->n_points)
      {
@@ -104,12 +114,7 @@ static void  _outline_line_to(Outline *outline, double x, double y)
 {
    SW_FT_Outline *ft_outline = &outline->ft_outline;
 
-   if (ft_outline->n_points == outline->points_alloc)
-     {
-        outline->points_alloc += 50;
-        ft_outline->points = (SW_FT_Vector *) realloc(ft_outline->points, outline->points_alloc * sizeof(SW_FT_Vector));
-        ft_outline->tags = (char *) realloc(ft_outline->tags, outline->points_alloc * sizeof(char));
-     }
+   _grow_outline_points(outline, 1);
    ft_outline->points[ft_outline->n_points].x = x;
    ft_outline->points[ft_outline->n_points].y = y;
    ft_outline->tags[ft_outline->n_points] = SW_FT_CURVE_TAG_ON;
@@ -145,12 +150,7 @@ static void  _outline_cubic_to(Outline *outline, double cx1, double cy1, double
 {
    SW_FT_Outline *ft_outline = &outline->ft_outline;
 
-   if (ft_outline->n_points == outline->points_alloc)
-     {
-        outline->points_alloc += 50;
-        ft_outline->points = (SW_FT_Vector *) realloc(ft_outline->points, outline->points_alloc * sizeof(SW_FT_Vector));
-        ft_outline->tags = (char *) realloc(ft_outline->tags, outline->points_alloc * sizeof(char));
-     }
+   _grow_outline_points(outline, 3);
 
    ft_outline->points[ft_outline->n_points].x = cx1;
    ft_outline->points[ft_outline->n_points].y = cy1;
@@ -260,30 +260,11 @@ _generate_shape_data(Ector_Renderer_Software_Shape_Data *pd)
    return EINA_TRUE;
 }
 
-static Eina_Bool
-_ector_renderer_software_shape_ector_renderer_generic_base_prepare(Eo *obj, Ector_Renderer_Software_Shape_Data *pd)
+static void 
+_update_rle(Eo *obj, Ector_Renderer_Software_Shape_Data *pd)
 {
    const Efl_Gfx_Path_Command *cmds = NULL;
    const double *pts = NULL;
-
-   // FIXME: shouldn't that be part of the shape generic implementation ?
-   if (pd->shape->fill)
-     eo_do(pd->shape->fill, ector_renderer_prepare());
-   if (pd->shape->stroke.fill)
-     eo_do(pd->shape->stroke.fill, ector_renderer_prepare());
-   if (pd->shape->stroke.marker)
-     eo_do(pd->shape->stroke.marker, ector_renderer_prepare());
-
-   // shouldn't that be moved to the software base object
-   if (!pd->surface)
-     {
-        Eo *parent;
-        eo_do(obj, parent = eo_parent_get());
-        if (!parent) return EINA_FALSE;
-        pd->surface = eo_data_xref(parent, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
-        if (!pd->surface) return EINA_FALSE;
-     }
-
    eo_do(obj, efl_gfx_shape_path_get(&cmds, &pts));
    if (cmds && (_generate_stroke_data(pd) || _generate_shape_data(pd)))
      {
@@ -305,15 +286,39 @@ _ector_renderer_software_shape_ector_renderer_generic_base_prepare(Eo *obj, Ecto
           }
         _outline_destroy(outline);
      }
+}
+
+static Eina_Bool
+_ector_renderer_software_shape_ector_renderer_generic_base_prepare(Eo *obj, Ector_Renderer_Software_Shape_Data *pd)
+{
+   // FIXME: shouldn't that be part of the shape generic implementation ?
+   if (pd->shape->fill)
+     eo_do(pd->shape->fill, ector_renderer_prepare());
+   if (pd->shape->stroke.fill)
+     eo_do(pd->shape->stroke.fill, ector_renderer_prepare());
+   if (pd->shape->stroke.marker)
+     eo_do(pd->shape->stroke.marker, ector_renderer_prepare());
 
+   // shouldn't that be moved to the software base object
+   if (!pd->surface)
+     {
+        Eo *parent;
+        eo_do(obj, parent = eo_parent_get());
+        if (!parent) return EINA_FALSE;
+        pd->surface = eo_data_xref(parent, ECTOR_SOFTWARE_SURFACE_CLASS, obj);
+        if (!pd->surface) return EINA_FALSE;
+     }
    return EINA_TRUE;
 }
 
 static Eina_Bool
-_ector_renderer_software_shape_ector_renderer_generic_base_draw(Eo *obj EINA_UNUSED, Ector_Renderer_Software_Shape_Data *pd, Ector_Rop op, Eina_Array *clips, unsigned int mul_col)
+_ector_renderer_software_shape_ector_renderer_generic_base_draw(Eo *obj, Ector_Renderer_Software_Shape_Data *pd, Ector_Rop op, Eina_Array *clips, unsigned int mul_col)
 {
    int x, y;
 
+   // do lazy creation of rle
+   _update_rle(obj, pd);
+
    // adjust the offset
    x = pd->surface->x + (int)pd->base->origin.x;
    y = pd->surface->y + (int)pd->base->origin.y;
index 028fb9c..e6d2ce0 100644 (file)
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <assert.h>
 #include <math.h>
 
index 9e30a31..3ac885c 100644 (file)
@@ -103,11 +103,10 @@ typedef struct _Software_Rasterizer
 {
    SW_FT_Raster     raster;
    SW_FT_Stroker    stroker;
-
+   void            *mem_pool;
    Span_Data        fill_data;
    Eina_Matrix3    *transform;
    Eina_Rectangle   system_clip;
-
 } Software_Rasterizer;
 
 struct _Ector_Software_Surface_Data
index 7807c5f..a291f35 100644 (file)
@@ -284,9 +284,9 @@ _adjust_span_fill_methods(Span_Data *spdata)
 void ector_software_rasterizer_init(Software_Rasterizer *rasterizer)
 {
    // initialize the rasterizer and stroker
-   unsigned char* renderPool = (unsigned char*) malloc(1024 * 100);
+   rasterizer->mem_pool = (unsigned char*) malloc(1024 * 100);
    sw_ft_grays_raster.raster_new(&rasterizer->raster);
-   sw_ft_grays_raster.raster_reset(rasterizer->raster, renderPool, 1024*100);
+   sw_ft_grays_raster.raster_reset(rasterizer->raster, rasterizer->mem_pool, 1024*100);
 
    SW_FT_Stroker_New(&rasterizer->stroker);
    SW_FT_Stroker_Set(rasterizer->stroker, 1<<6,SW_FT_STROKER_LINECAP_BUTT,SW_FT_STROKER_LINEJOIN_MITER,0);
@@ -303,7 +303,7 @@ void ector_software_rasterizer_done(Software_Rasterizer *rasterizer)
 {
    sw_ft_grays_raster.raster_done(rasterizer->raster);
    SW_FT_Stroker_Done(rasterizer->stroker);
-   //TODO free the pool memory
+   free(rasterizer->mem_pool);
 }
 
 
index cbdb89f..296415d 100644 (file)
@@ -163,6 +163,8 @@ EAPI extern const Eo_Event_Description _EFL_GFX_PATH_CHANGED;
 #include "interfaces/efl_gfx_gradient_linear.eo.h"
 #include "interfaces/efl_gfx_gradient_radial.eo.h"
 
+#endif
+
 #if defined ( __cplusplus )
 }
 #endif
index 632c5bf..efbc9d5 100644 (file)
@@ -139,7 +139,7 @@ _efl_gfx_path_current_search(const Efl_Gfx_Path_Command *cmd,
    return EINA_TRUE;
 }
 
-void
+static void
 _efl_gfx_shape_path_set(Eo *obj, Efl_Gfx_Shape_Data *pd,
                         const Efl_Gfx_Path_Command *commands,
                         const double *points)
@@ -185,7 +185,7 @@ _efl_gfx_shape_path_set(Eo *obj, Efl_Gfx_Shape_Data *pd,
          eo_event_callback_call(EFL_GFX_CHANGED, NULL));
 }
 
-void
+static void
 _efl_gfx_shape_path_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
                         const Efl_Gfx_Path_Command **commands,
                         const double **points)
@@ -194,7 +194,7 @@ _efl_gfx_shape_path_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
    if (points) *points = pd->points;
 }
 
-void
+static void
 _efl_gfx_shape_path_length_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
                                unsigned int *commands, unsigned int *points)
 {
@@ -202,7 +202,37 @@ _efl_gfx_shape_path_length_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
    if (points) *points = pd->points_count;
 }
 
-void
+static void
+_efl_gfx_shape_bounds_get(Eo *obj EINA_UNUSED,
+                          Efl_Gfx_Shape_Data *pd,
+                          Eina_Rectangle *r)
+{
+   double minx, miny, maxx, maxy;
+   unsigned int i;
+
+   EINA_RECTANGLE_SET(r, 0, 0, 0, 0);
+
+   if (pd->points_count <= 0) return ;
+
+   minx = pd->points[0];
+   miny = pd->points[1];
+   maxx = pd->points[0];
+   maxy = pd->points[1];
+
+   for (i = 1; i < pd->points_count; i += 2)
+     {
+        minx = minx < pd->points[i] ? minx : pd->points[i];
+        miny = miny < pd->points[i + 1] ? miny : pd->points[i + 1];
+        maxx = maxx > pd->points[i] ? maxx : pd->points[i];
+        maxy = maxy > pd->points[i + 1] ? maxy : pd->points[i + 1];
+     }
+
+   EINA_RECTANGLE_SET(r,
+                      minx, miny,
+                      maxx - minx, maxy - miny);
+}
+
+static void
 _efl_gfx_shape_current_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
                            double *x, double *y)
 {
@@ -210,7 +240,7 @@ _efl_gfx_shape_current_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
    if (y) *y = pd->current.y;
 }
 
-void
+static void
 _efl_gfx_shape_current_ctrl_get(Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *pd,
                                 double *x, double *y)
 {
@@ -245,11 +275,12 @@ interpolatei(int from, int to, double pos_map)
    return (from * pos_map) + (to * (1.0 - pos_map));
 }
 
-typedef struct _Efl_Gfx_Stroke Efl_Gfx_Stroke;
-struct _Efl_Gfx_Stroke
+typedef struct _Efl_Gfx_Property Efl_Gfx_Property;
+struct _Efl_Gfx_Property
 {
    double scale;
    int r, g, b, a;
+   int fr, fg, fb, fa; 
    double w;
    double centered;
    const Efl_Gfx_Dash *dash;
@@ -259,19 +290,20 @@ struct _Efl_Gfx_Stroke
 };
 
 static inline void
-stroke_get(const Eo *obj, Efl_Gfx_Stroke *stroke)
+gfx_property_get(const Eo *obj, Efl_Gfx_Property *property)
 {
    eo_do(obj,
-         stroke->scale = efl_gfx_shape_stroke_scale_get(),
-         efl_gfx_shape_stroke_color_get(&stroke->r, &stroke->g, &stroke->b, &stroke->a),
-         stroke->w = efl_gfx_shape_stroke_width_get(),
-         stroke->centered = efl_gfx_shape_stroke_location_get(),
-         efl_gfx_shape_stroke_dash_get(&stroke->dash, &stroke->dash_length),
-         stroke->c = efl_gfx_shape_stroke_cap_get(),
-         stroke->j = efl_gfx_shape_stroke_join_get());
+         property->scale = efl_gfx_shape_stroke_scale_get(),
+         efl_gfx_shape_stroke_color_get(&property->r, &property->g, &property->b, &property->a),
+         efl_gfx_color_get(&property->fr, &property->fg, &property->fb, &property->fa),
+         property->w = efl_gfx_shape_stroke_width_get(),
+         property->centered = efl_gfx_shape_stroke_location_get(),
+         efl_gfx_shape_stroke_dash_get(&property->dash, &property->dash_length),
+         property->c = efl_gfx_shape_stroke_cap_get(),
+         property->j = efl_gfx_shape_stroke_join_get());
 }
 
-Eina_Bool
+static Eina_Bool
 _efl_gfx_shape_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd,
                            const Eo *from, const Eo *to, double pos_map)
 {
@@ -279,8 +311,8 @@ _efl_gfx_shape_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd,
    Efl_Gfx_Path_Command *cmds;
    double *pts, *from_pts, *to_pts;
    unsigned int i, j;
-   Efl_Gfx_Stroke stroke_from, stroke_to;
-   Efl_Gfx_Dash *dash;
+   Efl_Gfx_Property property_from, property_to;
+   Efl_Gfx_Dash *dash = NULL;
 
    from_pd = eo_data_scope_get(from, EFL_GFX_SHAPE_MIXIN);
    to_pd = eo_data_scope_get(to, EFL_GFX_SHAPE_MIXIN);
@@ -290,10 +322,10 @@ _efl_gfx_shape_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd,
    if (!_efl_gfx_shape_equal_commands_internal(from_pd, to_pd))
      return EINA_FALSE;
 
-   stroke_get(from, &stroke_from);
-   stroke_get(to, &stroke_to);
+   gfx_property_get(from, &property_from);
+   gfx_property_get(to, &property_to);
 
-   if (stroke_from.dash_length != stroke_to.dash_length) return EINA_FALSE;
+   if (property_from.dash_length != property_to.dash_length) return EINA_FALSE;
 
    cmds = realloc(pd->commands,
                   sizeof (Efl_Gfx_Path_Command) * from_pd->commands_count);
@@ -337,33 +369,36 @@ _efl_gfx_shape_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd,
                                     to_pd->current_ctrl.y,
                                     pos_map);
 
-   dash = malloc(sizeof (Efl_Gfx_Dash) * stroke_to.dash_length);
-   if (dash)
+   if (property_to.dash_length)
      {
-        for (i = 0; i < stroke_to.dash_length; i++)
+        dash = malloc(sizeof (Efl_Gfx_Dash) * property_to.dash_length);
+        if (!dash) return EINA_FALSE;
+
+        for (i = 0; i < property_to.dash_length; i++)
           {
-             dash[i].length = interpolate(stroke_from.dash[i].length,
-                                          stroke_to.dash[i].length, pos_map);
-             dash[i].gap = interpolate(stroke_from.dash[i].gap,
-                                       stroke_to.dash[i].gap, pos_map);
+             dash[i].length = interpolate(property_from.dash[i].length,
+                                          property_to.dash[i].length, pos_map);
+             dash[i].gap = interpolate(property_from.dash[i].gap,
+                                       property_to.dash[i].gap, pos_map);
           }
      }
-   else
-     {
-        stroke_to.dash_length = 0;
-     }
+
 
    eo_do(obj,
-         efl_gfx_shape_stroke_scale_set(interpolate(stroke_to.scale, stroke_from.scale, pos_map)),
-         efl_gfx_shape_stroke_color_set(interpolatei(stroke_to.r, stroke_from.r, pos_map),
-                                        interpolatei(stroke_to.g, stroke_from.g, pos_map),
-                                        interpolatei(stroke_to.b, stroke_from.b, pos_map),
-                                        interpolatei(stroke_to.a, stroke_from.a, pos_map)),
-         efl_gfx_shape_stroke_width_set(interpolate(stroke_to.w, stroke_from.w, pos_map)),
-         efl_gfx_shape_stroke_location_set(interpolate(stroke_to.centered, stroke_from.centered, pos_map)),
-         efl_gfx_shape_stroke_dash_set(dash, stroke_to.dash_length),
-         efl_gfx_shape_stroke_cap_set(pos_map < 0.5 ? stroke_from.c : stroke_to.c),
-         efl_gfx_shape_stroke_join_set(pos_map < 0.5 ? stroke_from.j : stroke_to.j),
+         efl_gfx_shape_stroke_scale_set(interpolate(property_to.scale, property_from.scale, pos_map)),
+         efl_gfx_shape_stroke_color_set(interpolatei(property_to.r, property_from.r, pos_map),
+                                        interpolatei(property_to.g, property_from.g, pos_map),
+                                        interpolatei(property_to.b, property_from.b, pos_map),
+                                        interpolatei(property_to.a, property_from.a, pos_map)),
+         efl_gfx_color_set(interpolatei(property_to.fr, property_from.fr, pos_map),
+                           interpolatei(property_to.fg, property_from.fg, pos_map),
+                           interpolatei(property_to.fb, property_from.fb, pos_map),
+                           interpolatei(property_to.fa, property_from.fa, pos_map)),
+         efl_gfx_shape_stroke_width_set(interpolate(property_to.w, property_from.w, pos_map)),
+         efl_gfx_shape_stroke_location_set(interpolate(property_to.centered, property_from.centered, pos_map)),
+         efl_gfx_shape_stroke_dash_set(dash, property_to.dash_length),
+         efl_gfx_shape_stroke_cap_set(pos_map < 0.5 ? property_from.c : property_to.c),
+         efl_gfx_shape_stroke_join_set(pos_map < 0.5 ? property_from.j : property_to.j),
 
          eo_event_callback_call(EFL_GFX_PATH_CHANGED, NULL),
          eo_event_callback_call(EFL_GFX_CHANGED, NULL));
@@ -371,7 +406,7 @@ _efl_gfx_shape_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd,
    return EINA_TRUE;
 }
 
-Eina_Bool
+static Eina_Bool
 _efl_gfx_shape_equal_commands(Eo *obj EINA_UNUSED,
                               Efl_Gfx_Shape_Data *pd,
                               const Eo *with)
@@ -384,7 +419,7 @@ _efl_gfx_shape_equal_commands(Eo *obj EINA_UNUSED,
    return _efl_gfx_shape_equal_commands_internal(with_pd, pd);
 }
 
-void
+static void
 _efl_gfx_shape_dup(Eo *obj, Efl_Gfx_Shape_Data *pd, Eo *dup_from)
 {
    const Efl_Gfx_Dash *dash = NULL;
@@ -424,7 +459,7 @@ _efl_gfx_shape_dup(Eo *obj, Efl_Gfx_Shape_Data *pd, Eo *dup_from)
          eo_event_callback_call(EFL_GFX_CHANGED, NULL));
 }
 
-void
+static void
 _efl_gfx_shape_reset(Eo *obj, Efl_Gfx_Shape_Data *pd)
 {
    free(pd->commands);
@@ -445,7 +480,7 @@ _efl_gfx_shape_reset(Eo *obj, Efl_Gfx_Shape_Data *pd)
          eo_event_callback_call(EFL_GFX_CHANGED, NULL));
 }
 
-void
+static void
 _efl_gfx_shape_append_move_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
                               double x, double y)
 {
@@ -466,7 +501,7 @@ _efl_gfx_shape_append_move_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
          eo_event_callback_call(EFL_GFX_CHANGED, NULL));
 }
 
-void
+static void
 _efl_gfx_shape_append_line_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
                               double x, double y)
 {
@@ -487,7 +522,7 @@ _efl_gfx_shape_append_line_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
          eo_event_callback_call(EFL_GFX_CHANGED, NULL));
 }
 
-void
+static void
 _efl_gfx_shape_append_cubic_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
                                double x, double y,
                                double ctrl_x0, double ctrl_y0,
@@ -516,7 +551,7 @@ _efl_gfx_shape_append_cubic_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
          eo_event_callback_call(EFL_GFX_CHANGED, NULL));
 }
 
-void
+static void
 _efl_gfx_shape_append_scubic_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
                                 double x, double y,
                                 double ctrl_x, double ctrl_y)
@@ -537,7 +572,7 @@ _efl_gfx_shape_append_scubic_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
                                   ctrl_x0, ctrl_y0, ctrl_x, ctrl_y);
 }
 
-void
+static void
 _efl_gfx_shape_append_quadratic_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
                                    double x, double y,
                                    double ctrl_x, double ctrl_y)
@@ -558,7 +593,7 @@ _efl_gfx_shape_append_quadratic_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
                                   ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1);
 }
 
-void
+static void
 _efl_gfx_shape_append_squadratic_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
                                     double x, double y)
 {
@@ -588,7 +623,7 @@ _efl_gfx_shape_append_squadratic_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
 /*
  * code adapted from enesim which was adapted from moonlight sources
  */
-void
+static void
 _efl_gfx_shape_append_arc_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
                              double x, double y,
                              double rx, double ry,
@@ -773,7 +808,7 @@ _efl_gfx_shape_append_arc_to(Eo *obj, Efl_Gfx_Shape_Data *pd,
      }
 }
 
-void
+static void
 _efl_gfx_shape_append_close(Eo *obj, Efl_Gfx_Shape_Data *pd)
 {
    double *offset_point;
@@ -786,18 +821,16 @@ _efl_gfx_shape_append_close(Eo *obj, Efl_Gfx_Shape_Data *pd)
          eo_event_callback_call(EFL_GFX_CHANGED, NULL));
 }
 
-void
+static void
 _efl_gfx_shape_append_circle(Eo *obj, Efl_Gfx_Shape_Data *pd,
-                             double x, double y, double radius)
+                             double xc, double yc, double radius)
 {
-   _efl_gfx_shape_append_move_to(obj, pd, x - radius, y);
-   _efl_gfx_shape_append_arc_to(obj, pd, x + radius, y, radius, radius, 0, EINA_FALSE, EINA_TRUE);
-   _efl_gfx_shape_append_arc_to(obj, pd, x, y + radius, radius, radius, 0, EINA_FALSE, EINA_TRUE);
-   _efl_gfx_shape_append_arc_to(obj, pd, x - radius, y, radius, radius, 0, EINA_FALSE, EINA_TRUE);
-   _efl_gfx_shape_append_arc_to(obj, pd, x, y - radius, radius, radius, 0, EINA_FALSE, EINA_TRUE);
+   _efl_gfx_shape_append_move_to(obj, pd, xc - radius, yc);
+   _efl_gfx_shape_append_arc_to(obj, pd, xc + radius, yc, radius, radius, 0, EINA_TRUE, EINA_TRUE);
+   _efl_gfx_shape_append_arc_to(obj, pd, xc - radius, yc, radius, radius, 0, EINA_TRUE, EINA_TRUE);
 }
 
-void
+static void
 _efl_gfx_shape_append_rect(Eo *obj, Efl_Gfx_Shape_Data *pd,
                            double x, double y, double w, double h,
                            double rx, double ry)
@@ -1147,7 +1180,7 @@ _efl_gfx_path_parse_arc_to(const char *content, char **end,
    return EINA_TRUE;
 }
 
-void
+static void
 _efl_gfx_shape_append_svg_path(Eo *obj, Efl_Gfx_Shape_Data *pd,
                                const char *svg_path_data)
 {
@@ -1181,6 +1214,7 @@ _efl_gfx_shape_append_svg_path(Eo *obj, Efl_Gfx_Shape_Data *pd,
                 return ;
               break;
            case 'z':
+           case 'Z':
               _efl_gfx_shape_append_close(obj, pd);
               content++;
               break;
index 2da5274..37d0abd 100644 (file)
@@ -189,6 +189,16 @@ mixin Efl.Gfx.Shape
           @in Eo *dup_from; /*@ Shape object from where data will be copied.*/
         }
       }
+      bounds_get {
+        /*@
+          Compute and return the bounding box of the currently set path
+
+          @since 1.14
+       */
+        params {
+         @out Eina_Rectangle r; /*@ Contain the bounding box of the currently set path */
+       }
+      }
       reset {
         /*@
           Reset the shape data of the shape object.
@@ -198,7 +208,7 @@ mixin Efl.Gfx.Shape
       }
       append_move_to {
         /*@
-          Moves the current point to the given point,
+          Moves the current point to the given point, 
           implicitly starting a new subpath and closing the previous one.
 
           @see efl_gfx_path_append_close()
@@ -292,7 +302,7 @@ mixin Efl.Gfx.Shape
       append_arc_to {
         /*@
           Append an arc that connects from the current point int the point list
-          to the given point (x,y). The arc is defined by the given radius in
+          to the given point (x,y). The arc is defined by the given radius in 
           x-direction (rx) and radius in y direction (ry) .
 
           @note Use this api if you know the end point's of the arc otherwise
index 380585f..9691946 100644 (file)
@@ -832,4 +832,3 @@ typedef Eo      Evas_VG_Node;
 #include "canvas/efl_vg_gradient.eo.h"
 #include "canvas/efl_vg_gradient_linear.eo.h"
 #include "canvas/efl_vg_gradient_radial.eo.h"
-#include "canvas/efl_vg_image.eo.h"
index ccdc051..fdb2575 100644 (file)
@@ -1540,6 +1540,8 @@ EAPI Evas_Object *evas_object_rectangle_add(Evas *e) EINA_WARN_UNUSED_RESULT EIN
  * @since 1.14
  */
 
+#ifdef EFL_BETA_API_SUPPORT
+
 /**
  * Creates a new vector object on the given Evas @p e canvas.
  *
@@ -2286,7 +2288,8 @@ EAPI void evas_vg_gradient_radial_focal_set(Eo *obj, double x, double y);
 EAPI void evas_vg_gradient_radial_focal_get(Eo *obj, double *x, double *y);
 
 #include "canvas/efl_vg_gradient_radial.eo.legacy.h"
->>>>>>> f359123... ector : integration of ector library in efl1.30.0 branch for tizen2.4
+
+#endif
 
 /**
  * @}
index 2b8d9e7..ebd0dce 100644 (file)
@@ -59,33 +59,22 @@ abstract Efl.VG.Base (Eo.Base, Efl.Gfx.Base, Efl.Gfx.Stack)
       } */
    }
    methods {
-      bound_get {
+      bounds_get {
          /*@
           Give the bounding box in screen coordinate as being drawn.
           It will start as the control box until it is refined once the shape
           is computed.
           @since 1.14
          */
-         return: bool @warn_unused;
          params {
             @out Eina_Rectangle r; /*@ bounding box to be returned */
          }
       }
-      original_bound_get {
-         /*@
-          Give the bounding box in screen coordinate as defined in
-          the file or at the insertion of the object (before any scaling).
-          @since 1.14
-         */
-         return: bool @warn_unused;
-         params {
-            @out Eina_Rectangle r; /*@ original bounding box to be returned */
-         }
-      }
    }
    implements {
       Eo.Base.parent.set;
       Eo.Base.constructor;
+      Eo.Base.destructor;
       Efl.Gfx.Base.visible.set;
       Efl.Gfx.Base.visible.get;
       Efl.Gfx.Base.color.set;
@@ -101,6 +90,6 @@ abstract Efl.VG.Base (Eo.Base, Efl.Gfx.Base, Efl.Gfx.Stack)
       Efl.Gfx.Stack.stack_above;
       Efl.Gfx.Stack.raise;
       Efl.Gfx.Stack.lower;
-      @virtual .bound_get;
+      @virtual .bounds_get;
    }
 }
\ No newline at end of file
index 4d8a085..0c954e2 100644 (file)
@@ -4,6 +4,6 @@ class Efl.VG.Container (Efl.VG.Base)
    implements {
       Eo.Base.constructor;
       Eo.Base.destructor;
-      Efl.VG.Base.bound_get;
+      Efl.VG.Base.bounds_get;
    }
 }
index bc9c664..4aaddd4 100644 (file)
@@ -6,6 +6,7 @@ class Efl.VG.Gradient_Linear (Efl.VG.Gradient, Efl.Gfx.Gradient.Linear)
       Efl.Gfx.Gradient.Linear.start.get;
       Efl.Gfx.Gradient.Linear.end.set;
       Efl.Gfx.Gradient.Linear.end.get;
+      Efl.VG.Base.bounds_get;
       Eo.Base.constructor;
       Eo.Base.destructor;
    }
index 0d60589..62eb086 100644 (file)
@@ -8,6 +8,7 @@ class Efl.VG.Gradient_Radial (Efl.VG.Gradient, Efl.Gfx.Gradient.Radial)
       Efl.Gfx.Gradient.Radial.radius.get;
       Efl.Gfx.Gradient.Radial.focal.set;
       Efl.Gfx.Gradient.Radial.focal.get;     
+      Efl.VG.Base.bounds_get;
       Eo.Base.constructor;
       Eo.Base.destructor;
    }
index ab6468c..ee43e83 100644 (file)
@@ -40,7 +40,7 @@ class Efl.VG.Shape (Efl.VG.Base, Efl.Gfx.Shape)
       Efl.Gfx.Shape.stroke_join;
       Efl.Gfx.Base.color_part.set;
       Efl.Gfx.Base.color_part.get;
-      Efl.VG.Base.bound_get;
+      Efl.VG.Base.bounds_get;
       Eo.Base.constructor;
       Eo.Base.destructor;
    }
index afbe045..57d4090 100644 (file)
@@ -19,10 +19,6 @@ struct _Evas_VG_Data
    void   *engine_data;
    Efl_VG *root;
 
-   /* Opening an SVG file (could actually be inside an eet section */
-   Eina_File    *f;
-   const char   *key;
-
    Eina_Rectangle fill;
 
    unsigned int width, height;
@@ -375,72 +371,6 @@ evas_object_vg_was_opaque(Evas_Object *eo_obj EINA_UNUSED,
    return 0;
 }
 
-
-static Eina_Bool
-_evas_vg_efl_file_mmap_set(Eo *obj EINA_UNUSED, Evas_VG_Data *pd,
-                           const Eina_File *f, const char *key)
-{
-   Eina_File *tmp;
-
-   if (f == pd->f &&
-       ((key == NULL && pd->key == NULL) ||
-        (key != NULL && pd->key != NULL && !strcmp(key, pd->key))))
-     return EINA_FALSE;
-
-   tmp = f ? eina_file_dup(f) : NULL;
-
-   if (tmp)
-     {
-        if (!evas_vg_loader_svg(obj, tmp, NULL))
-          {
-             eina_file_close(tmp);
-             return EINA_FALSE;
-          }
-     }
-
-   // it succeeded.
-   if (pd->f) eina_file_close(pd->f);
-   pd->f = tmp;
-   eina_stringshare_replace(&pd->key, key);
-
-   return EINA_TRUE;
-}
-
-static void
-_evas_vg_efl_file_mmap_get(Eo *obj EINA_UNUSED, Evas_VG_Data *pd,
-                           const Eina_File **f, const char **key)
-{
-   if (f) *f = pd->f;
-   if (key) *key = pd->key;
-}
-
-Eina_Bool
-_evas_vg_efl_file_file_set(Eo *obj, Evas_VG_Data *pd EINA_UNUSED,
-                           const char *file, const char *key)
-{
-   Eina_File *f;
-   Eina_Bool r = EINA_FALSE;
-
-   f = eina_file_open(file, EINA_FALSE);
-   if (!f) return EINA_FALSE;
-
-   eo_do(obj, efl_file_mmap_set(f, key));
-
-   eina_file_close(f);
-   return r;
-}
-
-void
-_evas_vg_efl_file_file_get(Eo *obj, Evas_VG_Data *pd EINA_UNUSED,
-                           const char **file, const char **key)
-{
-   const Eina_File *f = NULL;
-
-   eo_do(obj, efl_file_mmap_get(&f, key));
-
-   if (file) *file = eina_file_filename_get(f);
-}
-
 void
 _evas_vg_efl_gfx_view_size_get(Eo *obj EINA_UNUSED, Evas_VG_Data *pd,
                                int *w, int *h)
index 8247f46..8c6d352 100644 (file)
@@ -1,4 +1,4 @@
-class Evas.VG (Evas.Object, Efl.File, Efl.Gfx.Fill, Efl.Gfx.View)
+class Evas.VG (Evas.Object, Efl.Gfx.Fill, Efl.Gfx.View)
 {
    legacy_prefix: evas_object_vg;
    eo_prefix: evas_obj_vg;
@@ -22,10 +22,6 @@ class Evas.VG (Evas.Object, Efl.File, Efl.Gfx.Fill, Efl.Gfx.View)
    implements {
       Eo.Base.constructor;
       Eo.Base.destructor;
-      Efl.File.file.set;
-      Efl.File.file.get;
-      Efl.File.mmap.set;
-      Efl.File.mmap.get;
       Efl.Gfx.Fill.fill.set;
       Efl.Gfx.Fill.fill.get;
       Efl.Gfx.View.size.set;
index e85ff3b..ba0eeec 100644 (file)
@@ -45,8 +45,8 @@ _efl_vg_container_eo_base_destructor(Eo *obj,
    eo_do_super(obj, MY_CLASS, eo_destructor());
 }
 
-static Eina_Bool
-_efl_vg_container_efl_vg_base_bound_get(Eo *obj EINA_UNUSED,
+static void
+_efl_vg_container_efl_vg_base_bounds_get(Eo *obj EINA_UNUSED,
                                         Efl_VG_Container_Data *pd,
                                         Eina_Rectangle *r)
 {
@@ -55,25 +55,21 @@ _efl_vg_container_efl_vg_base_bound_get(Eo *obj EINA_UNUSED,
    Eina_List *l;
    Eo *child;
 
-   if (!r) return EINA_FALSE;
-
    EINA_RECTANGLE_SET(&s, -1, -1, 0, 0);
 
    EINA_LIST_FOREACH(pd->children, l, child)
      {
         if (first)
           {
-             eo_do(child, efl_vg_bound_get(r));
+             eo_do(child, efl_vg_bounds_get(r));
              first = EINA_FALSE;
           }
         else
           {
-             eo_do(child, efl_vg_bound_get(&s));
+             eo_do(child, efl_vg_bounds_get(&s));
              eina_rectangle_union(r, &s);
           }
      }
-   // returning EINA_FALSE if no bouding box was found
-   return first ? EINA_FALSE : EINA_TRUE;
 }
 
 EAPI Efl_VG*
@@ -82,5 +78,4 @@ evas_vg_container_add(Efl_VG *parent)
    return eo_add(EFL_VG_CONTAINER_CLASS, parent);
 }
 
-
 #include "efl_vg_container.eo.c"
index 814bd47..9f05fac 100644 (file)
@@ -101,12 +101,23 @@ _efl_vg_gradient_linear_eo_base_constructor(Eo *obj,
    nd->data = pd;
 }
 
-void
+static void
 _efl_vg_gradient_linear_eo_base_destructor(Eo *obj, Efl_VG_Gradient_Linear_Data *pd EINA_UNUSED)
 {
    eo_do_super(obj, MY_CLASS, eo_destructor());
 }
 
+static void
+_efl_vg_gradient_linear_efl_vg_base_bounds_get(Eo *obj, Efl_VG_Gradient_Linear_Data *pd, Eina_Rectangle *r)
+{
+   Efl_VG_Base_Data *nd;
+
+   nd = eo_data_scope_get(obj, EFL_VG_BASE_CLASS);
+   EINA_RECTANGLE_SET(r,
+                      nd->x + pd->start.x, nd->y + pd->start.y,
+                      pd->end.x - pd->start.x, pd->end.y - pd->start.x);
+}
+
 EAPI void
 evas_vg_gradient_linear_start_set(Eo *obj, double x, double y)
 {
index a61f990..5c02902 100644 (file)
@@ -124,6 +124,18 @@ _efl_vg_gradient_radial_eo_base_destructor(Eo *obj,
    eo_do_super(obj, MY_CLASS, eo_destructor());
 }
 
+static void
+_efl_vg_gradient_radial_efl_vg_base_bounds_get(Eo *obj, Efl_VG_Gradient_Radial_Data *pd, Eina_Rectangle *r)
+{
+   Efl_VG_Base_Data *nd;
+
+   nd = eo_data_scope_get(obj, EFL_VG_BASE_CLASS);
+   EINA_RECTANGLE_SET(r,
+                      nd->x + pd->center.x - pd->radius,
+                      nd->y + pd->center.y - pd->radius,
+                      pd->radius * 2, pd->radius * 2);
+}
+
 EAPI void
 evas_vg_gradient_radial_center_set(Eo *obj, double x, double y)
 {
index ee95037..3db4187 100644 (file)
@@ -2,6 +2,7 @@
 #include "evas_private.h"
 
 #include "evas_vg_private.h"
+#include "efl_vg_root_node.eo.h"
 
 #include <string.h>
 #include <math.h>
@@ -22,7 +23,7 @@ _efl_vg_base_property_changed(void *data, Eo *obj, const Eo_Event_Description *d
    return EINA_TRUE;
 }
 
-void
+static void
 _efl_vg_base_transformation_set(Eo *obj,
                                 Efl_VG_Base_Data *pd,
                                 const Eina_Matrix3 *m)
@@ -43,7 +44,7 @@ _efl_vg_base_transformation_get(Eo *obj EINA_UNUSED, Efl_VG_Base_Data *pd)
    return pd->m;
 }
 
-void
+static void
 _efl_vg_base_origin_set(Eo *obj,
                         Efl_VG_Base_Data *pd,
                         double x, double y)
@@ -54,7 +55,7 @@ _efl_vg_base_origin_set(Eo *obj,
    _efl_vg_base_changed(obj);
 }
 
-void
+static void
 _efl_vg_base_origin_get(Eo *obj EINA_UNUSED,
                         Efl_VG_Base_Data *pd,
                         double *x, double *y)
@@ -63,7 +64,7 @@ _efl_vg_base_origin_get(Eo *obj EINA_UNUSED,
    if (y) *y = pd->y;
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_base_position_set(Eo *obj EINA_UNUSED,
                                        Efl_VG_Base_Data *pd,
                                        int x, int y)
@@ -74,7 +75,7 @@ _efl_vg_base_efl_gfx_base_position_set(Eo *obj EINA_UNUSED,
    _efl_vg_base_changed(obj);
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_base_position_get(Eo *obj EINA_UNUSED,
                                        Efl_VG_Base_Data *pd,
                                        int *x, int *y)
@@ -83,7 +84,7 @@ _efl_vg_base_efl_gfx_base_position_get(Eo *obj EINA_UNUSED,
    if (y) *y = pd->y;
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_base_visible_set(Eo *obj EINA_UNUSED,
                                       Efl_VG_Base_Data *pd, Eina_Bool v)
 {
@@ -93,14 +94,14 @@ _efl_vg_base_efl_gfx_base_visible_set(Eo *obj EINA_UNUSED,
 }
 
 
-Eina_Bool
+static Eina_Bool
 _efl_vg_base_efl_gfx_base_visible_get(Eo *obj EINA_UNUSED,
                                       Efl_VG_Base_Data *pd)
 {
    return pd->visibility;
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_base_color_set(Eo *obj EINA_UNUSED,
                                     Efl_VG_Base_Data *pd,
                                     int r, int g, int b, int a)
@@ -133,7 +134,7 @@ _efl_vg_base_efl_gfx_base_color_set(Eo *obj EINA_UNUSED,
    _efl_vg_base_changed(obj);
 }
 
-Eina_Bool
+static Eina_Bool
 _efl_vg_base_efl_gfx_base_color_part_set(Eo *obj, Efl_VG_Base_Data *pd,
                                          const char *part,
                                          int r, int g, int b, int a)
@@ -144,7 +145,7 @@ _efl_vg_base_efl_gfx_base_color_part_set(Eo *obj, Efl_VG_Base_Data *pd,
    return EINA_TRUE;
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_base_color_get(Eo *obj EINA_UNUSED,
                                     Efl_VG_Base_Data *pd,
                                     int *r, int *g, int *b, int *a)
@@ -155,7 +156,7 @@ _efl_vg_base_efl_gfx_base_color_get(Eo *obj EINA_UNUSED,
    if (a) *a = pd->a;
 }
 
-Eina_Bool
+static Eina_Bool
 _efl_vg_base_efl_gfx_base_color_part_get(Eo *obj, Efl_VG_Base_Data *pd,
                                          const char *part,
                                          int *r, int *g, int *b, int *a)
@@ -166,7 +167,7 @@ _efl_vg_base_efl_gfx_base_color_part_get(Eo *obj, Efl_VG_Base_Data *pd,
    return EINA_TRUE;
 }
 
-void
+static void
 _efl_vg_base_mask_set(Eo *obj EINA_UNUSED,
                        Efl_VG_Base_Data *pd,
                        Efl_VG_Base *r)
@@ -179,22 +180,22 @@ _efl_vg_base_mask_set(Eo *obj EINA_UNUSED,
    _efl_vg_base_changed(obj);
 }
 
-Efl_VG_Base*
+static Efl_VG_Base*
 _efl_vg_base_mask_get(Eo *obj EINA_UNUSED, Efl_VG_Base_Data *pd)
 {
    return pd->mask;
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_base_size_get(Eo *obj,
                                    Efl_VG_Base_Data *pd EINA_UNUSED,
                                    int *w, int *h)
 {
-   Eina_Rectangle bound = { 0, 0, 0, 0 };
+   Eina_Rectangle r = { 0, 0, 0, 0 };
 
-   eo_do(obj, efl_vg_bound_get(&bound));
-   if (w) *w = bound.w;
-   if (h) *h = bound.h;
+   eo_do(obj, efl_vg_bounds_get(&r));
+   if (w) *w = r.w;
+   if (h) *h = r.h;
 }
 
 // Parent should be a container otherwise dismissing the stacking operation
@@ -229,7 +230,7 @@ _efl_vg_base_parent_checked_get(Eo *obj,
    return EINA_FALSE;
 }
 
-void
+static void
 _efl_vg_base_eo_base_constructor(Eo *obj,
                                  Efl_VG_Base_Data *pd)
 {
@@ -245,7 +246,18 @@ _efl_vg_base_eo_base_constructor(Eo *obj,
    pd->changed = EINA_TRUE;
 }
 
-void
+static void
+_efl_vg_base_eo_base_destructor(Eo *obj, Efl_VG_Base_Data *pd)
+{
+   if (pd->m)
+     {
+        free(pd->m);
+        pd->m = NULL;
+     }
+   eo_do_super(obj, MY_CLASS, eo_destructor());
+}
+
+static void
 _efl_vg_base_eo_base_parent_set(Eo *obj,
                                 Efl_VG_Base_Data *pd EINA_UNUSED,
                                 Eo *parent)
@@ -291,7 +303,7 @@ _efl_vg_base_eo_base_parent_set(Eo *obj,
    return ;
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_stack_raise(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
 {
    Efl_VG_Container_Data *cd;
@@ -319,7 +331,7 @@ _efl_vg_base_efl_gfx_stack_raise(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
    eo_error_set(obj);
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_stack_stack_above(Eo *obj,
                                        Efl_VG_Base_Data *pd EINA_UNUSED,
                                        Efl_Gfx_Stack *above)
@@ -349,7 +361,7 @@ _efl_vg_base_efl_gfx_stack_stack_above(Eo *obj,
    eo_error_set(obj);
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_stack_stack_below(Eo *obj,
                                        Efl_VG_Base_Data *pd EINA_UNUSED,
                                        Efl_Gfx_Stack *below)
@@ -379,7 +391,7 @@ _efl_vg_base_efl_gfx_stack_stack_below(Eo *obj,
    eo_error_set(obj);
 }
 
-void
+static void
 _efl_vg_base_efl_gfx_stack_lower(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
 {
    Efl_VG_Container_Data *cd;
@@ -407,26 +419,110 @@ _efl_vg_base_efl_gfx_stack_lower(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
    eo_error_set(obj);
 }
 
-Efl_Gfx_Stack *
-_efl_vg_base_efl_gfx_stack_below_get(Eo *obj, Efl_VG_Base_Data *pd)
+static Eo *
+_efl_vg_base_root_parent_get(Eo *obj)
 {
-   // FIXME: need to implement bound_get
-   return NULL;
+   Eo *parent;
+
+   if (eo_isa(obj, EFL_VG_ROOT_NODE_CLASS))
+     return obj;
+
+   eo_do(obj, parent = eo_parent_get());
+
+   if (!parent) return NULL;
+   return _efl_vg_base_root_parent_get(parent);
 }
 
-Efl_Gfx_Stack *
-_efl_vg_base_efl_gfx_stack_above_get(Eo *obj, Efl_VG_Base_Data *pd)
+static void
+_efl_vg_base_walk_down_at(Eo *root, Eina_Array *a, Eina_Rectangle *r)
 {
-   // FIXME: need to implement bound_get
-   return NULL;
+   Eina_Rectangle bounds;
+
+   eo_do(root, efl_vg_bounds_get(&bounds));
+   if (!eina_rectangles_intersect(&bounds, r)) return ;
+
+   eina_array_push(a, root);
+
+   if (eo_isa(root, EFL_VG_CONTAINER_CLASS))
+     {
+        Efl_VG_Container_Data *cd;
+        Eina_List *l;
+        Eo *child;
+
+        cd = eo_data_scope_get(root, EFL_VG_CONTAINER_CLASS);
+        EINA_LIST_FOREACH(cd->children, l, child)
+          _efl_vg_base_walk_down_at(child, a, r);
+     }
 }
 
-Eina_Bool
-_efl_vg_base_original_bound_get(Eo *obj,
-                                Efl_VG_Base_Data *pd,
-                                Eina_Rectangle *r)
+static void
+_efl_vg_base_object_at(Eo *obj, Eina_Array *a, Eina_Rectangle *r)
 {
-   return EINA_FALSE;
+   Eo *root;
+
+   root = _efl_vg_base_root_parent_get(obj);
+   if (!root) return ;
+
+   _efl_vg_base_walk_down_at(root, a, r);
+}
+
+static Efl_Gfx_Stack *
+_efl_vg_base_efl_gfx_stack_below_get(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
+{
+   Eina_Rectangle r;
+   Eina_Array a;
+   Eo *current;
+   Eo *below = NULL;
+   Eina_Array_Iterator iterator;
+   unsigned int i;
+
+   eo_do(obj, efl_vg_bounds_get(&r));
+
+   eina_array_step_set(&a, sizeof (Eina_Array), 8);
+
+   _efl_vg_base_object_at(obj, &a, &r);
+
+   EINA_ARRAY_ITER_NEXT(&a, i, current, iterator)
+     if (current == obj)
+       {
+          i++;
+          if (i < eina_array_count(&a))
+            below = eina_array_data_get(&a, i);
+          break;
+       }
+
+   eina_array_flush(&a);
+
+   return below;
+}
+
+static Efl_Gfx_Stack *
+_efl_vg_base_efl_gfx_stack_above_get(Eo *obj, Efl_VG_Base_Data *pd EINA_UNUSED)
+{
+   Eina_Rectangle r;
+   Eina_Array a;
+   Eo *current;
+   Eo *above = NULL;
+   Eina_Array_Iterator iterator;
+   unsigned int i;
+
+   eo_do(obj, efl_vg_bounds_get(&r));
+
+   eina_array_step_set(&a, sizeof (Eina_Array), 8);
+
+   _efl_vg_base_object_at(obj, &a, &r);
+
+   EINA_ARRAY_ITER_NEXT(&a, i, current, iterator)
+     if (current == obj)
+       {
+          if (i > 0)
+            above = eina_array_data_get(&a, i - 1);
+          break;
+       }
+
+   eina_array_flush(&a);
+
+   return above;
 }
 
 EAPI Eina_Bool
index 8362dfd..65dbb02 100644 (file)
@@ -47,7 +47,7 @@ _evas_vg_root_node_changed(void *data, Eo *obj,
    return EINA_TRUE;
 }
 
-void
+static void
 _efl_vg_root_node_eo_base_parent_set(Eo *obj,
                                      Efl_VG_Root_Node_Data *pd,
                                      Eo *parent)
@@ -65,7 +65,7 @@ _efl_vg_root_node_eo_base_parent_set(Eo *obj,
      }
 }
 
-void
+static void
 _efl_vg_root_node_eo_base_constructor(Eo *obj,
                                       Efl_VG_Root_Node_Data *pd)
 {
index eb3e44e..0bbd713 100644 (file)
@@ -28,12 +28,13 @@ struct _Efl_VG_Shape_Data
    } stroke;
 };
 
-static Eina_Bool
-_efl_vg_shape_efl_vg_base_bound_get(Eo *obj,
-                                    Efl_VG_Shape_Data *pd,
+static void
+_efl_vg_shape_efl_vg_base_bounds_get(Eo *obj,
+                                    Efl_VG_Shape_Data *pd EINA_UNUSED,
                                     Eina_Rectangle *r)
 {
-   return EINA_FALSE;
+   // FIXME: Use the renderer bounding box when it has been created instead of an estimation
+   eo_do(obj, efl_gfx_shape_bounds_get(r));
 }
 
 static void
index 6af3e5e..1b50ded 100644 (file)
@@ -3267,6 +3267,9 @@ _draw_thread_ector_surface_set(void *data)
    unsigned int x = 0;
    unsigned int y = 0;
 
+   // flush the cpu pipeline before ector drawing.
+   evas_common_cpu_end_opt();
+
    if (surface)
      {
         pixels = evas_cache_image_pixels(&surface->cache_entry);
@@ -3289,8 +3292,6 @@ _draw_thread_ector_surface_set(void *data)
               ector_surface_reference_point_set(x, y));
      }
 
-   evas_common_cpu_end_opt();
-
    eina_mempool_free(_mp_command_ector_surface, ector_surface);
 }
 
@@ -3532,6 +3533,7 @@ static Evas_Func func =
      NULL, // eng_texture_filter_set
      NULL, // eng_texture_filter_get
      NULL, // eng_texture_image_set
+     NULL, // eng_output_copy
      eng_ector_get,
      eng_ector_begin,
      eng_ector_renderer_draw,
@@ -4623,8 +4625,6 @@ static Evas_Module_Api evas_modapi =
    }
 };
 
-EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, software_generic);
-
 Eina_Bool evas_engine_software_generic_init(void)
 {
    return evas_module_register(&evas_modapi, EVAS_MODULE_TYPE_ENGINE);
@@ -4680,6 +4680,13 @@ static void (*cairo_destroy)(cairo_t *cr) = NULL;
 typedef struct _Ector_Cairo_Software_Surface_Data Ector_Cairo_Software_Surface_Data;
 struct _Ector_Cairo_Software_Surface_Data
 {
+   cairo_surface_t *surface;
+   cairo_t *ctx;
+
+   void *pixels;
+
+   unsigned int width;
+   unsigned int height;
 };
 
 void
@@ -4719,6 +4726,9 @@ _ector_cairo_software_surface_surface_set(Eo *obj, Ector_Cairo_Software_Surface_
 void
 _ector_cairo_software_surface_surface_get(Eo *obj EINA_UNUSED, Ector_Cairo_Software_Surface_Data *pd, void **pixels, unsigned int *width, unsigned int *height)
 {
+   if (pixels) *pixels = pd->pixels;
+   if (width) *width = pd->width;
+   if (height) *height = pd->height;
 }
 
 #include "ector_cairo_software_surface.eo.c"