aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2018-12-28 12:20:15 +0900
committerHermet Park <hermetpark@gmail.com>2018-12-28 12:20:15 +0900
commitd2ec3ce17039dcb16966532a41ccf7bf6cb906e0 (patch)
tree560f8ec62a09181070e944ef3955608ec39ab14d
parentmeson - dont install eina bench cmp and use install_mode (diff)
downloadefl-d2ec3ce17039dcb16966532a41ccf7bf6cb906e0.tar.gz
efl gfx_path: remove EFL_GFX_PATH_EVENT_CHANGED
Summary: Here is an additional optmization patch for removing unnecessary updation of path, For instance, let's assume this scenario: If one vg object has 20 path nodes(shapes), and every single nodes would have 50 path changes. (like, append_cubic, append_rect, append_xxx ...); There would 1000 events triggering. Furthermore, if there are 20 vector objects in one view, hese events would be triggered 20000 in one frame. It's insane, actually I could figured out that happens. and it took a lot of cpu consumption in some vector usages. efl_gfx_path_commit() is my idea to avoid this. When path is ready, the path need to get this api call in the last to make object changed properly. @feature Reviewers: #committers, cedric Reviewed By: #committers, cedric Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7494
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_shape.c24
-rw-r--r--src/lib/ector/cairo/ector_renderer_cairo_shape.eo1
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_shape.c21
-rw-r--r--src/lib/ector/gl/ector_renderer_gl_shape.eo1
-rw-r--r--src/lib/ector/software/ector_renderer_software_shape.c43
-rw-r--r--src/lib/ector/software/ector_renderer_software_shape.eo2
-rw-r--r--src/lib/efl/interfaces/efl_gfx_path.c49
-rw-r--r--src/lib/efl/interfaces/efl_gfx_path.eo13
-rw-r--r--src/lib/efl/interfaces/efl_gfx_shape.c3
-rw-r--r--src/lib/elementary/efl_ui_textpath.c16
-rw-r--r--src/lib/elementary/efl_ui_textpath.eo1
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_shape.c51
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_shape.eo1
13 files changed, 94 insertions, 132 deletions
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.c b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
index 2605623466..87fe2a0778 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_shape.c
+++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.c
@@ -75,19 +75,15 @@ struct _Ector_Renderer_Cairo_Shape_Data
cairo_path_t *path;
};
-static void
-_ector_renderer_cairo_shape_path_changed(void *data, const Efl_Event *event)
+EOLIAN static void
+_ector_renderer_cairo_shape_efl_gfx_path_commit(Eo *obj EINA_UNUSED,
+ Ector_Renderer_Cairo_Shape_Data *pd)
{
- Ector_Renderer_Cairo_Shape_Data *pd = data;
- Efl_Gfx_Path_Change_Event *ev = event->info;
-
- if (!pd->path) return;
- if (ev && !((ev->what & EFL_GFX_CHANGE_FLAG_MATRIX) ||
- (ev->what & EFL_GFX_CHANGE_FLAG_PATH)))
- return;
-
- cairo_path_destroy(pd->path);
- pd->path = NULL;
+ if (pd->path)
+ {
+ cairo_path_destroy(pd->path);
+ pd->path = NULL;
+ }
}
static Eina_Bool
@@ -255,9 +251,7 @@ _ector_renderer_cairo_shape_efl_object_constructor(Eo *obj, Ector_Renderer_Cairo
pd->shape = efl_data_xref(obj, ECTOR_RENDERER_SHAPE_MIXIN, obj);
pd->base = efl_data_xref(obj, ECTOR_RENDERER_CLASS, obj);
- efl_event_callback_add(obj, EFL_GFX_PATH_EVENT_CHANGED, _ector_renderer_cairo_shape_path_changed, pd);
-
- return obj;
+ return obj;
}
static Efl_Object *
diff --git a/src/lib/ector/cairo/ector_renderer_cairo_shape.eo b/src/lib/ector/cairo/ector_renderer_cairo_shape.eo
index b76dd29879..7c958441ee 100644
--- a/src/lib/ector/cairo/ector_renderer_cairo_shape.eo
+++ b/src/lib/ector/cairo/ector_renderer_cairo_shape.eo
@@ -6,6 +6,7 @@ class Ector.Renderer.Cairo.Shape (Ector.Renderer.Cairo, Ector.Renderer.Shape, Ef
Ector.Renderer.prepare;
Ector.Renderer.draw;
Efl.Gfx.Path.bounds_get;
+ Efl.Gfx.Path.commit;
Ector.Renderer.crc { get; }
Ector.Renderer.Cairo.op_fill;
Efl.Object.constructor;
diff --git a/src/lib/ector/gl/ector_renderer_gl_shape.c b/src/lib/ector/gl/ector_renderer_gl_shape.c
index 79e029d1fd..cf2266da2f 100644
--- a/src/lib/ector/gl/ector_renderer_gl_shape.c
+++ b/src/lib/ector/gl/ector_renderer_gl_shape.c
@@ -20,18 +20,15 @@ struct _Ector_Renderer_GL_Shape_Data
GLshort *vertex;
};
-static void
-_ector_renderer_gl_shape_path_changed(void *data, const Efl_Event *event EINA_UNUSED)
+EOLIAN static void
+_ector_renderer_gl_shape_efl_gfx_path_commit(Eo *obj EINA_UNUSED,
+ Ector_Renderer_GL_Shape_Data *pd)
{
- Ector_Renderer_GL_Shape_Data *pd = data;
- Efl_Gfx_Path_Change_Event *ev = event->info;
-
- if (ev && !((ev->what & EFL_GFX_CHANGE_FLAG_MATRIX) ||
- (ev->what & EFL_GFX_CHANGE_FLAG_PATH)))
- return;
-
- free(pd->vertex);
- pd->vertex = NULL;
+ if (pd->vertex)
+ {
+ free(pd->vertex);
+ pd->vertex = NULL;
+ }
}
static Eina_Bool
@@ -154,8 +151,6 @@ _ector_renderer_gl_shape_efl_object_constructor(Eo *obj, Ector_Renderer_GL_Shape
pd->shape = efl_data_xref(obj, ECTOR_RENDERER_SHAPE_MIXIN, obj);
pd->base = efl_data_xref(obj, ECTOR_RENDERER_CLASS, obj);
- efl_event_callback_add(obj, EFL_GFX_PATH_EVENT_CHANGED, _ector_renderer_gl_shape_path_changed, pd);
-
return obj;
}
diff --git a/src/lib/ector/gl/ector_renderer_gl_shape.eo b/src/lib/ector/gl/ector_renderer_gl_shape.eo
index 21ef655d7c..6323ef6f1f 100644
--- a/src/lib/ector/gl/ector_renderer_gl_shape.eo
+++ b/src/lib/ector/gl/ector_renderer_gl_shape.eo
@@ -8,6 +8,7 @@ class Ector.Renderer.GL.Shape (Ector.Renderer.GL, Ector.Renderer.Shape, Efl.Gfx.
Ector.Renderer.crc { get; }
Ector.Renderer.GL.op_fill;
Efl.Gfx.Path.bounds_get;
+ Efl.Gfx.Path.commit;
Efl.Object.constructor;
Efl.Object.destructor;
}
diff --git a/src/lib/ector/software/ector_renderer_software_shape.c b/src/lib/ector/software/ector_renderer_software_shape.c
index 396e47283e..b9cf1faaed 100644
--- a/src/lib/ector/software/ector_renderer_software_shape.c
+++ b/src/lib/ector/software/ector_renderer_software_shape.c
@@ -734,36 +734,20 @@ _ector_renderer_software_shape_ector_renderer_software_op_fill(Eo *obj EINA_UNUS
return EINA_FALSE;
}
-static void
-_ector_renderer_software_shape_efl_gfx_path_path_set(Eo *obj,
- Ector_Renderer_Software_Shape_Data *pd,
- const Efl_Gfx_Path_Command *op,
- const double *points)
-{
- if (pd->shape_data) ector_software_rasterizer_destroy_rle_data(pd->shape_data);
- if (pd->outline_data) ector_software_rasterizer_destroy_rle_data(pd->outline_data);
- pd->shape_data = NULL;
- pd->outline_data = NULL;
-
- efl_gfx_path_set(efl_super(obj, MY_CLASS), op, points);
-}
-
-
-static void
-_ector_renderer_software_shape_path_changed(void *data, const Efl_Event *event EINA_UNUSED)
+EOLIAN static void
+_ector_renderer_software_shape_efl_gfx_path_commit(Eo *obj EINA_UNUSED,
+ Ector_Renderer_Software_Shape_Data *pd)
{
- Ector_Renderer_Software_Shape_Data *pd = data;
- Efl_Gfx_Path_Change_Event *ev = event->info;
-
- if (ev && !((ev->what & EFL_GFX_CHANGE_FLAG_MATRIX) ||
- (ev->what & EFL_GFX_CHANGE_FLAG_PATH)))
- return;
-
- if (pd->shape_data) ector_software_rasterizer_destroy_rle_data(pd->shape_data);
- if (pd->outline_data) ector_software_rasterizer_destroy_rle_data(pd->outline_data);
-
- pd->shape_data = NULL;
- pd->outline_data = NULL;
+ if (pd->shape_data)
+ {
+ ector_software_rasterizer_destroy_rle_data(pd->shape_data);
+ pd->shape_data = NULL;
+ }
+ if (pd->outline_data)
+ {
+ ector_software_rasterizer_destroy_rle_data(pd->outline_data);
+ pd->outline_data = NULL;
+ }
}
static Eo *
@@ -777,7 +761,6 @@ _ector_renderer_software_shape_efl_object_constructor(Eo *obj, Ector_Renderer_So
pd->public_shape = efl_data_xref(obj, EFL_GFX_SHAPE_MIXIN, obj);
pd->shape = efl_data_xref(obj, ECTOR_RENDERER_SHAPE_MIXIN, obj);
pd->base = efl_data_xref(obj, ECTOR_RENDERER_CLASS, obj);
- efl_event_callback_add(obj, EFL_GFX_PATH_EVENT_CHANGED, _ector_renderer_software_shape_path_changed, pd);
return obj;
}
diff --git a/src/lib/ector/software/ector_renderer_software_shape.eo b/src/lib/ector/software/ector_renderer_software_shape.eo
index abe8344f3f..04f19ba7e3 100644
--- a/src/lib/ector/software/ector_renderer_software_shape.eo
+++ b/src/lib/ector/software/ector_renderer_software_shape.eo
@@ -8,7 +8,7 @@ class Ector.Renderer.Software.Shape (Ector.Renderer.Software, Ector.Renderer.Sha
Ector.Renderer.Software.op_fill;
Ector.Renderer.mask { set; }
Ector.Renderer.crc { get; }
- Efl.Gfx.Path.path { set; }
+ Efl.Gfx.Path.commit;
Efl.Object.constructor;
Efl.Object.destructor;
}
diff --git a/src/lib/efl/interfaces/efl_gfx_path.c b/src/lib/efl/interfaces/efl_gfx_path.c
index 7278216647..c40d33a187 100644
--- a/src/lib/efl/interfaces/efl_gfx_path.c
+++ b/src/lib/efl/interfaces/efl_gfx_path.c
@@ -173,7 +173,6 @@ _efl_gfx_path_path_set(Eo *obj, Efl_Gfx_Path_Data *pd,
return;
}
- Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
Efl_Gfx_Path_Command *cmds;
double *pts;
unsigned int cmds_length = 0, pts_length = 0;
@@ -202,8 +201,6 @@ _efl_gfx_path_path_set(Eo *obj, Efl_Gfx_Path_Data *pd,
_efl_gfx_path_current_search(pd->commands, pd->points,
&pd->current.x, &pd->current.y,
&pd->current_ctrl.x, &pd->current_ctrl.y);
-
- efl_event_callback_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
}
EOLIAN static void
@@ -293,7 +290,6 @@ EOLIAN static Eina_Bool
_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Path_Data *pd,
const Eo *from, const Eo *to, double pos_map)
{
- Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
Efl_Gfx_Path_Data *from_pd, *to_pd;
Efl_Gfx_Path_Command *cmds;
double interv; //interpolated value
@@ -374,8 +370,6 @@ _efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Path_Data *pd,
}
- efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
-
return EINA_TRUE;
}
@@ -411,10 +405,8 @@ _efl_gfx_path_reserve(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
}
EOLIAN static void
-_efl_gfx_path_reset(Eo *obj, Efl_Gfx_Path_Data *pd)
+_efl_gfx_path_reset(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd)
{
- Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
-
free(pd->commands);
pd->reserved_cmd_cnt = 0;
pd->commands = NULL;
@@ -433,15 +425,13 @@ _efl_gfx_path_reset(Eo *obj, Efl_Gfx_Path_Data *pd)
pd->current_ctrl.x = 0;
pd->current_ctrl.y = 0;
pd->convex = EINA_FALSE;
-
- efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
}
EOLIAN static void
-_efl_gfx_path_append_move_to(Eo *obj, Efl_Gfx_Path_Data *pd,
- double x, double y)
+_efl_gfx_path_append_move_to(Eo *obj EINA_UNUSED,
+ Efl_Gfx_Path_Data *pd,
+ double x, double y)
{
- Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
double *offset_point;
if (!efl_gfx_path_grow(EFL_GFX_PATH_COMMAND_TYPE_MOVE_TO, pd, &offset_point))
@@ -452,15 +442,13 @@ _efl_gfx_path_append_move_to(Eo *obj, Efl_Gfx_Path_Data *pd,
pd->current.x = x;
pd->current.y = y;
-
- efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
}
EOLIAN static void
-_efl_gfx_path_append_line_to(Eo *obj, Efl_Gfx_Path_Data *pd,
- double x, double y)
+_efl_gfx_path_append_line_to(Eo *obj EINA_UNUSED,
+ Efl_Gfx_Path_Data *pd,
+ double x, double y)
{
- Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
double *offset_point;
if (!efl_gfx_path_grow(EFL_GFX_PATH_COMMAND_TYPE_LINE_TO, pd, &offset_point))
@@ -471,17 +459,15 @@ _efl_gfx_path_append_line_to(Eo *obj, Efl_Gfx_Path_Data *pd,
pd->current.x = x;
pd->current.y = y;
-
- efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
}
EOLIAN static void
-_efl_gfx_path_append_cubic_to(Eo *obj, Efl_Gfx_Path_Data *pd,
- double ctrl_x0, double ctrl_y0,
- double ctrl_x1, double ctrl_y1,
- double x, double y)
+_efl_gfx_path_append_cubic_to(Eo *obj EINA_UNUSED,
+ Efl_Gfx_Path_Data *pd,
+ double ctrl_x0, double ctrl_y0,
+ double ctrl_x1, double ctrl_y1,
+ double x, double y)
{
- Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
double *offset_point;
if (!efl_gfx_path_grow(EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO,
@@ -499,8 +485,6 @@ _efl_gfx_path_append_cubic_to(Eo *obj, Efl_Gfx_Path_Data *pd,
pd->current.y = y;
pd->current_ctrl.x = ctrl_x1;
pd->current_ctrl.y = ctrl_y1;
-
- efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
}
EOLIAN static void
@@ -1084,14 +1068,10 @@ _efl_gfx_path_append_arc(Eo *obj, Efl_Gfx_Path_Data *pd,
}
EOLIAN static void
-_efl_gfx_path_append_close(Eo *obj, Efl_Gfx_Path_Data *pd)
+_efl_gfx_path_append_close(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd)
{
- Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
double *offset_point;
-
efl_gfx_path_grow(EFL_GFX_PATH_COMMAND_TYPE_CLOSE, pd, &offset_point);
-
- efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
}
static void
@@ -1538,7 +1518,6 @@ error:
EOLIAN static void
_efl_gfx_path_copy_from(Eo *obj, Efl_Gfx_Path_Data *pd, const Eo *dup_from)
{
- Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
Efl_Gfx_Path_Data *from;
if (obj == dup_from) return;
@@ -1548,8 +1527,6 @@ _efl_gfx_path_copy_from(Eo *obj, Efl_Gfx_Path_Data *pd, const Eo *dup_from)
pd->convex = from->convex;
_efl_gfx_path_path_set(obj, pd, from->commands, from->points);
-
- efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
}
#include "interfaces/efl_gfx_path.eo.c"
diff --git a/src/lib/efl/interfaces/efl_gfx_path.eo b/src/lib/efl/interfaces/efl_gfx_path.eo
index c1ec7aacc4..d60886e499 100644
--- a/src/lib/efl/interfaces/efl_gfx_path.eo
+++ b/src/lib/efl/interfaces/efl_gfx_path.eo
@@ -292,8 +292,15 @@ mixin Efl.Gfx.Path
@in pts_count: uint; [[Pointers count to reserve]]
}
}
- }
- events {
- changed: Efl.Gfx.Path_Change_Event; [[Graphics path was changed.]]
+ commit @pure_virtual {
+ [[Request to update the path object.
+
+ One path object may get appending several path calls (such as
+ append_cubic, append_rect, etc) to construct the final path data.
+ Here commit means all path data is prepared and now object
+ could update its own internal status based on the last path
+ information.
+ ]]
+ }
}
}
diff --git a/src/lib/efl/interfaces/efl_gfx_shape.c b/src/lib/efl/interfaces/efl_gfx_shape.c
index a9327c354c..bdebbfaf27 100644
--- a/src/lib/efl/interfaces/efl_gfx_shape.c
+++ b/src/lib/efl/interfaces/efl_gfx_shape.c
@@ -161,10 +161,7 @@ _efl_gfx_shape_stroke_color_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *p
EOLIAN static void
_efl_gfx_shape_stroke_width_set(Eo *obj, Efl_Gfx_Shape_Data *pd, double w)
{
- Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
-
pd->public.stroke.width = w;
- efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
}
EOLIAN static double
diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c
index 192478e276..095c7a3891 100644
--- a/src/lib/elementary/efl_ui_textpath.c
+++ b/src/lib/elementary/efl_ui_textpath.c
@@ -544,17 +544,10 @@ _ellipsis_set(Efl_Ui_Textpath_Data *pd)
}
static void
-_path_changed_cb(void *data, const Efl_Event *event)
+_efl_ui_textpath_efl_gfx_path_commit(Eo *obj, Efl_Ui_Textpath_Data *pd)
{
- Efl_Gfx_Path_Change_Event *ev = event->info;
- EFL_UI_TEXTPATH_DATA_GET(data, sd);
-
- if (ev && !((ev->what & EFL_GFX_CHANGE_FLAG_MATRIX) ||
- (ev->what & EFL_GFX_CHANGE_FLAG_PATH)))
- return;
-
- _path_data_get(data, sd, EINA_TRUE);
- _sizing_eval(sd);
+ _path_data_get(obj, pd, EINA_TRUE);
+ _sizing_eval(pd);
}
static Eina_Bool
@@ -594,8 +587,6 @@ _efl_ui_textpath_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Textpath_Data *priv)
evas_object_smart_member_add(priv->text_obj, obj);
elm_widget_sub_object_add(obj, priv->text_obj);
-
- efl_event_callback_add(obj, EFL_GFX_PATH_EVENT_CHANGED, _path_changed_cb, obj);
}
EOLIAN static Efl_Object *
@@ -714,6 +705,7 @@ _efl_ui_textpath_circle_set(Eo *obj, Efl_Ui_Textpath_Data *pd, double x, double
radius * 2, start_angle, 360);
}
+ _path_data_get(obj, pd, EINA_TRUE);
_sizing_eval(pd);
}
diff --git a/src/lib/elementary/efl_ui_textpath.eo b/src/lib/elementary/efl_ui_textpath.eo
index 917621cc10..bc25a0bb4d 100644
--- a/src/lib/elementary/efl_ui_textpath.eo
+++ b/src/lib/elementary/efl_ui_textpath.eo
@@ -40,6 +40,7 @@ class Efl.Ui.Textpath (Efl.Ui.Layout, Efl.Text, Efl.Gfx.Path)
implements {
Efl.Object.constructor;
Efl.Object.destructor;
+ Efl.Gfx.Path.commit;
Efl.Canvas.Group.group_calculate;
Efl.Text.text {get; set;}
Efl.Part.part_get;
diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c
index 728afb5c4e..d1c41fa8aa 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_shape.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c
@@ -17,11 +17,6 @@ struct _Efl_Canvas_Vg_Shape_Data
};
// FIXME: Use the renderer bounding box when it has been created instead of an estimation
-static void
-_efl_canvas_vg_shape_path_changed(void *data, const Efl_Event *event)
-{
- efl_canvas_vg_node_change(event->object);
-}
static void
_efl_canvas_vg_shape_fill_set(Eo *obj EINA_UNUSED,
@@ -32,8 +27,6 @@ _efl_canvas_vg_shape_fill_set(Eo *obj EINA_UNUSED,
pd->fill = efl_ref(f);
efl_unref(tmp);
-
- efl_canvas_vg_node_change(obj);
}
static Efl_Canvas_Vg_Node *
@@ -51,8 +44,6 @@ _efl_canvas_vg_shape_stroke_fill_set(Eo *obj EINA_UNUSED,
pd->stroke.fill = efl_ref(f);
efl_unref(tmp);
-
- efl_canvas_vg_node_change(obj);
}
static Efl_Canvas_Vg_Node *
@@ -71,8 +62,6 @@ _efl_canvas_vg_shape_stroke_marker_set(Eo *obj EINA_UNUSED,
pd->stroke.marker = efl_ref(m);
efl_unref(tmp);
-
- efl_canvas_vg_node_change(obj);
}
static Efl_Canvas_Vg_Shape *
@@ -119,9 +108,9 @@ _efl_canvas_vg_shape_render_pre(Evas_Object_Protected_Data *vg_pd,
ector_renderer_shape_stroke_fill_set(nd->renderer, stroke_fill ? stroke_fill->renderer : NULL);
ector_renderer_shape_stroke_marker_set(nd->renderer, stroke_marker ? stroke_marker->renderer : NULL);
efl_gfx_path_copy_from(nd->renderer, obj);
+ efl_gfx_path_commit(nd->renderer);
ector_renderer_prepare(nd->renderer);
ector_renderer_mask_set(nd->renderer, mask, mask_op);
-
}
static Eo *
@@ -140,9 +129,6 @@ _efl_canvas_vg_shape_efl_object_constructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *p
nd->render_pre = _efl_canvas_vg_shape_render_pre;
nd->data = pd;
- efl_event_callback_add(obj, EFL_GFX_PATH_EVENT_CHANGED,
- _efl_canvas_vg_shape_path_changed, pd);
-
return obj;
}
@@ -153,9 +139,6 @@ _efl_canvas_vg_shape_efl_object_destructor(Eo *obj, Efl_Canvas_Vg_Shape_Data *pd
if (pd->stroke.fill) efl_unref(pd->stroke.fill);
if (pd->stroke.marker) efl_unref(pd->stroke.marker);
- efl_event_callback_del(obj, EFL_GFX_PATH_EVENT_CHANGED,
- _efl_canvas_vg_shape_path_changed, pd);
-
efl_gfx_path_reset(obj);
efl_destructor(efl_super(obj, MY_CLASS));
}
@@ -197,6 +180,12 @@ _efl_canvas_vg_shape_efl_gfx_path_interpolate(Eo *obj,
return r;
}
+EOLIAN static void
+_efl_canvas_vg_shape_efl_gfx_path_commit(Eo *obj,
+ Efl_Canvas_Vg_Shape_Data *pd EINA_UNUSED)
+{
+ efl_canvas_vg_node_change(obj);
+}
EOLIAN static Efl_Canvas_Vg_Node *
_efl_canvas_vg_shape_efl_duplicate_duplicate(const Eo *obj, Efl_Canvas_Vg_Shape_Data *pd)
@@ -241,6 +230,7 @@ EAPI void
evas_vg_shape_stroke_scale_set(Eo *obj, double s)
{
efl_gfx_shape_stroke_scale_set(obj, s);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
@@ -253,6 +243,7 @@ EAPI void
evas_vg_shape_stroke_color_set(Eo *obj, int r, int g, int b, int a)
{
efl_gfx_shape_stroke_color_set(obj, r, g, b, a);
+ efl_canvas_vg_node_change(obj);
}
EAPI double
@@ -265,6 +256,7 @@ EAPI void
evas_vg_shape_stroke_width_set(Eo *obj, double w)
{
efl_gfx_shape_stroke_width_set(obj, w);
+ efl_canvas_vg_node_change(obj);
}
EAPI double
@@ -277,6 +269,7 @@ EAPI void
evas_vg_shape_stroke_location_set(Eo *obj, double centered)
{
efl_gfx_shape_stroke_location_set(obj, centered);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
@@ -289,6 +282,7 @@ EAPI void
evas_vg_shape_stroke_dash_set(Eo *obj, const Efl_Gfx_Dash *dash, unsigned int length)
{
efl_gfx_shape_stroke_dash_set(obj, dash, length);
+ efl_canvas_vg_node_change(obj);
}
EAPI Efl_Gfx_Cap
@@ -301,6 +295,7 @@ EAPI void
evas_vg_shape_stroke_cap_set(Eo *obj, Efl_Gfx_Cap c)
{
efl_gfx_shape_stroke_cap_set(obj, c);
+ efl_canvas_vg_node_change(obj);
}
EAPI Efl_Gfx_Join
@@ -313,12 +308,14 @@ EAPI void
evas_vg_shape_stroke_join_set(Eo *obj, Efl_Gfx_Join j)
{
efl_gfx_shape_stroke_join_set(obj, j);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_path_set(Eo *obj, const Efl_Gfx_Path_Command *op, const double *points)
{
efl_gfx_path_set(obj, op, points);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
@@ -349,90 +346,106 @@ EAPI void
evas_vg_shape_dup(Eo *obj, Eo *dup_from)
{
efl_gfx_path_copy_from(obj, dup_from);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_reset(Eo *obj)
{
efl_gfx_path_reset(obj);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_move_to(Eo *obj, double x, double y)
{
efl_gfx_path_append_move_to(obj, x, y);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_line_to(Eo *obj, double x, double y)
{
efl_gfx_path_append_line_to(obj, x, y);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_quadratic_to(Eo *obj, double x, double y, double ctrl_x, double ctrl_y)
{
efl_gfx_path_append_quadratic_to(obj, x, y, ctrl_x, ctrl_y);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_squadratic_to(Eo *obj, double x, double y)
{
efl_gfx_path_append_squadratic_to(obj, x, y);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_cubic_to(Eo *obj, double x, double y, double ctrl_x0, double ctrl_y0, double ctrl_x1, double ctrl_y1)
{
efl_gfx_path_append_cubic_to(obj, x, y, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_scubic_to(Eo *obj, double x, double y, double ctrl_x, double ctrl_y)
{
efl_gfx_path_append_scubic_to(obj, x, y, ctrl_x, ctrl_y);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_arc_to(Eo *obj, double x, double y, double rx, double ry, double angle, Eina_Bool large_arc, Eina_Bool sweep)
{
efl_gfx_path_append_arc_to(obj, x, y, rx, ry, angle, large_arc, sweep);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_arc(Eo *obj, double x, double y, double w, double h, double start_angle, double sweep_length)
{
efl_gfx_path_append_arc(obj, x, y, w, h, start_angle, sweep_length);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_close(Eo *obj)
{
efl_gfx_path_append_close(obj);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_circle(Eo *obj, double x, double y, double radius)
{
efl_gfx_path_append_circle(obj, x, y, radius);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_rect(Eo *obj, double x, double y, double w, double h, double rx, double ry)
{
efl_gfx_path_append_rect(obj, x, y, w, h, rx, ry);
+ efl_canvas_vg_node_change(obj);
}
EAPI void
evas_vg_shape_append_svg_path(Eo *obj, const char *svg_path_data)
{
efl_gfx_path_append_svg_path(obj, svg_path_data);
+ efl_canvas_vg_node_change(obj);
}
EAPI Eina_Bool
evas_vg_shape_interpolate(Eo *obj, const Eo *from, const Eo *to, double pos_map)
{
- return efl_gfx_path_interpolate(obj, from, to, pos_map);
+ Eina_Bool ret = efl_gfx_path_interpolate(obj, from, to, pos_map);
+ efl_canvas_vg_node_change(obj);
+ return ret;
}
EAPI Eina_Bool
diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.eo b/src/lib/evas/canvas/efl_canvas_vg_shape.eo
index c51df0b9ea..2997071da0 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_shape.eo
+++ b/src/lib/evas/canvas/efl_canvas_vg_shape.eo
@@ -36,6 +36,7 @@ class Efl.Canvas.Vg.Shape (Efl.Canvas.Vg.Node, Efl.Gfx.Shape)
}
implements {
Efl.Gfx.Path.interpolate;
+ Efl.Gfx.Path.commit;
Efl.Duplicate.duplicate;
Efl.Object.constructor;
Efl.Object.destructor;