Commit Graph

55 Commits

Author SHA1 Message Date
Hermet Park 7c38c0c915 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
2018-12-26 19:29:10 +09:00
Hermet Park 6fbcfd5d84 efl interface: remove weired implementation.
This color interpolation should not a part of efl_gfx_shape.

Color should be interpolated by Vg.Node which implements Efl.Gfx.Color.
2018-06-14 20:23:51 +09:00
Hermet Park a7e4c67039 evas vg: fix broken morphing(interpolation)
efl_gfx_path itself took care of efl_gfx_shape data but its heirarchy was
conceptually wrong. Even efl_gfx_shape is mixing the efl_gfx_path...

Damend design...

Some of derived classes of efl_gfx_path (i.e. Vg.Node and Vg.Container) are
none of the Path acutally. They are just mixing Path's interpolation interface.

So, Here patch changes VG.Node to stop calling the super's interpolate method
and Vg.Shape to call both super -gfx_shape and vg_node- interpolate method.

@fix T6996
2018-06-14 20:02:15 +09:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Jean-Philippe Andre 1fdbb00e22 efl: Move VG-specific change event to efl.gfx.path 2017-12-13 13:47:48 +09:00
Amitesh Singh 5f3e0d62a4 Efl.Gfx.Shape: fix efl_super() call. 2017-11-30 16:23:19 +09:00
Amitesh Singh 77d730627e Efl.Gfx.Shape: add missing EOLIAN prefixes to eolian functions. 2017-11-30 16:09:37 +09:00
Amitesh Singh ad28bdfb5a Efl.Gfx.Shape: implement Gfx.Path.interpolate{}
This fixes the Eolian 'interpolate' redefine warning.
2017-11-30 16:09:37 +09:00
Jean-Philippe Andre bd5b76508b efl: Introduce interface Efl.Dup
A few classes allow their objects to be duplicated, so they should all
use the same interface.

Also, rename VG's dup to copy_from as it's not conforming to the
definition of dup.
2017-11-30 10:48:24 +09:00
smohanty cf927cdb34 efl/interface: emit path change event when stroke width change.
Reviewers: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4991
2017-06-29 17:39:09 +09:00
Hermet Park e0da83ce56 efl interface: introduce efl_gfx_path mixin.
As we discussed, redesigned efl_gfx_shape mixin.
Split path properties/methods from the shape so that other classes benefit from the path.
2016-11-23 17:36:57 +09:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Subhransu Mohanty 0023f20d85 efl/interface: fixed the shape interpolation implementation.
Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4188
2016-07-26 14:19:59 +09:00
Jean-Philippe Andre 9cf72fe80a gfx: Add NULL check to silence coverity
realloc() can return NULL if size is 0. It's like free().
So, the usage here is correct, and there are probably no
points to interpolate between anyway. I wonder if there
can be commands without points, though.

Fixes CID 1293004
2016-07-13 16:18:54 +09:00
Subhransu Mohanty 22f97be785 efl/interface: fixed scubic_to and quad_to implementation.
Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4063
2016-06-21 14:42:35 +09:00
Tom Hacohen f21ade6123 Automatic migration to Eo4.
I just ran my script (email to follow) to migrate all of the EFL
automatically. This commit is *only* the automatic conversion, so it can
be easily reverted and re-run.
2016-03-03 09:58:08 +00:00
Subhransu Mohanty 38902ef291 efl: change efl_gfx_shape_cubic_to() api signature to follow other API (cairo and freetype).
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 15:59:49 -08:00
Subhransu Mohanty e79dd4c161 efl: updated efl_gfx_shape_dup() implementation to use direct access to internal data.
As I don't see the use of inheritance for stroke anymore, we will use internal access
rather than inherited get/set function. This behavior can be reverted if anyone find
a real use case for it.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 15:52:25 -08:00
Subhransu Mohanty 71b2efe94d efl: add bookkeeping for convex shapes.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 15:51:43 -08:00
Subhransu Mohanty f6a1694181 efl: update append_rect implementation.
This now generate more optimized path by reducing the use of arc and
switching to only line whenever possible.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 15:49:06 -08:00
Subhransu Mohanty d5719aad9d efl: update append_circle implementation to use _efl_gfx_shape_append_arc.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 15:48:06 -08:00
Subhransu Mohanty 4a48a7e9ea efl: add alternative append_arc implementation
This allow to reduce the number of generated arc, but doesn't follow
SVG specification. This is just used internally and can't be used by
outside call.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-30 15:47:14 -08:00
Subhransu Mohanty b1b0679daa efl: added fill_rule property in efl_gfx_shape class
Open question, should fill rule be part of the public data ? Let's
say no for now.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-24 15:45:59 -08:00
Subhransu Mohanty 609f74994b efl: make path stroke related api as non virtual.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-11-24 15:42:29 -08:00
Cedric BAIL abe2110152 efl: quick code cleanup. 2015-11-24 15:00:18 -08:00
Cedric BAIL 7f28b3c263 efl: fix path parsing to actually check the value returned by strtol.
CID1328665
2015-10-22 16:57:24 -07:00
Cedric BAIL c6c84ffa6f efl: fix copy & paste typo while parsing SVG elliptical arc command.
@fix

CID 1328426
2015-10-21 11:33:40 -07:00
Subhransu Mohanty 84b6b4c040 efl/gfx: fix svg path parsing logic.
1. according to svg path specification, path string may or may not contain ',' as the separator
with current parsing logic we were expecting a ',' after each segment.
2. relative cubic bezier parsing was wrong as we were not adding the current value to all 4 points.
3. refactored the parse_pair, parse_six and parse_quad to use same helper function
path1: "M7.279,2h35.442C45.637,2,48,4.359,48,7.271v35.455C48,45.639,45.637,48,42.723,48H7.279C4.362,47.997,2,45.639,2,42.727V7.271C2,4.359,4.362,2,7.279,2z"
path2: "M-2.073-7h36.147C36.796-7,39-4.793,39-2.073v36.146C39,36.796,36.796,39,34.074,39H-2.073C-4.793,39-7,36.796-7,34.072V-2.073C-7-4.793-4.793-7-2.073-7z"

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-20 15:22:31 -07:00
Cedric BAIL 86b53cbefc efl: fix Efl.Gfx.Shape.Dup to use const parameter. 2015-08-21 16:40:32 +02:00
Cedric BAIL 1235426069 efl: prevent segv while interpolating empty shape. 2015-08-21 16:40:32 +02:00
Subhransu Mohanty 8d584dff34 efl: fix memory leak in efl_gfx_shape_interpolate().
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-03 16:38:15 +02:00
Subhransu Mohanty 2d74a4efb2 efl: fix svg path parsing to handle Z also.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-03 16:38:11 +02:00
Subhransu Mohanty 470d64c85e efl: update efl_gfx_shape interpolation to use fill color.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-03 16:38:10 +02:00
Cedric BAIL c44aa8f05d efl: all those function should have been static already. 2015-04-03 16:38:08 +02:00
Cedric BAIL 41a75f0b07 efl: follow Efl.VG naming by using bounds_get as an API name. 2015-04-03 16:38:08 +02:00
Cedric BAIL 30e2b8398e efl: add path bounding box computation.
This code does compute the largest possible bounding box not a minimal one.
2015-04-03 16:34:28 +02:00
Subhransu Mohanty 03c5e052e8 efl: simplify append_circle() api implementation.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-03 16:34:14 +02:00
Subhransu Sekhar Mohanty b1e663b368 efl: fix efl_gfx_append_rect to clamp radius to always fit inside of the rectangle.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-03 16:33:59 +02:00
Subhransu Sekhar Mohanty c1c6b7effc efl: force close of rect shape to prevent to avoid join showing with non rounded rectangle.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-03 16:33:58 +02:00
Cedric BAIL 105b375f68 efl: interpolate stroke also. 2015-04-03 16:33:51 +02:00
Cedric BAIL d14f805793 efl: notify when the path change.
This is an easier and safer way than forcing all object inheriting this class
to override all function that modify the path.
2015-04-03 16:33:38 +02:00
Cedric BAIL 4bdda2db5a efl: fix parsing of SVG path data. 2015-04-03 16:33:35 +02:00
Cedric BAIL 988b9cdcbc efl: make efl_gfx_shape_interpolate more resistant to bogus request. 2015-04-03 16:33:33 +02:00
Cedric BAIL d02bb67da0 efl: actually update command and points length. 2015-04-03 16:33:31 +02:00
Cedric BAIL bc7833e785 efl: fix rectangle shape to finish at the right position. 2015-04-03 16:33:28 +02:00
Jorge Luis Zapata Muga 8029e67c24 efl: use enesim/moonlight path normalizer.
This fix issue with rounded rectangle.
2015-04-03 16:33:22 +02:00
Cedric BAIL 983e80b2ad efl: correct Efl.Gfx.Shape.append_circle to follow SVG specification. 2015-04-03 16:31:54 +02:00
Cedric BAIL 9f8c35002b efl: add Efl.Gfx.Shape.append_rect following SVG specification.
SVG rectangle can have rounded corner.
2015-04-03 16:31:53 +02:00