Commit Graph

18 Commits

Author SHA1 Message Date
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
Carsten Haitzler a909ca1f68 evas draw context - reduce size and allocations and frees
so a little perf fun shows malloc/free/realloc/etc. are, combined a
reasonable overhead. this reduced malloc overhead for draw contexts so
whne we duplicate them or create new ones, we re-use a small cache of
8 of them to avoid re-allocation. just take the first one from the
list as it really is that simple. mempool would not have helped more
here and cost more overhead.

@optimize
2017-01-31 23:01:50 +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
Chris Michael cbf2aa2bf9 evas: Fix explicit NULL dereference
This patch fixes an Coverity issue that if 'dst' gets set to NULL (as can
happen above) then this eo_do call may segfault as it is directly
accessing 'dst->buffer'.

@fix
CID1347415

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-01-27 12:07:38 -05:00
Jean-Philippe Andre c1b4728487 Evas filters: Final fix after the ector refactor
This implements a generic way of scaling buffers, using fake
RGBA_Image wrapping ector buffer maps. The underlying algo is
still the good old linear sw scaler.

Now the filters *should* be back to their previous level of
usability. Performance will probably be even worse than it was
before, for GL, as more glReadPixels may be involved. Optimization
now consists in actually implementing the filters with GL shaders.
2016-01-05 16:02:27 +09:00
Jean-Philippe Andre 57902fffd3 Evas filters: Use Ector.Buffer instead of RGBA_Image
This is a major refactoring of the evas filters submodule.

Use Ector.Buffer and the map/unmap methods instead of directly
accessing image buffers with RGBA_Image. RGBA_Image is still
used under the hood, for two reasons:
 - Required for the final output (blend onto Evas itself)
 - Required for the scaling routines

FIXME:
 - Breaks proxy support (ie. all kind of texturing).
 - This breaks filters support for the GL engine.
2016-01-05 15:43:44 +09:00
Jean-Philippe Andre 14c1434960 Evas filters: Use smooth scaling by default for proxies
Is it too slow? Then I guess a new API option will be required.
2015-06-25 15:02:44 +09:00
Jean-Philippe Andre 70efb699a5 Evas filters: Implement table & function support for curve
Now the points can be specified by passing a table or a proper Lua
function. The previous functionality (parsing a string) is still
valid.
2015-06-25 14:36:08 +09:00
Jean-Philippe Andre 4e249143a5 Evas filters: Prepare optimization paths for BOX blur
Actually, there is a very nice trick with BOX blur.
Pass BOX blur 3 times and you can approximate a GAUSSIAN
blur with up to 3% accuracy. This is way more than enough
for just a simple graphical effect.

So, despite the crappy quality of BOX blur, we should
optimize it a lot so we can replace large GAUSSIAN blurs
with series of BOX blurs instead.

Source: Wikipedia's page on box blur :)

This commit also moves around some duplicated definitions.
2014-03-12 14:08:02 +09:00
Jean-Philippe Andre a97844d415 Evas filters: Complete GL support with scaling function
Directly use the scale functions from scalecache when
running the GL engine.

With this, and glReadPixels support, the GL engine support is now
100% complete. It will be DAMN SLOW, but ALL filters should work
in both OpenGL and Software rendering.
2014-03-07 11:07:15 +09:00
Jean-Philippe Andre 2225587e5e Evas filters: Allow image copy with the GL engine
For now, this simply uses memcpy.
The SW engine equivalent uses image_draw, which wouldn't work
under the GL engine.
2014-03-07 11:07:15 +09:00
Jean-Philippe Andre 6301c6dc1e Evas filters: Remove undocumented files from Doxygen
Some files had Doxygen tags @file, which included them in the
Files list. But they are not documented, so remove them from
the index.
2014-02-13 11:24:47 +09:00
Jean-Philippe Andre 9917962ffb Evas filters: Fix crash when using the GL backend
Buffer management was broken, and we tried to free the GL texture
as if it were a simple RGBA_Image.
2014-02-07 17:59:23 +09:00
Jean-Philippe Andre 43962135be Evas filters: Remove FIXME and unimplemented code
Remove compilation warnings: we don't really need cubic
interpolation at this point, we can still add it back
later if wanted.

Also, make it clear that buffer #2 is the output buffer.
Remove meaningless FIXME.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 2e401c2e91 Evas filters: Allocate buffer in the main loop (part 2)
Now the allocation is really done in the main loop.
Rendering fails, only happens in case of redraw.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre eea049f988 Evas filters: Alloc/Dealloc buffers from the main loop only
This is a problem I didn't spot immediately... but with
tons of nasty consequences.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 82032d494f Evas filters: Implement curve script API
Currently supports interpolation modes "none" and "linear".
Cubic interpolation is not implemented yet.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 7000907cd3 Evas filters: Move scaling to a common file
NOTE: Alpha scaling is NOT supported.
It could be faked in 3 expensive steps:
1. Draw to RGBA
2. Scale RGBA
3. Draw to Alpha.
2014-02-07 17:33:17 +09:00