Commit Graph

2051 Commits

Author SHA1 Message Date
Derek Foreman 1c60ac3bc9 ee_drm: Remove some commented out code
I think this was intended as a reminder to do something that's already
been done.  Or something.
2017-05-12 17:51:34 -05:00
Derek Foreman edcbff59b7 ecore_drm2: refcount fbs
Removes the previous "busy" flag, as now we might have an fb attached to
multiple outputs at once, and need to be careful to destroy them only
after they've been removed from all outputs.

Removed the old "busy_set" API which nothing used, and renames fb_destroy
to fb_discard to make it more clear that it's not immediately destroyed.

It's all beta api, so I can do this.
2017-05-12 17:51:34 -05:00
Cedric BAIL 69b941f018 evas: simplify fb engine. 2017-05-12 15:24:45 -07:00
Cedric BAIL a660ee9e19 evas: simplify buffer engine. 2017-05-12 15:24:45 -07:00
Cedric BAIL 35e54acc46 evas: stat introducing a concept of engine and output in the backend. 2017-05-12 15:24:45 -07:00
Jean-Philippe Andre 7e2e6e8aa4 evas gl: Fix typo and revert hack (GLES 3.1)
Omg... Thanks Daekwang Ryu for pointing me to my error. I remember
struggling a lot with this OpenGL API and libGLdispatch (glvnd) when
in fact this was all just a typo in the code.

GLES 3.1 and the upcoming 3.2 support need a proper test case...

See c68a409874

@fix
2017-05-12 16:34:38 +09:00
Derek Foreman 2653fd3fda gl_drm: Fix rendering problems with dmabuf
Somehow this long standing bug wasn't obvious until wayland 1.13.0 made
some additions to an opaque structure.

This changed the frequency that new buffers came to us with the exact
same pointer value of a buffer that had just been freed.

This shortcut in eng_image_native_set has always been wrong - we need to
proceed to the end to make sure we pick up new dmabuf attributes.
2017-05-10 16:24:11 -05:00
jiin.moon c89bf7b2d8 evas: Fix can't open tiff file on loader
Summary:
Evas can't open tiff file because of no implement in client read api.
I wrote codes simply for open.

Test Plan: self

Reviewers: jpeg, cedric, jypark

Subscribers: stefan_schmidt

Differential Revision: https://phab.enlightenment.org/D4857
2017-05-08 15:20:01 +02:00
Derek Foreman 699ed066ea ecore_drm2: Require x and y value in plane assign
Saves us a flip test, and gaurantees that we're always testing with a
reasonable x, y and not something leftover from a previous assignment.
2017-05-05 12:53:25 -05:00
Derek Foreman 769271a66a drm-ee: Use a plane for the evas
Assign a plane at startup and update it in flip.
2017-05-05 12:53:24 -05:00
Derek Foreman 27fc7d5f83 gl_drm: Support atomic updates
Grab a plane and lock it down for displaying the canvas, update it on
page flip.
2017-05-05 12:53:24 -05:00
Derek Foreman 755577c423 wayland engines: Don't store evas in engine info
We don't need it anymore.
2017-04-26 14:20:47 -05:00
Derek Foreman 92e65ba3c7 wayland_shm: Stop using the evas directly to block for async render
Use the new fence function instead.

This makes Cedric less unhappy.
2017-04-26 14:16:37 -05:00
Derek Foreman a4ed205071 gl_drm:Rename import_simple_dmabuf to gl_import_simple_dmabuf
There's also an ecore_drm2 function to import dmabuf as fb, so it's a
little less confusing to be a little more explicit here.
2017-04-26 13:47:46 -05:00
Stefan Schmidt 40f30f0f31 evas: gl_filters: fix leak of evas image
Make sure we free the allocated use_map evas image before leaving scope.

CID: 1374275
2017-04-26 14:27:30 +02:00
Cedric BAIL 7f5ec0c8ea evas: do not rely on Evas canvas for Evas Ector engine backend. 2017-04-25 16:16:30 -07:00
Cedric BAIL 55e1b3f205 evas: remove engine.data.output.
This is the first step toward handling multi output. This patch
remove engine.data.output from Evas structure and use an Eina_List
for it instead. It also start moving code around to fetch an output
or an engine context (which are the same at the moment, but will be
split in a later patch).
2017-04-24 15:10:48 -07:00
Carsten Haitzler b9991b045c evas gl filter blur - fix uninitialized vare warning for sum 2017-04-21 16:40:36 +09:00
Carsten Haitzler d5848d0dc4 gl filter blur - fix warning about possible uninit vars by initting them 2017-04-21 16:39:20 +09:00
Jean-Philippe Andre d87a65e825 evas gl: Fix compilation for EGL 2017-04-14 13:57:04 +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 5467d1eb3e evas filters: Fix artifacts when scaling up & down
An odd-sized image scaled down by 2 was losing 1 pixel during the
downscale, and it was not restored after scaling up. The same
happened with downscaling by 4 except the effect was even more
visible.

This meant that a moving snapshot with a large blur would trigger
some really ugly sampling issues if the content below was precise
(such a text).
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre fc92a1c0f6 evas filters: Enable down scaling with GL blur
This dramatically improves the performance and now seems
to give acceptable results. Eventually we need a quality flag
in order to enable this or not. Alternatively, "gaussian" blur
mode would skip this optimization, while "default" would trigger
it.
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 45548e8358 evas filters: Implement obscure support for gl blur
This can help with performance when a large region of the
filtered image (eg. snapshot) is fully hidden by an opaque
object. For instance the window border is hidden by the
opaque window content.
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre c53f1526f1 evas: Make save() work on snapshots
This make save() work on snapshot objects, provided the call
is done from inside render_post.

Also, this saves the filtered output of an image, rather than
its source pixels. Any call to save() on a filtered image must
be done from post-render as well.

Fixes T2102

@feature
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre e7eb97f3b0 evas gl: Make sure a deleted image can't be the target
If we delete the image that was the target surface for gl
rendering, a crash would occur on the next render cycle.
Unlikely but not impossible to trigger from app side.

@fix
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 06a7beec52 evas filters: Switch to uniforms in GL blur
This was a poor attempt at improving the performance but
obviously the root cause isn't fixed (too many texel fetches).

Uniform should (theoretically) work better than an attribute
the for loop. Just a guess here.

This also makes GL blur use a float value as radius, allowing
future extension to non-integer blur radii, as well as using
linear scaling as a fast blur approximation.
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 7407a0d073 evas filters: Reduce one log level 2017-04-14 11:26:44 +09:00
Jean-Philippe Andre ebeead4681 evas filters: Optimize GL blur with interpolation
This optimizes the GL blur algorithm by reducing the number of
texel fetches (roughly half the number of before this patch). This
works by exploiting GL's interpolation capabilities.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 6af3c20aeb evas filters: Pass gaussian values to GL blur shader 2017-04-14 11:26:43 +09:00
Jean-Philippe Andre a9ddeeb4fb evas filters: Use GL downscaling for blur
This will improve the performance a lot. Now remains to figure
out the best values for downscaling and improve the actual blur
shader as well.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre e52a04ef8f evas filters: Use obscured region in box blur (SW)
Box blur is used by the default blur (in 2 or 3 passes) so it
is one of the most important and cpu-consuming filters in the
software engine.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre b90246a619 evas: Improve blur filter perf by using 2 passes
By simply splitting X and Y blurs in two passes we can improve
the performance of the blur filter a lot.

There is still much to be done to make it really fast and nice
looking:
- implement true gaussian blur (not sine-based approximation,
  right now the actual blurs look different in SW and GL)
- exploit linear interpolation for R tap instead of R*2+1 taps
  (a tap being a texel fetch)
- downscale & upscale large images with large blur radii
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 5bce7120f1 evas filter: Implement blur filter in pure GL
Wait a second though, this implementation is not only incomplete
(no support for box vs. gaussian blur), it's also insanely bad in
terms of performance. Small radii may work fine, but at least blurs
render properly in GL with this patch (no more glReadPixels!).

The shader needs a lot of love, including in particular:
- support for 1D box blur single pass
- support for 1D gaussian (or sine) blur
- use linear interpolation and N-tap filters
- separation of 2D blur in two passes (high-level logic)
- potentially separation of large 1D blurs in 2 or more passes
  knowing that 2sigma == sigma + sigma when it comes to the gaussian
  bell curve.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 125c7d956e evas filters: Implement displace filter in pure GL
This one was a bit more... "fun". I had to add a new vertex
attribute and obviously using a VertexAttribPointer led to
incomprehensible crashes. But a simple glVertexAttrib2fv makes
it work like a charm!

A rare option is not handled yet.
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 3d2f1a3d9b evas filters: Implement mask filter in pure GL
This reuses the existing mask infrastructure, but adds a color
flag to use the whole RGBA range, rather than just the Alpha
channel.

Filters are still very slow (glReadPixels and non-optimized use of
GL buffers...), but this is progress :)
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 fb52c15e85 evas filters: Prepare GL support for blend operation
No implementation yet, this is just the skeletton!
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 190d84e84b evas: Rename software filter function type
From Evas_Filter_Apply_Func to Software_Filter_Func.
Also fix include dir for out-of-tree builds of non-static sw generic.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre a8d283567a evas filters: Move blur to software generic (8/8)
This completes the series of refactoring patches, where only the
filter implementation is moved to the engine rather than inside
evas itself.
2017-04-14 11:26:43 +09:00
Jean-Philippe Andre 46542ea748 evas filters: Move transform to software generic (7/8) 2017-04-14 11:26:42 +09:00
Jean-Philippe Andre 1b95d22c2c evas filters: Move bump to software generic (6/8) 2017-04-14 11:26:42 +09:00
Jean-Philippe Andre b56a788e96 evas filters: Move displace to software generic (5/8) 2017-04-14 11:26:42 +09:00
Jean-Philippe Andre c9eec74002 evas filters: Move fill to software generic (4/8)
This also moves the header evas_engine_filter.h to its subdir.
2017-04-14 11:26:42 +09:00
Jean-Philippe Andre b6df13b024 evas filters: Move curve to software generic (3/8)
This moves the RGBA premul/unpremul functions to static_libs/draw.
2017-04-14 11:26:42 +09:00
Jean-Philippe Andre 09ff5f419e evas filters: Move mask to software generic (2/8) 2017-04-14 11:26:42 +09:00
Jean-Philippe Andre 0740010a06 evas filters: Move blend to software_generic (1/8)
This is an attempt at refactoring the filters code so I can
later implement GL support. This patch adds a few extra changes
to remove avoid calling functions of libevas from the software
engine: use the draw functions from static_libs/draw rather
than evas_common APIs.
2017-04-14 11:26:42 +09:00