Commit Graph

47 Commits

Author SHA1 Message Date
junsu choi 562ae738cc ector_software_rasterizer: use dynamic array by span size.
Summary:
When use with intersect mask, if span_count over span array size, composition is to be wrong.
So, In this case, we use dynamic array by span_count.

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: vtorri, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10748
2019-12-06 10:37:31 +09:00
Hermet Park 24ed24a9db ector: refer exact stride size for jumping buffer lines.
Actual buffer and used width size could be different,
stride must be referred.
2019-09-17 12:03:25 +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
Hermet Park c5b88ca745 ector: add FIXME for coming issues.
We have no any test resouce but it seems very weird code...
Leave a comment for future task.
2019-09-04 20:03:05 +09:00
Hermet Park f90c8b8910 ector: fix a wrong target buffer size.
the target buffer is allocated by backend engine,
The buffer size must be specified with the stride, not the width.
It's real dimension can be different with the our request.
2019-09-04 20:03:05 +09:00
Hermet Park 9a4b6728d5 ector gradient: ++ optmization.
we know what size will be used for every span,
this graident buffer will be overwritten with new one,

So it doesn't need to clear every spans.
2019-08-30 17:15:06 +09:00
Hermet Park e4b9807ee3 ector: remove unnecessary blending processing.
gradient buffer in masking doesn't need to apply anti-aliasing
since it would be taken by masking buffer.

This also fixes memory overflow case if the tbuffer is lack of size.
2019-08-30 13:44:56 +09:00
Hermet Park 17320a1318 ector: code refactoring.
just renamed internal variables, no logical changes.
2019-08-30 13:44:56 +09:00
junsu choi 34dc52dbd2 efl_canvas_vg_shape/ector_software : Set and use stroke miterlimit
Summary:
efl_canvas_vg_shape is set to miterlimit with Efl.Gfx.Shape.stroke_miterlimit
and pass the value from rasterizer to freetype.

NOTE: The default value is 4. It only refers to the standard of web svg.
      https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit

Depends D9657

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Subscribers: cedric, #committers, #reviewers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9665
2019-08-22 13:00:01 +09:00
junsu choi ca8df7067c ector_software_rasterizer: Change default value of stroke linejoin
Summary:
SW_FT_STROKER_LINEJOIN_MITER is same SW_FT_STROKER_LINEJOIN_MITER_VARIABLE
We pass miterlimit values in fixed-point type.
Therefore, change the default value to SW_FT_STROKER_LINEJOIN_MITER_FIXED.

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9656
2019-08-22 12:38:57 +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 9b7d71df79 ector: ++safety.
null handling just in corner case.
2019-08-08 23:34:02 +09:00
junsu choi 949cf2750b ector_software_rasterizer: Add default value for stroke's miter_limit
Summary:
Currently the default value of miter_limit is defined as 0.
miter_limit should be specified to a value other than 0. becuase it is affected by width.
See below for an explanation of this.
https://www.freetype.org/freetype2/docs/reference/ft2-glyph_stroker.html#ft_stroker_linejoin

There is no particular reason why the default value is 0x4.
It only refers to the standard of web svg.
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit

Test Plan:
   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_Object *bg = elm_bg_add(win);
   elm_bg_color_set(bg, 255,255,255);
   evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
   evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
   evas_object_show(bg);

   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 *shape = evas_vg_shape_add(container); //Default is EFL_GFX_JOIN_MITER
   evas_vg_shape_append_rect(shape, 0, 0, 100 , 100, 0, 0);
   evas_vg_shape_stroke_color_set(shape, 255, 0, 0, 255);
   evas_vg_shape_stroke_width_set(shape, 10);
   evas_vg_node_origin_set(shape, 50, 150);

   shape = evas_vg_shape_add(container);
   evas_vg_shape_append_rect(shape, 0, 0, 100 , 100, 0, 0);
   evas_vg_shape_stroke_join_set(shape, EFL_GFX_JOIN_BEVEL);
   evas_vg_shape_stroke_color_set(shape, 255, 0, 0, 255);
   evas_vg_shape_stroke_width_set(shape, 10);
   evas_vg_node_origin_set(shape, 200, 150);

   shape = evas_vg_shape_add(container);
   evas_vg_shape_append_rect(shape, 0, 0, 100 , 100, 0, 0);
   evas_vg_shape_stroke_join_set(shape, EFL_GFX_JOIN_ROUND);
   evas_vg_shape_stroke_color_set(shape, 255, 0, 0, 255);
   evas_vg_shape_stroke_width_set(shape, 10);
   evas_vg_node_origin_set(shape, 350, 150);

   evas_object_vg_root_node_set(vg, container);
   elm_object_content_set(bg, vg);

   elm_win_resize_object_add(win, bg);
   evas_object_resize(win, WIDTH, HEIGHT);
   evas_object_show(win);
   elm_run();
   elm_shutdown();

Reviewers: smohanty, Hermet, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9492
2019-08-05 18:08:50 +09:00
junsu choi 3210fa3d69 ector: Prevent access to NULL buffer in software rasterizer
Summary:
Prevents a crash caused by a null pointer exception
when ector surface buffer is NULL.

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9390
2019-07-26 13:12:48 +09:00
junsu choi 10062fd957 ector_software_rasterizer: Improved masking calculation.
Summary:
The memory allocation for the buffer size is improved to
allocate only the width size.

Test Plan: N/A

Reviewers: Hermet, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, smohanty, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8873
2019-05-15 11:22:45 +09:00
junsu choi c10dfc3bca ector_software_rasterizer : Move duplicate alloca
Summary: Move the alloca() outside of the loop.

Test Plan: N/A

Reviewers: Hermet, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, smohanty, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8869
2019-05-09 19:30:37 +09:00
junsu choi 4473062dd4 ector_software_rasterizer: Support gradient mask blending
Summary: This patch supports mask blending of gradient shapes.

Test Plan: N/A

Reviewers: Hermet, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, smohanty, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8855
2019-05-08 16:57:19 +09:00
junsu choi 83d5ea1a42 ector_software_rasterizer: Implement mask blending function.
Summary:
Add Mask blend function(Add, Substract, Intersect, Difference)
this blending function only use mask blending case.

Test Plan: N/A

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, kimcinoo, #reviewers, smohanty, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8509
2019-04-11 19:17:10 +09:00
Hermet Park e6f66e56fd ector software: Be careful at alloca() usage.
allocate one spare span memory then reuse it.
2018-12-07 19:54:41 +09:00
Hermet Park fbe92aa67f evas ector: add software implmentation for masking feature.
This implementation uses Ector_Buffer to generate mask image from vg container,
and pass it to Ector engine. Ector renderer could blend this image as a mask.
Yet only vg container works as a mask, we could extend shape to support masking later.

Still vector gl drawing is not completed, We use software ector buffer to draw on it.
This is on progessing.
2018-12-07 19:50:08 +09:00
Hermet Park cfc66dd0bd ector: code refactoring.
make code clean and neat.
no logical changes.
2018-12-07 15:50:57 +09:00
Hermet Park c373f4936b ector/software: remove duplicate call. 2018-11-14 16:08:09 +09:00
Cedric Bail e380ddb742 ector: move RLE shape/stroke computation to a pool of thread.
This has been a long standing plan for improving performance in rendering
vector object. Depending on the test, you will get an improvement between
10 to 35% when rendering vector based object.

We are still maintaining the Cairo backend as the default one at the moment
due to a lack of result comparison tests between the two engine. Hopefully
we should get that covered and we can all enjoy a backend that is 4 times
faster by default.
2017-09-17 11:49:48 -07:00
Bryce Harrington d5346d4e24 ector: cleanup grammar in comments
Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5132

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-08-29 16:24:23 -07:00
Jean-Philippe Andre 2ef8d6f39a evas filters: Refactor ector and gfx filters A LOT
Alright, so this is a massive patch that is the result of
trying to get rid of unused or poorly implemented classes in
ector. Originally ector was meant to support VG but extend to
things like filters as well. At the moment, ector's design
makes it quite hard to plug in the filters.

For now I think it's easier to implement the GL support for
the filters directly in the engine, where I hope to interfere
as little as possible.

This massive patch keeps only the required minimum to support
a versatile gl buffer that can be mapped, drawn or rendered to (FBO).
It's extremely inefficient as it relies on glReadPixels and lots
of texture uploads, as well as conversions between ARGB and Alpha.

Another type of GL buffer is a wrap around an existing GL image,
but that one is read-only (map or draw: no write map, no FBO).

No, all the filters run fine, and the high-level implementation
(evas_filters.c) does not need to know whether the underlying engine
is SW or GL. One problem though appears with the blending or blurring
of some Alpha buffers, the colors are wrong.

This patch removes more lines than it adds so it must be good ;)
2017-04-14 11:26:43 +09:00
Subhransu Mohanty 355a4e3830 evas/vg: fix handling of stroke width in cairo and native backend
T3351

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-15 15:21:17 -08: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 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
Jean-Philippe Andre c09199f0e0 Ector: use uint32_t instead of uint
This fixes the build for Windows. Thanks @vtorri for the report.

I'm not using "unsigned int" as uint was mostly used like DATA32,
ie. color data (one pixel color or a pixel buffer).
2015-12-03 20:28:27 +09:00
Jean-Philippe Andre dc621e2316 Ector: Kill compilation warnings
Remove unimplemented function (no test case yet).
Convert #warning into comments.
2015-12-03 18:42:50 +09:00
Jean-Philippe Andre 33cd26a4b2 Ector: Another minor code cleanup
Remove DATA8, DATA16, DATA32
Remove empty data structure
Remove unnecessary typedef
2015-12-03 18:42:50 +09:00
Jean-Philippe Andre 615b2442b7 Ector: Move drawhelper to static_libs
Rename a few things:
 - draw helper -> efl_draw
 - Ector_Rop -> Efl.Gfx.Render_Op
 - ECTOR_ bla bla -> DRAW_ bla bla (base pixel ops)
 - ector_memfill -> draw_memset32 (and invert arg order to match memset)

The main rasterizer file is now draw.h in static_libs/draw
This is a non functional change, simple code refactor.
2015-12-03 18:42:50 +09:00
Jean-Philippe Andre bad7911cd0 Ector: Use Ector Buffer inside SW and Cairo renderers
Ector Surface now inherits from Ector Buffer, and the current
two renderers (SW and Cairo SW) use Ector.Software.Buffer
implementations for pixel surfaces.

Basic pixel handling is merged and will allow easy extension
(color conversion, etc...).

Buffer classes are Mixins to be fully implemented by the final
class, such as: Ector.Software.Buffer, Ector.Software.Surface
or Ector.Cairo.Surface.

This is a large ugly commit. Sorry.
The code is quite a mess right now.
2015-12-03 18:42:50 +09:00
Jean-Philippe Andre 0cf5719e52 Ector: Implement pixel buffer support
The objective of this patch is to propose a standardized
format for pixel buffers to use within Ector and Evas.

The basic EO API provided here is not meant to be the
fastest path for all operations, simply the most convenient
to generalize. Performance will be achieved by implementing
(or porting) custom draw functions.

This implements support for:
- Generic pixel buffers
- Generic buffer renderer to draw images with ector
- Software engine pixel buffers, ie. malloc buffers
- Software buffer renderer

Cairo support has not been implemented yet.

The only renderer is still extremely limited, as it does not
support Fill modes, Scaling, etc... yet.

Not a single line from this patch has been tested yet.
It compiles. That's pretty damn good for a start!

@feature
2015-12-03 18:42:50 +09:00
Cedric BAIL ef975a9fd2 ector: follow function naming convention. 2015-11-09 10:42:35 -08:00
Vivek Ellur 96f936e6d3 ector: fix null pointer dereference issue
Summary:
Fix Coverity CID1293003

Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>

Reviewers: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D3220

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-31 02:12:06 +01:00
Subhransu Mohanty 2766ce57ce ector: refactored software drawing backend to use composition function.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-08-19 15:07:36 +02:00
Subhransu Mohanty f1a4f461c2 ector: add bounding box info in RLE data for software backend.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-08-19 14:56:29 +02:00
Subhransu Mohanty 146f3c52b5 ector: now software rasterizer allocates memory on stack to work in multi threading env.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-08-19 14:56:11 +02:00
Daniel Kolesa 917a2bcab5 ector: always initialize the array contents even without fetchfunc
Also use a static array instead of a VLA as we know the size at compile time.

Fixes CID 1294210.

@fix
2015-06-09 15:12:07 +01:00
Jean-Philippe Andre 841403e415 Ector: More clang silencing 2015-04-21 20:40:27 +09:00
Chris Michael d3d909bf9e ector: Fix Coverity CID1293003
Summary: This fixes an issue of coverity reporting Explicit null
dereference as fetchfunc is defaulted to NULL, yet no check is made
later before calling it.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-12 21:13:18 -04:00
Subhransu Sekhar Mohanty 0ec75ca05f ector: fix coding style of freetype backend. 2015-04-03 16:33:50 +02:00
Subhransu Sekhar Mohanty 5753b43812 ector: fix pre multiplied color issue with FreeType backend.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-04-03 16:33:29 +02:00
Subhransu Sekhar Mohanty 10dca9f68e ector : add path cliping feature in FreeType software backend. 2015-04-03 16:33:05 +02:00
Subhransu Sekhar Mohanty 891ec14585 ector: add software backend using FreeType rasterizer. 2015-04-03 16:31:45 +02:00