Commit Graph

171 Commits

Author SHA1 Message Date
Hermet Park f247a55b50 vector json: fix a ordering issue of stroke.
for optimization, we created a shape node in a lazy way,
This introduced corrupted layering order issue.

We fix it by keeping the object creation order.

Layzing creation is just for an ideal case,
It doesn't verified the performance.
2019-10-17 17:54:02 +09:00
Hermet Park 0e675e5cf1 vector json: optimize logic.
if a layer is full transparent, skip it further processing.
2019-10-17 17:01:33 +09:00
Mike Blumenkrantz 345dbe26b7 lz4: fix potential div by zero
Summary:
LZ4F_getBlockSize() can return 0

CID 1404010

Reviewers: lauromoura

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10392
2019-10-15 11:21:50 -03:00
junsu choi 74e2c80b6e vg_common_svg: Support opacity attribute of <g> element
Summary:
The <g> element can have an opacity.
Therefore, if node type is SVG_NODE_G, set color.

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10371
2019-10-15 14:53:25 +09:00
junsu choi 4510b46d05 vg_common_json: Apply image's alpha color
Summary:
This patch needs latest rlottie that contain below commit.
c3ab82ec2c

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10368
2019-10-14 17:45:17 +09:00
junsu choi 779bd0539e vg_common_json: Override value_provider list
Summary:
If value_provider is applied to Efl.Ui.Animation_View, it is passed as vector object.
The passed value_provider list passes to Vg_File_Data.
If there is a value_Provider list in Vg_File_Data,
it apply the property to Lottie_Animation using lottie_animation_property_override api.

Depends on D9874

Test Plan:
...

Eo *vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, p);
efl_gfx_vg_value_provider_keypath_set(vp, "**");
efl_gfx_vg_value_provider_fill_color_set(vp, 100, 0 ,0 ,255);
efl_ui_animation_view_value_provider_override(anim_view, vp);

vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, p);
efl_gfx_vg_value_provider_keypath_set(vp, "**");
efl_gfx_vg_value_provider_stroke_width_set(vp, 50.0);
efl_gfx_vg_value_provider_stroke_color_set(vp, 0, 255, 0, 100);
efl_ui_animation_view_value_provider_override(anim_view, vp);
...

Reviewers: Hermet, kimcinoo, smohanty

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9897
2019-10-02 14:30:06 +09:00
Hermet Park 44d362e1ef evas vg: fix gradient stroke fill memory leaks.
There were continous creation of gradient objects,
We can stop it by caching it properly,

Also, fix mismatched ref/unref counts.
2019-09-24 11:49:10 +09:00
Hermet Park 690dd5d33a ector: code refactoring.
Current vector drawing requires several methods for compositing,
it's shouldnt have only masking but other blending functions
such as matte in lottie, porter&duff in android, etc.

Previously we didn't specify this method name,
just reserved the options and now we started to define the methods
with ector_renderer_composite_method() with Efl.Gfx.VG_Composite_Method
instead of mask_set().
2019-09-06 17:56:02 +09:00
junsu choi 405822a314 vg_common_svg : Initialize "display" attribute
Summary:
In e850e3e, the code to initialize this property is missing.
That makes the object invisible when printing svg through edje.
This is a patch to fix it.
@fix

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9833
2019-09-04 12:08:56 +09:00
junsu choi 9e3aabe43b freetype: Prevent lose of data when fixed point divide calculation.
Summary:
In environments that long is 4byte, fixed-point division calculations will cause data loss.
fixed-point division need to more space.
Therefore, change all long types to long long types.

Test Plan: N/A

Reviewers: Hermet, kimcinoo, smohanty

Reviewed By: Hermet

Subscribers: vtorri, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9817
2019-09-04 12:07:09 +09:00
junsu choi a569a4eb27 vg_common_json: Support stroke miterlimit
Summary:
Apply miterlimit received from the node to vg_shape.

Depends D9657
        D9665

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9666
2019-08-22 12:51:53 +09:00
junsu choi e850e3e5dc evas_vg_load_svg: Support "display" attribute.
Summary:
If the display attribute is "none", VG object is not show.
The default is "inline" which means visible and "none" means invisible.

Depending on the type of node, additional functionality may be required.
refer to https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/display

Test Plan:
[SVG]
<svg viewBox="0 0 220 100" xmlns="http://www.w3.org/2000/svg">
  <!-- Here the yellow rectangle is displayed -->
  <g display="none">
    <rect x="0" y="0" width="100" height="100" fill="skyblue"></rect>
  </g>
  <rect x="20" y="20" width="60" height="60" fill="yellow"></rect>

  <!-- Here the yellow rectangle is not displayed -->
  <rect x="120" y="0" width="100" height="100" fill="skyblue"></rect>
  <rect x="140" y="20" width="60" height="60" fill="yellow" display="none"></rect>
</svg>

[C CODE]
int main(int argc, char **argv)
{
   setenv("ECTOR_BACKEND", "default", 1);
   elm_init(argc, argv);

   Evas_Object *win = elm_win_util_standard_add(NULL, "test");
   evas_object_smart_callback_add(win, "delete,request", win_del, 0);
   elm_win_autodel_set(win, 1);

   Evas *evas = evas_object_evas_get(win);

   Evas_Object *vg = evas_object_vg_add(evas);
   evas_object_show(vg);
   Evas_Object *container = evas_vg_container_add(vg);
   evas_object_vg_root_node_set(vg, container);

   Evas_Object *svg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, container);
   efl_file_simple_load(svg, "./test.svg", NULL);
   efl_gfx_entity_size_set(svg, EINA_SIZE2D(600, 600));
   efl_gfx_entity_visible_set(svg, EINA_TRUE);
   evas_object_size_hint_weight_set(svg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(svg, EVAS_HINT_FILL, EVAS_HINT_FILL);

   elm_win_resize_object_add(win, vg);
   evas_object_resize(win, WIDTH, HEIGHT);
   evas_object_show(win);
   elm_run();
   elm_shutdown();
   return 0;
}

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9640
2019-08-20 20:32:15 +09:00
Hermet Park b0737c7434 Revert "ector: code refactoring."
This reverts commit dad166f84a.

Ector is not public, this breaks enlightenment compilation,
2019-08-20 20:24:27 +09:00
Hermet Park dad166f84a ector: code refactoring.
Current vector drawing requires several methods for compositing,
it's shouldnt have only masking but other blending functions
such as matte in lottie, porter&duff in android, etc.

Previously we didn't specify this method name,
just reserved the options and now we started to define the methods
with ector_renderer_composite_method() instead of mask_set().
2019-08-20 18:23:41 +09:00
Hermet Park 5c39e68d2b canvas svg: fix to apply premultipled color.
fill colors should be premultiplied with fill opcaity.
2019-08-20 11:25:44 +09:00
junsu choi 8f440cdedc vg_common_svg: Apply node opacity to stroke color
Summary:
  When an object to be converted to a stroke or
  path uses "opacity" attribute, opacity is also applied.

Test Plan:
[SVG]
<?xml version="1.0" encoding="UTF-8"?>
<svg width="40px" height="40px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 52.6 (67491) - http://www.bohemiancoding.com/sketch -->
        <rect fill="#FF0000" opacity="0" x="0" y="0" width="40" height="40"></rect>
        <path d="M12,20 L25,8 L12,20 Z M12,20 L25,32 L12,20 Z"
              id="Combined-Shape"
              stroke="#FFFFFF"
              stroke-width="2"
              opacity="0.12"
              stroke-linecap="round"
              stroke-linejoin="round" fill-rule="nonzero"></path>
</svg>

[Code]
int main(int argc, char **argv)
{
   setenv("ECTOR_BACKEND", "default", 1);
   elm_init(argc, argv);

   Evas_Object *win = elm_win_util_standard_add(NULL, "test");
   evas_object_smart_callback_add(win, "delete,request", win_del, 0);
   elm_win_autodel_set(win, 1);

   Evas *evas = evas_object_evas_get(win);
   Evas_Object *vg = evas_object_vg_add(evas);
   evas_object_show(vg);
   Evas_Object *container = evas_vg_container_add(vg);
   evas_object_vg_root_node_set(vg, container);

   Evas_Object *svg = efl_add(EFL_CANVAS_VG_OBJECT_CLASS, container);
   efl_file_simple_load(svg, "./i_arrow_l_disable.svg", NULL);
   efl_gfx_entity_size_set(svg, EINA_SIZE2D(600, 600));
   efl_gfx_entity_visible_set(svg, EINA_TRUE);
   evas_object_size_hint_weight_set(svg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_size_hint_align_set(svg, EVAS_HINT_FILL, EVAS_HINT_FILL);

   elm_win_resize_object_add(win, vg);
   evas_object_resize(win, 600, 600);
   evas_object_show(win);
   elm_run();
   elm_shutdown();

   return 0;
}

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9620
2019-08-19 19:46:02 +09:00
Carsten Haitzler 98e80725a3 lz4 - update to 1.9.1 for static lib in src tree
this updates our static zlib to 1.9.1 releases april 23, 2019.

fixes T7983
2019-08-07 11:31:03 +01:00
Hermet Park 8650c7d09d vg json: update missing change in 16d806ff92. 2019-08-05 21:09:14 +09:00
Hermet Park 16d806ff92 vg json: up to date internal reference.
rlottie is not officially released, still it's unstable.
2019-08-05 20:42:26 +09:00
Hermet Park 44363bb70f efl_canvas_vg image: changed image parameter type.
it's still in improvement stage in beta.
2019-07-22 17:31:06 +09:00
junsu choi e9f8ef6ea4 vg_common_json : Support image data of node
Summary:
When node has image data, it creates Efl.Canvas.Vg.Image class
and set transform information and data information.

Depends on
D9218 Ector.Renderer : Implement Ector.Renderer.(Software).Image class
D9219 Efl.Canvas.Vg : Implement Efl.Canvas.Vg.Image class

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9220
2019-07-22 13:53:21 +09:00
junsu choi baf1fcdb91 vg_common_svg: Gradient stop color use premultiplied color.
Summary:
The parsed color is straight color.
evas use premultiplied color.

Test Plan:
Sample SVG
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  <defs>
    <linearGradient id="linearGradient1" x1="0" y1="0" x2="0.2" y2="0.2" spreadMethod="reflect">
      <stop style="stop-color:#ff0000;stop-opacity:1;" offset="0"/>
      <stop style="stop-color:#0000ff;stop-opacity:1;" offset="1"/>
    </linearGradient>
    <radialGradient id="radialGradient222" r="0.2" cx="0.3" cy="0.3" spreadMethod="reflect">
      <stop style="stop-color:#ffFF00;stop-opacity:0.1;" offset="0"/>
      <stop style="stop-color:#00FFff;stop-opacity:1;"   offset="1"/>
    </radialGradient>
    <radialGradient id="radialGradient333" r="0.2" cx="0.3" cy="0.3" spreadMethod="reflect">
      <stop style="stop-color:#00FF00;stop-opacity:0.1;" offset="0"/>
      <stop style="stop-color:#FF00ff;stop-opacity:1;"   offset="1"/>
    </radialGradient>
   </defs>
  <rect x="0" y="0" width="100" height="100" fill="url(#linearGradient1)"/>
  <rect x="50" y="50" width="50" height="50" fill="url(#radialGradient222)"/>
  <rect x="0" y="0" width="50" height="50" fill="url(#radialGradient333)"/>
</svg>

Reviewers: Hermet, kimcinoo, smohanty

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9338
2019-07-17 17:15:23 +09:00
junsu choi 84fcc5d073 evas_vg_load_svg: Prevent duplicate operations on radial gradient variables
Summary:
This solves the problem of radial gradient being displayed
abnormally when the radial gradient variables are 0 to 1.

Test Plan:
Sample SVG
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
  <defs
     id="defs11">
    <linearGradient id="linearGradient1" x1="0" y1="0" x2="0.2" y2="0.2" spreadMethod="reflect">
      <stop style="stop-color:#ff0000;stop-opacity:1;" offset="0"/>
      <stop style="stop-color:#0000ff;stop-opacity:1;" offset="1"/>
    </linearGradient>
    <radialGradient id="radialGradient222" r="0.2" cx="0.3" cy="0.3" spreadMethod="reflect">
      <stop style="stop-color:#ffFF00;stop-opacity:1;" offset="0"/>
      <stop style="stop-color:#00FFff;stop-opacity:1;" offset="1"/>
    </radialGradient>
  </defs>
  <rect x="0" y="0" width="100" height="100" fill="url(#linearGradient1)"/>
  <rect x="50" y="50" width="50" height="50" fill="url(#radialGradient222)"/>
</svg>

Reviewers: Hermet, kimcinoo, smohanty

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9312
2019-07-15 21:22:49 +09:00
Vincent Torri 9c8a7bce24 draw static lib: use sse3 instructions set even on Windows
Summary:
sse3 instructions set exists since 2003/2004. One can consider that computers with Windows have it, these days

Note also that ector and evas also use sse3 instructions without the test disabling the Windows platform

Test Plan: compilation

Reviewers: zmike, raster, cedric, bu5hm4n

Subscribers: bu5hm4n, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9284
2019-07-12 12:19:19 +01:00
Hermet Park e24d6aee69 vector lottie: register node name as it's designed.
Caller could find/access a specific node with the name.
2019-07-12 10:19:18 +09:00
Hermet Park 2baad6ac68 vector json: replace the data type properly. 2019-07-11 17:10:11 +09:00
junsu choi 9a55abef30 vg_common_json: Always set the alpha color of the container.
Summary: Fixes the problem that alpha color is not set when alpha will be 255.

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9216
2019-07-09 14:21:55 +09:00
Hermet Park 7fcf887b63 evas svg: fix missing node opacity attribute.
Any svg node could have its opacity value, we missed implementing it.

If a node have a opacity, it's opacity could be multiply with fill and stroke colors.

@fix
2019-06-27 13:18:28 +09:00
junsu choi 593ee30440 vg_common_json: Set container's alpha color
Summary: If the layer has an alpha value, we have make it available to container.

Test Plan: N/A

Reviewers: Hermet, smohanty

Reviewed By: Hermet

Subscribers: cedric, #reviewers, kimcinoo, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9081
2019-06-21 17:44:41 +09:00
Hermet Park 270c61dbb7 canvas vg: optmize lottie vector tree.
Skip invisible stroke nodes as possible.
2019-06-21 17:43:23 +09:00
Hermet Park 23af6ec640 evas vector: support json loader for rlottie integration.
Summary:
Introduce a new evas json loader to support lottie animation.
This json loader uses rlottie library which is a new github open project.

These days most ui frameworks (windowpws, skia, qt, xamarin, react, nativescript) supports lottie,
the rlottie was designed to support lottie as a standalone library and compatible with efl as well.

To enable this,please install rlottie library then remove json disabler in meson_options.txt

For more information, See lottie/rlottie project and its a introdcution article:

https://airbnb.io/lottie/#/
https://github.com/samsung/rlottie
https://hermet.pe.kr/143

Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>

{D8941}
{D8944}

Reviewers: #committers, jsuya, bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8940
2019-06-21 17:35:48 +09:00
Romain Naour ee64f61a68 libunibreak: add missing __has_attribute definitions for old compilers
__has_attribute has been introduced with gcc 5 [1].

[1] https://www.gnu.org/software/gcc/gcc-5/changes.html

Fixes:
http://autobuild.buildroot.net/results/64ab825048fac1654b0d0698740ddf857fcc0afa/build-end.log
Signed-off-by: Cedric BAIL <cedric.bail@free.fr>
2019-05-10 17:56:29 -07:00
Christopher Michael af4c6df7bb Revert "static_libs/vg_common: Fix resource leak"
Revert this as it causes edje_cc to segfault.

This reverts commit 2a4c87bb11.
2019-04-24 09:35:58 -04:00
Christopher Michael 1799f79c54 static_libs/vg_common: Remove extra blank lines
NB: No functional changes
2019-04-24 08:58:57 -04:00
Christopher Michael 2a4c87bb11 static_libs/vg_common: Fix resource leak
Coverity reports a resource leak here. The function _create_node
returns allocated storage which should be freed when we are finished
with it.

Fixes CID1382215

@fix
2019-04-24 08:56:00 -04:00
Hermet Park 29b65ccf88 evas svg: code refactoring.
reorder data fields to packing memory fit.
2019-04-19 15:21:07 +09:00
junsu choi 41152dc29e vg_common_svg : Implement gradientTransform property of linearGradient
Summary:
Svg parser gets transformation matrix information from svg.
If there is a matrix, calculate matrix operations
on the start and end points of the gradient.

TODO: We should implement gradientTransform of radialGradient.

Test Plan: N/A

Reviewers: Hermet, smohanty

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8663
2019-04-19 15:07:12 +09:00
junsu choi 5403af9629 vg_common_svg: Prevent duplicate operations for percentage value
Summary:
x1, y1, x2 and y2 of Svg_Linear_Gradient structure must be a percentage value.(0 ~ 1)
but these variables are reused with efl_gfx_gradient_linear_start/end_set/get
and duplicate operations occur.

Test Plan: N/A

Reviewers: Hermet, smohanty

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8662
2019-04-19 13:56:49 +09:00
junsu choi b736697ec7 vg_common_svg : Add missing eet data descriptor
Summary:
Add descriptor to get the value of user_space,
which is a member of Svg_Style_Gradient.

Test Plan: N/A

Reviewers: Hermet, smohanty

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8594
2019-04-11 14:48:05 +09:00
Hermet Park 2fdbc21c03 evas svg: replace internal vg legacy calls with interfaces. 2019-03-11 16:27:19 +09:00
Hermet Park 7c8210d8a6 evas vg: don't access a dangling pointer. 2019-02-27 19:13:18 +09:00
Hermet Park 9a5dacdb36 evas vg: check for OOM when calloc() 2019-02-21 10:36:49 +09:00
Hermet Park 0a47a0ef32 evas vg: check for OOM when calloc() 2019-02-21 10:36:49 +09:00
Hermet Park a921040743 evas vg: check for OOM when calloc() 2019-02-21 10:36:49 +09:00
Hermet Park 1442690680 evas vg: check for OOM when calloc() 2019-02-21 10:36:49 +09:00
Hermet Park 63e11e1b18 evas vg: avoid integral division not to loss precision. 2019-02-21 10:36:49 +09:00
Hermet Park 07521f5e07 evas vg: refactor internal function name.
Specify explict svg name in vg common function
since the function totally depends on svg spec.

No logic changes.
2019-01-09 14:59:01 +09:00
Marcel Hollerbach e43f090265 cmake: remove!
This build was never complete and also was not maintained probebly.

It is also dropped in favour of meson which is cool, merged, works & is fast.

Differential Revision: https://phab.enlightenment.org/D7010
2018-12-20 20:07:26 +01:00
Marcel Hollerbach 9c1d2fe62f build: draw is using functions from rg_etc
this means when you use draw you should automatically drag in rg_etc.

This fixes a build problem reported on irc.
2018-12-07 15:01:21 +01:00
Marcel Hollerbach 500a36ba3d meson: add inital support for windows compilation
Differential Revision: https://phab.enlightenment.org/D7416
2018-12-07 13:05:31 +01:00