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 Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7494
This commit is contained in:
parent
033d3031e6
commit
7c38c0c915
|
@ -75,19 +75,15 @@ struct _Ector_Renderer_Cairo_Shape_Data
|
||||||
cairo_path_t *path;
|
cairo_path_t *path;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
EOLIAN static void
|
||||||
_ector_renderer_cairo_shape_path_changed(void *data, const Efl_Event *event)
|
_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;
|
if (pd->path)
|
||||||
Efl_Gfx_Path_Change_Event *ev = event->info;
|
{
|
||||||
|
cairo_path_destroy(pd->path);
|
||||||
if (!pd->path) return;
|
pd->path = NULL;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
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->shape = efl_data_xref(obj, ECTOR_RENDERER_SHAPE_MIXIN, obj);
|
||||||
pd->base = efl_data_xref(obj, ECTOR_RENDERER_CLASS, 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 *
|
static Efl_Object *
|
||||||
|
|
|
@ -6,6 +6,7 @@ class Ector.Renderer.Cairo.Shape (Ector.Renderer.Cairo, Ector.Renderer.Shape, Ef
|
||||||
Ector.Renderer.prepare;
|
Ector.Renderer.prepare;
|
||||||
Ector.Renderer.draw;
|
Ector.Renderer.draw;
|
||||||
Efl.Gfx.Path.bounds_get;
|
Efl.Gfx.Path.bounds_get;
|
||||||
|
Efl.Gfx.Path.commit;
|
||||||
Ector.Renderer.crc { get; }
|
Ector.Renderer.crc { get; }
|
||||||
Ector.Renderer.Cairo.op_fill;
|
Ector.Renderer.Cairo.op_fill;
|
||||||
Efl.Object.constructor;
|
Efl.Object.constructor;
|
||||||
|
|
|
@ -20,18 +20,15 @@ struct _Ector_Renderer_GL_Shape_Data
|
||||||
GLshort *vertex;
|
GLshort *vertex;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
EOLIAN static void
|
||||||
_ector_renderer_gl_shape_path_changed(void *data, const Efl_Event *event EINA_UNUSED)
|
_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;
|
if (pd->vertex)
|
||||||
Efl_Gfx_Path_Change_Event *ev = event->info;
|
{
|
||||||
|
free(pd->vertex);
|
||||||
if (ev && !((ev->what & EFL_GFX_CHANGE_FLAG_MATRIX) ||
|
pd->vertex = NULL;
|
||||||
(ev->what & EFL_GFX_CHANGE_FLAG_PATH)))
|
}
|
||||||
return;
|
|
||||||
|
|
||||||
free(pd->vertex);
|
|
||||||
pd->vertex = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
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->shape = efl_data_xref(obj, ECTOR_RENDERER_SHAPE_MIXIN, obj);
|
||||||
pd->base = efl_data_xref(obj, ECTOR_RENDERER_CLASS, 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;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ class Ector.Renderer.GL.Shape (Ector.Renderer.GL, Ector.Renderer.Shape, Efl.Gfx.
|
||||||
Ector.Renderer.crc { get; }
|
Ector.Renderer.crc { get; }
|
||||||
Ector.Renderer.GL.op_fill;
|
Ector.Renderer.GL.op_fill;
|
||||||
Efl.Gfx.Path.bounds_get;
|
Efl.Gfx.Path.bounds_get;
|
||||||
|
Efl.Gfx.Path.commit;
|
||||||
Efl.Object.constructor;
|
Efl.Object.constructor;
|
||||||
Efl.Object.destructor;
|
Efl.Object.destructor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -734,36 +734,20 @@ _ector_renderer_software_shape_ector_renderer_software_op_fill(Eo *obj EINA_UNUS
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
EOLIAN static void
|
||||||
_ector_renderer_software_shape_efl_gfx_path_path_set(Eo *obj,
|
_ector_renderer_software_shape_efl_gfx_path_commit(Eo *obj EINA_UNUSED,
|
||||||
Ector_Renderer_Software_Shape_Data *pd,
|
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->shape_data)
|
||||||
if (pd->outline_data) ector_software_rasterizer_destroy_rle_data(pd->outline_data);
|
{
|
||||||
pd->shape_data = NULL;
|
ector_software_rasterizer_destroy_rle_data(pd->shape_data);
|
||||||
pd->outline_data = NULL;
|
pd->shape_data = NULL;
|
||||||
|
}
|
||||||
efl_gfx_path_set(efl_super(obj, MY_CLASS), op, points);
|
if (pd->outline_data)
|
||||||
}
|
{
|
||||||
|
ector_software_rasterizer_destroy_rle_data(pd->outline_data);
|
||||||
|
pd->outline_data = NULL;
|
||||||
static void
|
}
|
||||||
_ector_renderer_software_shape_path_changed(void *data, const Efl_Event *event EINA_UNUSED)
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eo *
|
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->public_shape = efl_data_xref(obj, EFL_GFX_SHAPE_MIXIN, obj);
|
||||||
pd->shape = efl_data_xref(obj, ECTOR_RENDERER_SHAPE_MIXIN, obj);
|
pd->shape = efl_data_xref(obj, ECTOR_RENDERER_SHAPE_MIXIN, obj);
|
||||||
pd->base = efl_data_xref(obj, ECTOR_RENDERER_CLASS, 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;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ class Ector.Renderer.Software.Shape (Ector.Renderer.Software, Ector.Renderer.Sha
|
||||||
Ector.Renderer.Software.op_fill;
|
Ector.Renderer.Software.op_fill;
|
||||||
Ector.Renderer.mask { set; }
|
Ector.Renderer.mask { set; }
|
||||||
Ector.Renderer.crc { get; }
|
Ector.Renderer.crc { get; }
|
||||||
Efl.Gfx.Path.path { set; }
|
Efl.Gfx.Path.commit;
|
||||||
Efl.Object.constructor;
|
Efl.Object.constructor;
|
||||||
Efl.Object.destructor;
|
Efl.Object.destructor;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,6 @@ _efl_gfx_path_path_set(Eo *obj, Efl_Gfx_Path_Data *pd,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
|
|
||||||
Efl_Gfx_Path_Command *cmds;
|
Efl_Gfx_Path_Command *cmds;
|
||||||
double *pts;
|
double *pts;
|
||||||
unsigned int cmds_length = 0, pts_length = 0;
|
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,
|
_efl_gfx_path_current_search(pd->commands, pd->points,
|
||||||
&pd->current.x, &pd->current.y,
|
&pd->current.x, &pd->current.y,
|
||||||
&pd->current_ctrl.x, &pd->current_ctrl.y);
|
&pd->current_ctrl.x, &pd->current_ctrl.y);
|
||||||
|
|
||||||
efl_event_callback_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
|
@ -293,7 +290,6 @@ EOLIAN static Eina_Bool
|
||||||
_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Path_Data *pd,
|
_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Path_Data *pd,
|
||||||
const Eo *from, const Eo *to, double pos_map)
|
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_Data *from_pd, *to_pd;
|
||||||
Efl_Gfx_Path_Command *cmds;
|
Efl_Gfx_Path_Command *cmds;
|
||||||
double interv; //interpolated value
|
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;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -411,10 +405,8 @@ _efl_gfx_path_reserve(Eo *obj EINA_UNUSED, Efl_Gfx_Path_Data *pd,
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
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);
|
free(pd->commands);
|
||||||
pd->reserved_cmd_cnt = 0;
|
pd->reserved_cmd_cnt = 0;
|
||||||
pd->commands = NULL;
|
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.x = 0;
|
||||||
pd->current_ctrl.y = 0;
|
pd->current_ctrl.y = 0;
|
||||||
pd->convex = EINA_FALSE;
|
pd->convex = EINA_FALSE;
|
||||||
|
|
||||||
efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_gfx_path_append_move_to(Eo *obj, Efl_Gfx_Path_Data *pd,
|
_efl_gfx_path_append_move_to(Eo *obj EINA_UNUSED,
|
||||||
double x, double y)
|
Efl_Gfx_Path_Data *pd,
|
||||||
|
double x, double y)
|
||||||
{
|
{
|
||||||
Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
|
|
||||||
double *offset_point;
|
double *offset_point;
|
||||||
|
|
||||||
if (!efl_gfx_path_grow(EFL_GFX_PATH_COMMAND_TYPE_MOVE_TO, pd, &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.x = x;
|
||||||
pd->current.y = y;
|
pd->current.y = y;
|
||||||
|
|
||||||
efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_gfx_path_append_line_to(Eo *obj, Efl_Gfx_Path_Data *pd,
|
_efl_gfx_path_append_line_to(Eo *obj EINA_UNUSED,
|
||||||
double x, double y)
|
Efl_Gfx_Path_Data *pd,
|
||||||
|
double x, double y)
|
||||||
{
|
{
|
||||||
Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
|
|
||||||
double *offset_point;
|
double *offset_point;
|
||||||
|
|
||||||
if (!efl_gfx_path_grow(EFL_GFX_PATH_COMMAND_TYPE_LINE_TO, pd, &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.x = x;
|
||||||
pd->current.y = y;
|
pd->current.y = y;
|
||||||
|
|
||||||
efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_gfx_path_append_cubic_to(Eo *obj, Efl_Gfx_Path_Data *pd,
|
_efl_gfx_path_append_cubic_to(Eo *obj EINA_UNUSED,
|
||||||
double ctrl_x0, double ctrl_y0,
|
Efl_Gfx_Path_Data *pd,
|
||||||
double ctrl_x1, double ctrl_y1,
|
double ctrl_x0, double ctrl_y0,
|
||||||
double x, double y)
|
double ctrl_x1, double ctrl_y1,
|
||||||
|
double x, double y)
|
||||||
{
|
{
|
||||||
Efl_Gfx_Path_Change_Event ev = { EFL_GFX_CHANGE_FLAG_PATH };
|
|
||||||
double *offset_point;
|
double *offset_point;
|
||||||
|
|
||||||
if (!efl_gfx_path_grow(EFL_GFX_PATH_COMMAND_TYPE_CUBIC_TO,
|
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.y = y;
|
||||||
pd->current_ctrl.x = ctrl_x1;
|
pd->current_ctrl.x = ctrl_x1;
|
||||||
pd->current_ctrl.y = ctrl_y1;
|
pd->current_ctrl.y = ctrl_y1;
|
||||||
|
|
||||||
efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
|
@ -1084,14 +1068,10 @@ _efl_gfx_path_append_arc(Eo *obj, Efl_Gfx_Path_Data *pd,
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static void
|
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;
|
double *offset_point;
|
||||||
|
|
||||||
efl_gfx_path_grow(EFL_GFX_PATH_COMMAND_TYPE_CLOSE, pd, &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
|
static void
|
||||||
|
@ -1538,7 +1518,6 @@ error:
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_gfx_path_copy_from(Eo *obj, Efl_Gfx_Path_Data *pd, const Eo *dup_from)
|
_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;
|
Efl_Gfx_Path_Data *from;
|
||||||
|
|
||||||
if (obj == dup_from) return;
|
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;
|
pd->convex = from->convex;
|
||||||
|
|
||||||
_efl_gfx_path_path_set(obj, pd, from->commands, from->points);
|
_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"
|
#include "interfaces/efl_gfx_path.eo.c"
|
||||||
|
|
|
@ -292,8 +292,15 @@ mixin Efl.Gfx.Path
|
||||||
@in pts_count: uint; [[Pointers count to reserve]]
|
@in pts_count: uint; [[Pointers count to reserve]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
commit @pure_virtual {
|
||||||
events {
|
[[Request to update the path object.
|
||||||
changed: Efl.Gfx.Path_Change_Event; [[Graphics path was changed.]]
|
|
||||||
|
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.
|
||||||
|
]]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,10 +161,7 @@ _efl_gfx_shape_stroke_color_get(const Eo *obj EINA_UNUSED, Efl_Gfx_Shape_Data *p
|
||||||
EOLIAN static void
|
EOLIAN static void
|
||||||
_efl_gfx_shape_stroke_width_set(Eo *obj, Efl_Gfx_Shape_Data *pd, double w)
|
_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;
|
pd->public.stroke.width = w;
|
||||||
efl_event_callback_legacy_call(obj, EFL_GFX_PATH_EVENT_CHANGED, &ev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static double
|
EOLIAN static double
|
||||||
|
|
|
@ -544,17 +544,10 @@ _ellipsis_set(Efl_Ui_Textpath_Data *pd)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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;
|
_path_data_get(obj, pd, EINA_TRUE);
|
||||||
EFL_UI_TEXTPATH_DATA_GET(data, sd);
|
_sizing_eval(pd);
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
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);
|
evas_object_smart_member_add(priv->text_obj, obj);
|
||||||
elm_widget_sub_object_add(obj, priv->text_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 *
|
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);
|
radius * 2, start_angle, 360);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_path_data_get(obj, pd, EINA_TRUE);
|
||||||
_sizing_eval(pd);
|
_sizing_eval(pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ class Efl.Ui.Textpath (Efl.Ui.Layout, Efl.Text, Efl.Gfx.Path)
|
||||||
implements {
|
implements {
|
||||||
Efl.Object.constructor;
|
Efl.Object.constructor;
|
||||||
Efl.Object.destructor;
|
Efl.Object.destructor;
|
||||||
|
Efl.Gfx.Path.commit;
|
||||||
Efl.Canvas.Group.group_calculate;
|
Efl.Canvas.Group.group_calculate;
|
||||||
Efl.Text.text {get; set;}
|
Efl.Text.text {get; set;}
|
||||||
Efl.Part.part_get;
|
Efl.Part.part_get;
|
||||||
|
|
|
@ -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
|
// 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
|
static void
|
||||||
_efl_canvas_vg_shape_fill_set(Eo *obj EINA_UNUSED,
|
_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);
|
pd->fill = efl_ref(f);
|
||||||
efl_unref(tmp);
|
efl_unref(tmp);
|
||||||
|
|
||||||
efl_canvas_vg_node_change(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Efl_Canvas_Vg_Node *
|
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);
|
pd->stroke.fill = efl_ref(f);
|
||||||
efl_unref(tmp);
|
efl_unref(tmp);
|
||||||
|
|
||||||
efl_canvas_vg_node_change(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Efl_Canvas_Vg_Node *
|
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);
|
pd->stroke.marker = efl_ref(m);
|
||||||
efl_unref(tmp);
|
efl_unref(tmp);
|
||||||
|
|
||||||
efl_canvas_vg_node_change(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Efl_Canvas_Vg_Shape *
|
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_fill_set(nd->renderer, stroke_fill ? stroke_fill->renderer : NULL);
|
||||||
ector_renderer_shape_stroke_marker_set(nd->renderer, stroke_marker ? stroke_marker->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_copy_from(nd->renderer, obj);
|
||||||
|
efl_gfx_path_commit(nd->renderer);
|
||||||
ector_renderer_prepare(nd->renderer);
|
ector_renderer_prepare(nd->renderer);
|
||||||
ector_renderer_mask_set(nd->renderer, mask, mask_op);
|
ector_renderer_mask_set(nd->renderer, mask, mask_op);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eo *
|
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->render_pre = _efl_canvas_vg_shape_render_pre;
|
||||||
nd->data = pd;
|
nd->data = pd;
|
||||||
|
|
||||||
efl_event_callback_add(obj, EFL_GFX_PATH_EVENT_CHANGED,
|
|
||||||
_efl_canvas_vg_shape_path_changed, pd);
|
|
||||||
|
|
||||||
return obj;
|
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.fill) efl_unref(pd->stroke.fill);
|
||||||
if (pd->stroke.marker) efl_unref(pd->stroke.marker);
|
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_gfx_path_reset(obj);
|
||||||
efl_destructor(efl_super(obj, MY_CLASS));
|
efl_destructor(efl_super(obj, MY_CLASS));
|
||||||
}
|
}
|
||||||
|
@ -197,6 +180,12 @@ _efl_canvas_vg_shape_efl_gfx_path_interpolate(Eo *obj,
|
||||||
return r;
|
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 *
|
EOLIAN static Efl_Canvas_Vg_Node *
|
||||||
_efl_canvas_vg_shape_efl_duplicate_duplicate(const Eo *obj, Efl_Canvas_Vg_Shape_Data *pd)
|
_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)
|
evas_vg_shape_stroke_scale_set(Eo *obj, double s)
|
||||||
{
|
{
|
||||||
efl_gfx_shape_stroke_scale_set(obj, s);
|
efl_gfx_shape_stroke_scale_set(obj, s);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -253,6 +243,7 @@ EAPI void
|
||||||
evas_vg_shape_stroke_color_set(Eo *obj, int r, int g, int b, int a)
|
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_gfx_shape_stroke_color_set(obj, r, g, b, a);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI double
|
EAPI double
|
||||||
|
@ -265,6 +256,7 @@ EAPI void
|
||||||
evas_vg_shape_stroke_width_set(Eo *obj, double w)
|
evas_vg_shape_stroke_width_set(Eo *obj, double w)
|
||||||
{
|
{
|
||||||
efl_gfx_shape_stroke_width_set(obj, w);
|
efl_gfx_shape_stroke_width_set(obj, w);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI double
|
EAPI double
|
||||||
|
@ -277,6 +269,7 @@ EAPI void
|
||||||
evas_vg_shape_stroke_location_set(Eo *obj, double centered)
|
evas_vg_shape_stroke_location_set(Eo *obj, double centered)
|
||||||
{
|
{
|
||||||
efl_gfx_shape_stroke_location_set(obj, centered);
|
efl_gfx_shape_stroke_location_set(obj, centered);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -289,6 +282,7 @@ EAPI void
|
||||||
evas_vg_shape_stroke_dash_set(Eo *obj, const Efl_Gfx_Dash *dash, unsigned int length)
|
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_gfx_shape_stroke_dash_set(obj, dash, length);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Efl_Gfx_Cap
|
EAPI Efl_Gfx_Cap
|
||||||
|
@ -301,6 +295,7 @@ EAPI void
|
||||||
evas_vg_shape_stroke_cap_set(Eo *obj, Efl_Gfx_Cap c)
|
evas_vg_shape_stroke_cap_set(Eo *obj, Efl_Gfx_Cap c)
|
||||||
{
|
{
|
||||||
efl_gfx_shape_stroke_cap_set(obj, c);
|
efl_gfx_shape_stroke_cap_set(obj, c);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Efl_Gfx_Join
|
EAPI Efl_Gfx_Join
|
||||||
|
@ -313,12 +308,14 @@ EAPI void
|
||||||
evas_vg_shape_stroke_join_set(Eo *obj, Efl_Gfx_Join j)
|
evas_vg_shape_stroke_join_set(Eo *obj, Efl_Gfx_Join j)
|
||||||
{
|
{
|
||||||
efl_gfx_shape_stroke_join_set(obj, j);
|
efl_gfx_shape_stroke_join_set(obj, j);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_path_set(Eo *obj, const Efl_Gfx_Path_Command *op, const double *points)
|
evas_vg_shape_path_set(Eo *obj, const Efl_Gfx_Path_Command *op, const double *points)
|
||||||
{
|
{
|
||||||
efl_gfx_path_set(obj, op, points);
|
efl_gfx_path_set(obj, op, points);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -349,90 +346,106 @@ EAPI void
|
||||||
evas_vg_shape_dup(Eo *obj, Eo *dup_from)
|
evas_vg_shape_dup(Eo *obj, Eo *dup_from)
|
||||||
{
|
{
|
||||||
efl_gfx_path_copy_from(obj, dup_from);
|
efl_gfx_path_copy_from(obj, dup_from);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_reset(Eo *obj)
|
evas_vg_shape_reset(Eo *obj)
|
||||||
{
|
{
|
||||||
efl_gfx_path_reset(obj);
|
efl_gfx_path_reset(obj);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_move_to(Eo *obj, double x, double y)
|
evas_vg_shape_append_move_to(Eo *obj, double x, double y)
|
||||||
{
|
{
|
||||||
efl_gfx_path_append_move_to(obj, x, y);
|
efl_gfx_path_append_move_to(obj, x, y);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_line_to(Eo *obj, double x, double y)
|
evas_vg_shape_append_line_to(Eo *obj, double x, double y)
|
||||||
{
|
{
|
||||||
efl_gfx_path_append_line_to(obj, x, y);
|
efl_gfx_path_append_line_to(obj, x, y);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_quadratic_to(Eo *obj, double x, double y, double ctrl_x, double ctrl_y)
|
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_gfx_path_append_quadratic_to(obj, x, y, ctrl_x, ctrl_y);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_squadratic_to(Eo *obj, double x, double y)
|
evas_vg_shape_append_squadratic_to(Eo *obj, double x, double y)
|
||||||
{
|
{
|
||||||
efl_gfx_path_append_squadratic_to(obj, x, y);
|
efl_gfx_path_append_squadratic_to(obj, x, y);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
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)
|
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_gfx_path_append_cubic_to(obj, x, y, ctrl_x0, ctrl_y0, ctrl_x1, ctrl_y1);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_scubic_to(Eo *obj, double x, double y, double ctrl_x, double ctrl_y)
|
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_gfx_path_append_scubic_to(obj, x, y, ctrl_x, ctrl_y);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
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)
|
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_gfx_path_append_arc_to(obj, x, y, rx, ry, angle, large_arc, sweep);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_arc(Eo *obj, double x, double y, double w, double h, double start_angle, double sweep_length)
|
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_gfx_path_append_arc(obj, x, y, w, h, start_angle, sweep_length);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_close(Eo *obj)
|
evas_vg_shape_append_close(Eo *obj)
|
||||||
{
|
{
|
||||||
efl_gfx_path_append_close(obj);
|
efl_gfx_path_append_close(obj);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_circle(Eo *obj, double x, double y, double radius)
|
evas_vg_shape_append_circle(Eo *obj, double x, double y, double radius)
|
||||||
{
|
{
|
||||||
efl_gfx_path_append_circle(obj, x, y, radius);
|
efl_gfx_path_append_circle(obj, x, y, radius);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_rect(Eo *obj, double x, double y, double w, double h, double rx, double ry)
|
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_gfx_path_append_rect(obj, x, y, w, h, rx, ry);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
evas_vg_shape_append_svg_path(Eo *obj, const char *svg_path_data)
|
evas_vg_shape_append_svg_path(Eo *obj, const char *svg_path_data)
|
||||||
{
|
{
|
||||||
efl_gfx_path_append_svg_path(obj, svg_path_data);
|
efl_gfx_path_append_svg_path(obj, svg_path_data);
|
||||||
|
efl_canvas_vg_node_change(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
evas_vg_shape_interpolate(Eo *obj, const Eo *from, const Eo *to, double pos_map)
|
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
|
EAPI Eina_Bool
|
||||||
|
|
|
@ -36,6 +36,7 @@ class Efl.Canvas.Vg.Shape (Efl.Canvas.Vg.Node, Efl.Gfx.Shape)
|
||||||
}
|
}
|
||||||
implements {
|
implements {
|
||||||
Efl.Gfx.Path.interpolate;
|
Efl.Gfx.Path.interpolate;
|
||||||
|
Efl.Gfx.Path.commit;
|
||||||
Efl.Duplicate.duplicate;
|
Efl.Duplicate.duplicate;
|
||||||
Efl.Object.constructor;
|
Efl.Object.constructor;
|
||||||
Efl.Object.destructor;
|
Efl.Object.destructor;
|
||||||
|
|
Loading…
Reference in New Issue