Commit Graph

3672 Commits

Author SHA1 Message Date
Mike Blumenkrantz ebcafd4249 evas_vg/svg: fix null deref
Summary: CID 1405672

Reviewers: cedric

Reviewed By: cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10446
2019-10-18 13:29:38 -04:00
Carsten Haitzler db7348acf3 wl egl - use platform get display
if possible, use the platform specific egl get display as a wl egl
client. this fixes client side init with ... some drivers that can't
auto-detect the display type passed in.

@fix
2019-10-18 12:51:36 +01:00
Hermet Park fbe554037b vector json: use lottie apis case by case.
We can request loading from data only in case of actual memory map.
The lottie-player would take care of the parsing on utf8/16/32 formats
more precisely so that we don't need to take care of this converting
from the memory.
2019-10-15 15:06:48 +09:00
Carsten Haitzler ca32732373 ecore_evas/wl2 0 fux xdg close cb for window when it's closed remotely
this should fix this:

https://matrix.org/_matrix/media/r0/download/matrix.org/lhFneENlWAjuXDaJfSYuJjjJ

unfortunately this means adding an api and then using it in ecore_evas.

@fix
2019-10-14 22:58:27 +01:00
Shinwoo Kim 431d62d095 evas filter: Implement grayscale filter in SW
Summary: Initial version implementing grayscale filter in SW.

Test Plan:
1. Create filter_example with following.
efl_gfx_filter_program_set(image, "grayscale ()", "grayscale");

1. Run.
./filter_example

Reviewers: Hermet, jsuya

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10219
2019-10-14 11:13:40 +09:00
Shinwoo Kim ba09a8101b evas_image: fix memory leak
Summary:
On the sw engine, an im could be changed and removed by evas_cache_image_size_set.
In this case, there is no chance to free its resource and ends up in memory leak.

Reviewers: Hermet, raster, jsuya, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10334
2019-10-14 11:10:18 +09:00
Carsten Haitzler 0f3bbb51f4 build - images loaders and saver modules need to link to evas
if your platform is picky enough it won't want to leave unresolved
symbols (which wshould be resovled at runtime from the host lib) so we
need to link these modules to evas. the problem is due to the
complicated build of some modules being static and some shared, evas
is declared with evas_goal and this has to be declared after static
modules are declared but since i was declaring static and shared at
the same time from a table this breaks. so i have to move all the
static and shared module stuff into evas_goal into 2 phases. one phase
for the static and one for the shared after evas is delcared so evas
as a target exists to link to.
2019-10-05 18:39:38 +01:00
Carsten Haitzler 9371cdfef8 build - bring back loaders and savers as modules and/or static
so the evas modules able to be static or not was a bit pointless as it
could inline all evas modules (or none) not just the most common or
not, but ecore evas modules were still modules, so it really wasn't
being useful.

image loaders ans savers omn the other hand were *ALL* being
statically built in without exception. this was kind of a regression
in the build system in the move to meson. some were static due to
micro optimizations and performance inlining the most common to save a
little extra loading + linking + page fragmentation for loaders you
are likely to need in most cases as well as save the drity pages from
linking in their dependencies (libgif, libtiff, libwebp and all their
dependencies too etc. etc.). this now brings back the ability to
decide which are static and which are shared modules (not exposed to
the user as options for meson - fixed in meson.build files which i
think is good enough given the purpose of this).
2019-10-05 13:21:02 +01:00
Carsten Haitzler 6d8e39a642 build - remove evas-modules option as its rather pointless
evas-modules affects evas engine modules if they are static or shared,
but ecore evas modules are still modules... so all in all this doesnt
help much as it still requires modules to be separate from the shared
libs, thus disallowing for statically linking efl into an app anyway
etc. etc. etc. ... so less options to deal with, less complexity.
better.
2019-10-04 13:33:42 +01:00
Carsten Haitzler 13ecc4898c evas - gl_drm - handle modifiers for drm formats
this was/is breaking e on rpi4 as modifiers are used to pass tiling
info it seems. we had no support thus leaving garbage in buffers. this
fixes that.
2019-09-30 22:07:21 +01:00
Shinwoo Kim 081e318d90 evas filter: Implement grayscale filter in pure GL
Summary:
Initial version implementing grayscale filter in pure GL.
This patch needs a logt of love as 5bce712 did.

Grasyscale formula:
https://www.tutorialspoint.com/dip/grayscale_to_rgb_conversion.htm

Test Plan:
1. Create filter_example with following .
efl_gfx_filter_program_set(image, "grayscale ()", "grayscale");

2. Run.
ELM_ACCEL=gl ./filter_example

Reviewers: Hermet, jsuya

Subscribers: ali.alzyod, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9858
2019-09-27 15:35:03 +09:00
Mike Blumenkrantz fddc27ed40 ecore-evas/x: detect and track wm existence, apply visibility correctly
Summary:
this attempts to monitor the _NET_SUPPORTING_WM_CHECK atom to verify whether
a wm exists, and bypasses waiting for a configure event from a nonexistent wm
if the screen is not currently managed

fix T7838

Depends on D10014

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: devilhorns, thierry1970, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7838

Differential Revision: https://phab.enlightenment.org/D9900
2019-09-26 11:22:44 -04:00
Carsten Haitzler 88888a00a6 osx - require full opengl for gl support on osx
the default still is gl-es as documented. you need to explicitly turn
on full opengl to get gl support on osx because thats all the engine
does. document this exception for osx (having gl magically being full
on osx and gle-es elsewhere is another option but then we need
different os specific defaults for this which is kind of bad in other
ways).
2019-09-23 21:22:22 +01:00
Hermet Park eb2c1311ae ector engine: +null checking.
Null pixels is allowed when drawing region is 0,

In that case, the pixel buffer can be destroyed earlier by vg.

@fix
2019-09-23 21:15:28 +09:00
Cedric Bail 9382bfc0bc eina: add eina_mempool_iterator_new to slowly iterate every allocated pointer in a mempool.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9941
2019-09-19 14:37:41 -07:00
Hermet Park cdfe946358 evas gl: remove unnecessary null check.
If we check reference validation, the rest of other usage
should keep the reference check as well.

Remove it since gl prorgram must be valid always here
to shutdown the static analyzer reporting this suspicous logic.
2019-09-19 13:42:22 +09:00
Cedric Bail 4ab4b59757 eina: fix free support in eina OneBig mempool.
We use an Eina_Trash to store freed pointer, which require the item size
to be at least the size of a pointer. There wasn't any test suite enable
for OneBig mempool and we never used free on a small item size...

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9939
2019-09-17 10:24:05 -07:00
Cedric Bail 2064112684 eina: fix eina_mempool_from to not report pointer that have never been allocated as allocated.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9938
2019-09-17 10:24:03 -07:00
junsu choi 3932c68382 evas_vg_load_svg: Change strtod to eina_convert_strtod_c for locale issue
Summary:
Crash depending on LOCALE when using strtod.
So change to eina_convert_strtod_c which is made to prevent strtod problem.

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9988
2019-09-17 21:18:47 +09:00
Boris Faure 511faf3cbf meson.build: allow to disable tiff evas loader
Summary:
@fix

eina benchmarks: ssize_t is defined in <sys/types.h>

Reviewers: #reviewers, bu5hm4n, zmike, stefan_schmidt

Reviewed By: zmike

Subscribers: vtorri, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9927
2019-09-13 11:26:19 -04:00
Marcel Hollerbach 2801b45d8f meson: make sure evas buffer engine is built before edje_cc
Summary:
ensure that the evas buffer engine is available.

fix T8220

Reviewers: zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8220

Differential Revision: https://phab.enlightenment.org/D9918
2019-09-12 14:45:47 -04:00
Hermet Park dc0056ca93 ector: removed cairo backend.
For reducing maintainability burden,
We drop supporting cairo backend.

The default backend is to software implementation from now.
It's well maintained so far and works good.x
2019-09-11 13:14:56 +09:00
Carsten Haitzler d1c5e201be fix xpm again - to be threaded not region decode capable 2019-09-06 15:42:47 +01:00
Carsten Haitzler 5e1f2cd68c fix xpm loader to be threadable - fixes so much stuff...
fixes ylee's xpm loading issue... it really is just that xpm's didn't
load if you preload/load from a thread... because it wass the only
loader that claimed it couldnt be threaded... which it can be.

@fix
2019-09-06 14:19:31 +01:00
Carsten Haitzler 44a0a6f7c8 evas -gl engines - buffer age - bring back fix for changing buffer age
so we USED to... if buffer age changed between frames, force a full
redraw and add that to the pipeline... somehow someone removed that.
this brings that back as it's really needed to deal with updating
correctly.

@fix
2019-08-29 17:35:02 +01:00
Vincent Torri 9336e2c51c Ecore : does not build linux-only ecore modules on Windows
while tizen module is disabled and systemd is not build on Windows, upower is built and run

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9658
2019-08-21 11:18:48 -07: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
Shinwoo Kim 2a0eeba4e5 evas: fix png regression issue
Accidentally commit "382c580 evas: add support for .9.png file to PNG loader."
adding the 9 patch feature with small code refactoring missed a line calling
eina_file_map_all taking EINA_FILE_SEQUENTIAL for data decoding.

You can see the previous change adding the line from the following commit.

   e60baa0 evas: change mapping policy to be less agressive into loading file
           in memory.

This is a response to the request of @cedric on D9580

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9614
2019-08-19 16:47:22 -07:00
Vincent Torri 01b987df59 make mman.h private
Summary:
integrate mman.h to make Evil private to the EFL, as mman.h does not exist on Windows. After a discussion with raster, i include sys/mman.h only on non Windows platform.

One issue, though, is that src/modules/emotion/generic/Emotion_Generic_Plugin.h has inlined functions using mmap()

Test Plan: compilation on Windows

Reviewers: cedric, raster, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9542
2019-08-19 09:55:13 -04:00
Hermet Park ce3d1ec7e7 evas svg: fix svg spec compatibility.
Minus degree value must be transformed to the signed before Radian.

It's easily tested i.e. the rotation degree is -350.

@fix
2019-08-19 21:37:45 +09:00
Shinwoo Kim f5aa672853 evas: fix png regression issue
Summary:
The evas_image_load_file_data_png had called png_set_tRNS_to_alpha
from following commit.

   6988a38 evas: fix png loader to actually produce lower resolution
           content when asked.

You could refer to following information regarding png_set_tRNS_to_alpha
which is available on page http://www.libpng.org/pub/png/libpng-manual.txt

   The following code transforms grayscale images of less than 8 to 8 bits,
   changes paletted images to RGB, and adds a full alpha channel if there is
   transparency information in a tRNS chunk.  This is most useful on
   grayscale images with bit depths of 2 or 4 or if there is a multiple-image
   viewing application that wishes to treat all images in the same way.

       if (color_type == PNG_COLOR_TYPE_PALETTE)
           png_set_palette_to_rgb(png_ptr);

       if (png_get_valid(png_ptr, info_ptr,
           PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr);

       if (color_type == PNG_COLOR_TYPE_GRAY &&
           bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr)

Accidentally commit "382c580 evas: add support for .9.png file to PNG loader."
adding a new feature with small code refactoring missed the line calling
png_set_tRNS_to_alpha.

So we got a rendering issue. It made around 75% size white rectangle
using a grayscale and transparent image. I'd like to attach the image
which has following type information for test purpose.

$ identify -verbose ./grayscale_transparent.png | grep type -i
  Mime type: image/png
  Type: Bilevel
    png:IHDR.color-type-orig: 0
    png:IHDR.color_type: 0 (Grayscale)

Test Plan:
This is the sample image file grayscale_transparent.png

{F3748665}

Reviewers: cedric, Hermet, jsuya

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9580
2019-08-16 16:55:12 +09:00
Marcel Hollerbach f5063b8733 meson: add xkbcommon to the build deps
Summary: fix T8064

Reviewers: cedric, zmike, devilhorns

Reviewed By: devilhorns

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8064

Differential Revision: https://phab.enlightenment.org/D9573
2019-08-15 15:36:29 -04:00
Carsten Haitzler e0f0165220 evas - png loader - fix leake in error case of pixels
fix CID 1403027

@fix
2019-08-11 12:47:37 +01:00
Carsten Haitzler 9149767184 getenv - reduce continually calling getenv for the same vars do once
do it once and remember the result from the first one. drops overhead
for sure by a chunk i actually could see in perf reports like about 1-2%
of cpu...
2019-08-08 23:57:02 +01:00
Boris Faure cdb920ab08 get rid of shadow variables
Summary: gl: add some EINA_FALLTHROUGH

Reviewers: #reviewers, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9525
2019-08-08 17:18:46 -04:00
Carsten Haitzler b6bc80d2da ecore evas drm - fix code that forgets to del an fd handler
also.. note the badness of the code design mixing a global singleton
with a "per struct" set of data like fd handlers for the same devices
initted only once but... anyway. it's messy.
2019-08-07 18:14:06 +01:00
Carsten Haitzler 064b46b7a3 evas egl - esnure we always destroy surfaces because creating new ones
be sure we dont leak them.
2019-08-07 16:59:43 +01:00
Carsten Haitzler 8e67e9d18e evas - gl_drm - delete old surfaces before creating new ones
we shouldnt go have multiple drm window surfaces per drm surface...
this is bad.

@fix
2019-08-07 16:39:10 +01:00
Christopher Michael b273bf7f9a ecore_wl2: Move ecore_wl2_window_rotation_change functions to be
internal

These functions are not used in efl wayland clients nor are they used
in Enlightenment. As such, there is no reason that they need to be
public API so this commit moves them to be Internal and updates
Ecore_Evas engine code to include the internal header.

ref T8013
2019-08-06 08:40:41 -04:00
Mike Blumenkrantz 88910d6a65 efl_ui/clock: remove module interface
this was overly complex and never actually used

ref T7868

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9499
2019-08-06 09:26:34 +02:00
Carsten Haitzler 21efff6d3e evas image - eina file - be paranoud about double closes
tracking some seemingly not so good asan hits on the eina file where
we're accessing an eina file already closed... so be extra paranoid
about it and set things to null after free/close...
2019-08-05 18:59:33 +01:00
Carsten Haitzler c56791180d gif loader - dup eina file as we keep our own copy of it in the loader
we didnt dup the eina file handle since  we kee our own handle. we
need ot do that. asan found this.
2019-08-05 18:59:33 +01:00
Carsten Haitzler 9ea4bb8fc7 ecore evas drm - fix multi-dlopening of lib into symbol space
only load libglapi once... not multiple times by storing static ptr to
lib handle.

fix CID 1402692
2019-08-05 13:55:38 +01:00
Carsten Haitzler d9dbd2fbea ecore evas x and e sync rendering - disable as it's unused
this has been optional and unused by e for a very long time ot try
sync front-buffered software rendering with the wm/compositor. we may
as well remove the bloat that is here that is unused... it's been
inactive for many years anyway.
2019-08-02 16:41:12 +01:00
Daekwang Ryu cf818a84be evas_gl: implement EvasGL ES 3.2
add a wrapper function for glFramebufferTexture.
some bugs were fixed.
I tested on Ubuntu 14.04(x64) and nVidia 375 driver with VK-GL-CTS

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D4831
2019-08-01 10:42:55 -07:00
Marcel Hollerbach c0082b1c71 efl_ui_range_display: move events from spin
we concluded min,reached and max,reached should be on every widget that
implements range_display. This here is the start of that work, the
events are moved, next commit fixes all widgets, the last commits
enables tests in the spec unit test.

ref T7897
ref T7895

Differential Revision: https://phab.enlightenment.org/D9371
2019-07-31 10:18:20 +02:00
Hermet Park e092878d11 vg json: --log level
Vector needs to try load a lottie file in a brutal force way,
If the input source is not identified.
2019-07-31 15:12:19 +09:00
WooHyun Jung 77e268e6ab efl_input_clickable: rename efl_ui_clickable to efl_input_clickable
Summary:
Renamed all efl_ui_clickable_XXX to efl_input_clickable_XXX based on
the discussion in T7847

ref T7847 T7976

Reviewers: zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7976, T7847

Differential Revision: https://phab.enlightenment.org/D9427
2019-07-29 11:43:01 +02:00
SubhransuSekhar Mohanty dd484a54dc efl_canvas_vg svg: free the svg tree returned by eet_data_read()
The eet_data_read() api creates the structure by referencing the wwt data structure
and reading from eet file. So the structure should be deleted by the user of the function.
As eet_data_read() api documentation dosen't specify about the ownership I guess
we need to free this structure to avoid memory leak.
2019-07-25 15:19:41 +09:00
junsu choi 2e4c928d81 evas_vg_load_svg: Support multiple gradient without <defs> part
Summary:
Multiple gradients can be declared.
There is a problem of keeping only one gradient information
when it is declared outside defs or when defs is not declared.
It supports the use of multiple gradients even if no defs are declared.

Test Plan:
(with D9312 patch)
cd src/example/edje
edje_cc -beta svg.edc && gcc -o svg-test svg-test.c `pkg-config --libs --cflags evas ecore ecore-evas edje`
./svg-test

Reviewers: Hermet, kimcinoo, smohanty

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9315
2019-07-15 21:23:38 +09:00