Commit Graph

139 Commits

Author SHA1 Message Date
João Paulo Taylor Ienczak Zanette 9031750e62 efl: Make lua support optional 2021-01-31 11:40:45 -03:00
Felipe Magno de Almeida 89b839600e evas: Rename EAPI macro to EVAS_API in Evas library
Patch from a series of patches to rename EAPI symbols to specific
library DSOs.

=  The Rationale =

This patch is from a series of patches to rename EAPI symbols to
specific library DSOs.

EAPI was designed to be able to pass
`__attribute__ ((visibility ("default")))` for symbols with
GCC, which would mean that even if -fvisibility=hidden was used
when compiling the library, the needed symbols would get exported.

MSVC __almost__ works like GCC (or mingw) in which you can
declare everything as export and it will just work (slower, but
it will work). But there's a caveat: global variables will not
work the same way for MSVC, but works for mingw and GCC.

For global variables (as opposed to functions), MSVC requires
correct DSO visibility for MSVC: instead of declaring a symbol as
export for everything, you need to declare it as import when
importing from another DSO and export when defining it locally.

With current EAPI definitions, we get the following example
working in mingw and MSVC (observe it doesn't define any global
variables as exported symbols).

Example 1:
dll1:
```
EAPI void foo(void);

EAPI void bar()
{
  foo();
}
```
dll2:
```
EAPI void foo()
{
  printf ("foo\n");
}
```

This works fine with API defined as __declspec(dllexport) in both
cases and for gcc defining as
`__atttribute__((visibility("default")))`.

However, the following:
Example 2:

dll1:

```
EAPI extern int foo;
EAPI void foobar(void);

EAPI void bar()
{
  foo = 5;
  foobar();
}
```

dll2:

```
EAPI int foo = 0;
EAPI void foobar()
{
  printf ("foo %d\n", foo);
}
```

This will work on mingw but will not work for MSVC. And that's why
LIBAPI is the only solution that works for MSVC.

Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>
Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>
Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev>
2020-12-14 13:22:00 -03:00
junsu choi 26b50c91f8 evas_filter: Add null check for instruction
Summary:
Add a null check for cases where the param passed
from the filter instruction can be a null pointer.

Test Plan: N/A

Reviewers: kimcinoo, Hermet

Subscribers: #reviewers, #committers, cedric

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12084
2020-08-05 14:45:22 +09:00
Elyes HAOUAS c7da405ae7 Get rid of trailing whitespaces (12 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12011
2020-06-23 10:31:22 +02:00
Vincent Torri d135957ffa Use __func__ C99 identifier instead of __FUNCTION__ compiler extension
Summary: see http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf section 6.4.2.2 page 52

Test Plan: compilation

Reviewers: raster, devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11785
2020-05-07 09:27:07 -04:00
Xavi Artigas a004befea5 doxygen docs: Fix illegal references
Mostly typos and unescaped # signs
2020-03-12 17:24:07 +01:00
Xavi Artigas 7273229e3c doxygen docs: Fix some more invalid commands 2020-03-12 17:24:07 +01:00
Xavi Artigas 5b2d2a85b2 doxygen docs: Fix tons of invalid Doxygen commands
Mostly typos
2020-03-10 21:36:34 +01:00
Shinwoo Kim 51169ac325 evas filter: Implement inverse color filter
Summary: This is the first version of inverse color filter both GL and SW.

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

2. Run.
./filter_example (Use ELM_ACCEL=gl for GL engine)

Reviewers: Hermet, jsuya

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10335
2019-11-05 10:45:14 +09: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
Daniel Kolesa 4ec5760771 evas_filter_parser: add a workaround for in-tree runs
Without this, the prefix would get pointed to something like
/path/to/efl/build/share/evas, which is not a valid path when
building. That would cause the docs build to fail.
2019-09-09 15:12:47 +02:00
Shinwoo Kim 228bed4c8c evas_filter_parser: remove dereferenced NULL
Summary:
This is detected by static analysis tool.
The variable last could be NULL when it is dereferenced.

Reviewers: Hermet, zmike, bu5hm4n

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9796
2019-08-30 14:47:22 -04:00
Carsten Haitzler 297fa2bca0 optimize - avoid eina_inlist_last where not needed
really minor places.
2019-06-15 09:31:51 +01:00
Jean-Philippe Andre 88bfba1fdd evas filters: Add "alphaonly" flag for blend and blur
This is very useful to specify precisely which kind of RGBA -> Alpha
conversion you want. If all you wanted was the alpha layer to use as a
mask, set this flag to true.

@feature
2017-12-14 18:03:49 +09:00
Ross Vandegrift 71e5c74eb6 efl: drop deprecated Encoding key from desktop files
Summary:
The Encoding key is no longer required, all desktop files are assumed to
be UTF-8 encoded.  See details at:
https://standards.freedesktop.org/desktop-entry-spec/1.1/apc.html

Fix various typos and misspellings

lintian, Debian's package checker, uses strings to check for common typos
in compiled binaries.  This change fixes the ones it identified in 1.20.6.

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-12-13 10:27:48 -08:00
Sungtaek Hong 89f92afccc Evas filters: remove needless check for negative case.
Summary:
Becuse ox is set to 0,
it cannot be negative, so negative check will be needless.

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5155
2017-09-08 09:50:48 +09:00
Cedric BAIL fc1b7f7835 evas: make filter handle multi output. 2017-08-25 10:51:53 -07:00
Cedric BAIL 3da75d74e3 evas: all context function use already ENC. 2017-08-25 10:51:31 -07:00
Jean-Philippe Andre b10be4e2ed evas filters: Disable extra debug
Forgot to remove that! It's better to disable for the release,
DBG() and XDBG() are disabled anyway.

CID 1308611
2017-08-02 20:15:58 +09:00
Jean-Philippe Andre 30ac315631 evas filters: Cleanup unused buffers
This might not be used as over two consecutive runs all the
same buffers should be used. But it could happen if some
parameters in the filter change (eg. blur radius).

Fixes major (GPU) memory leaks. Reuse mode is still leaking.
2017-04-14 13:57:04 +09:00
Jean-Philippe Andre 01a4ecd92c evas filters: Adjust downscale coordinates to avoid artifacts
This avoids sampling artifacts when moving or resizing a
snapshot object over a region with sharp content (eg. text).
2017-04-14 13:57:04 +09:00
Jean-Philippe Andre 1bf24f8762 evas filters: Refactor to support reuse of buffers
This will reuse existing buffers by resetting only the minimum
required in the filter context (also reused). Work in progress,
as the actual reuse is disabled for now.
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 9b1ea2fc6b evas: Pass obscuring region to the filters
This will be most useful in a special case, where a filter is
used in a window decoration, applied to a snapshot object.

Another optimization that might be wanted is passing a list
of update regions (from the proxy or snapshot).

The filters don't support the obscuring region yet, only some
of the high-level logic is implemented.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre ac8812665b evas filters: Implement fill filter in pure GL
Now that one was trivial. Could also be done with glClear and
glScissor instead, but the rectangle infrastructure works well
enough.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 92dfe1831c evas filters: Fix blur logic and GL buffer handling
This corrects two things:
- the blur filter high-level logic, that lead to reusing some
  temporary buffers which contained garbage;
- the versatile gl buffer implementation so that it now properly
  switches between the RGBA_Image and the FBO content (yes, this
  is insanely slow and inefficient... but it works and that was
  the only point).
2017-04-14 11:26:43 +09: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
Jean-Philippe Andre b2a4039bda evas: Refactor evas filters a bit
This is a preparation step for (experimental) textblock support.
Textblock objects won't have a single filter, and the buffer's
geometry wouldn't be that of of the object itself. Thus a few
internal APIs need to be reworked first.
2017-01-17 14:35:27 +09:00
Jean-Philippe Andre b96b2aafcb evas: Fix warning with va_start in internal EAPI
Clang 3.9.0 told me:
  warning: passing an object that undergoes default argument
  promotion to 'va_start' has undefined behavior [-Wvarargs]

So I told it to shut up and changed Eina_Bool to int.

Note that edje_edit_state_external_param_set has the same issue.
2016-11-03 17:22:15 +09: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
Jean-Philippe Andre d6817f4d6e evas filters: Fix minor issue with print
If the call to tostring() fails, replace the string by (invalid)
rather than ignore the error.

Fixes CID 1308612
2016-08-09 11:43:52 +09:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +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
Jean-Philippe Andre bbc616e064 Evas filters: Fix meaning of data 'execute' flag
The doc said it would behave like "value = data" but actually
the data part was executed directly. This should fix that.
2016-03-02 13:11:29 +09:00
Jean-Philippe Andre 1e35a5239b Evas filters: Fix inconsistency in transform API
This is a minor change, makes 'output' the default target for
the transform filter. This is consistent with all the other
filters. This is not exactly a bug fix but it doesn't break
compatibility with the earlier explicit form and improves the API
for 1.17.
2016-01-22 15:35:23 +09:00
Jean-Philippe Andre 61fcf8e497 Evas filters: Fix crazy code (only when DEBUG=1) 2016-01-05 14:54:04 +09:00
Jean-Philippe Andre 15d5125d6e Evas filters: Remove unused variable 2015-12-08 14:57:51 +09:00
Jean-Philippe Andre 16195d3100 doc: Deprecate filter reference page and link to the wiki 2015-11-09 16:21:45 +09:00
Jean-Philippe Andre dc397fabff Evas filters: Fix some build warnings
Thanks Tom for spotting one of those
2015-10-12 13:44:44 +09:00
Stefan Schmidt eb6832f62e evas/filter: Remove unused variable
lib/evas/filters/evas_filter_parser.c:861:14: warning: unused variable 'ok' [-Wunused-variable]
2015-08-24 10:15:11 +02:00
Jean-Philippe Andre 2472dfdb24 Evas filters: Fix build for Jenkins gcc_x32
Disable bit32 library if it's not available.
We should probably either ship it or disable it altogether
for the filters. Hmm.
2015-08-21 11:42:30 +09:00
Jean-Philippe Andre 50e91e5321 Evas filters: Fix char buffer size
Thanks Coverity.
Fixes CID 1316684
2015-08-20 11:37:53 +09:00
Jean-Philippe Andre 8c8d254fbc Evas filters: Fix proxy buffer size in Lua
In order to do that, avoid creating multiple Buffer instances
when pointing to the same proxy source. This fixes buffer.width
and buffer.height in Lua.
2015-08-18 18:31:39 +09:00
Jean-Philippe Andre 6124d07336 Evas filters: Fix for Lua 5.3 (with --enable-lua-old)
Tested with LuaJIT, Lua 5.2 and Lua 5.3.

@fix
2015-08-18 18:31:39 +09:00
Jean-Philippe Andre 81f1f5db17 Evas filters: Fix invalid sizeof
CID 1308609
2015-07-31 13:24:17 +09:00
Jean-Philippe Andre fbd0a51607 Evas filters: Fix order of header file includes
This fixes filters on Ubuntu 32 bits.

This was one hell of a weird bug to track down. Everything worked
like a charm on my 64 bit machines, but filters would simply fail
for no good reason: a safety check sees a NULL pointer when clearly
it was properly allocated.

Just after entering a function, the content of an RGBA_Image would
change, even though there was no memory write there. This made the
image data pointer NULL, and filters would fail miserably.

So I printed out the contents of the RGBA_Image, they changed. But
the memory itself had not changed. The size of the struct itself
had changed when jumping from one file to another! But its definition
had not! Non-sense!

Unless of course a system header file was included before config.h
and ino_t or off_t would switch between 32 and 64 bits...

@fix
2015-07-28 17:13:52 +09:00
Jean-Philippe Andre f9c7d25b08 Evas filters: Disable debug code path 2015-07-28 17:13:52 +09:00
Stefan Schmidt 3b91d33da2 evas/filter: Avoid leak in error path
If format is not found we go out of scope and would leak param. Free instead.

CID 1308610
2015-07-24 19:01:10 +02:00
Jean-Philippe Andre ff6dbb17e3 Evas filters: Set state.next to nil when not in transition
This is what the doc says and makes more sense.
That was some kind of inverted logic.
2015-07-23 20:17:39 +09:00
Jean-Philippe Andre 218b3a40f9 Evas filters: Fix parsing of curve() with a function
If the points argument was a function, there was a Lua call
stack error, making the filter fail.
2015-07-15 14:10:50 +09:00
Jean-Philippe Andre 8fa3b2b111 Evas filters: Fix usage of proxy buffers (compatibility)
The previous API supported stuff like "mask{'image1'}" but image1
is now not a valid buffer name, as it's only the proxy source name.
This patch fixes the buffer lookup.
2015-06-25 14:43:05 +09:00