Chris Michael [Mon, 27 Mar 2017 15:54:38 +0000 (11:54 -0400)]
ecore-drm2: Add hardware plane functions
This patch adds a new file where we can store any additional functions
we may need to work with hardware planes. Currently the file contains
a public function that can be used to assign a given Ecore_Drm2_Fb to
a hardware plane
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Chris Michael [Mon, 27 Mar 2017 15:53:54 +0000 (11:53 -0400)]
ecore-drm2: Cleanup list of output planes on output_destroy
Small patch to make sure we free memory previously allocated for
hardware planes when we destroy an output
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Chris Michael [Mon, 27 Mar 2017 15:52:44 +0000 (11:52 -0400)]
ecore-drm2: Move defines for CAP_CURSOR sizes to private header
As we may need these defines in other files, move them to the private
header so there is access to them.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Chris Michael [Mon, 27 Mar 2017 14:56:50 +0000 (10:56 -0400)]
ecore-drm2: Store cursor size on device
As we will need these values later to determine if an FBO can go onto
the cursor plane, we should store this in the device structure to
avoid having to refetch them later.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Chris Michael [Mon, 27 Mar 2017 14:53:01 +0000 (10:53 -0400)]
ecore-drm2: Support multiple planes on a given output
Various hardware can support multiple planes on a given output. As
such, we need to be able to store multiple plane states per-output.
This small patch adds support for that.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Chris Michael [Mon, 27 Mar 2017 14:50:52 +0000 (10:50 -0400)]
ecore-drm2: Add support for plane formats
Small patch to store supported formats on a given plane state. This
will be used for assigning dmabuf clients to a hardware plane based on
size and supported format.
@feature
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Chris Michael [Mon, 27 Mar 2017 13:27:19 +0000 (09:27 -0400)]
ecore-drm2: Remove old atomic flipping code
As we are refactoring the usage of hardware planes and atomic commits,
we need to remove the old usage of atomic flipping for ecore_drm2_fb
because atomic flipping will be handled differently.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Chris Michael [Fri, 24 Mar 2017 12:01:51 +0000 (08:01 -0400)]
ecore-drm2: Add opaque structure to represent a hardware plane
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Chris Michael [Thu, 23 Mar 2017 15:52:15 +0000 (11:52 -0400)]
ecore-drm2: Disable driver whitelist tests
While having the ability to test for specific driver and kernel
versions is nice to ensure that Atomic is supported, it quickly can
get out of hand trying to maintain this whitelist so (for now) disable
it and rely on the kernel results from drmSetCap.
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Derek Foreman [Tue, 21 Mar 2017 20:44:46 +0000 (15:44 -0500)]
ecore_drm2: Add ecore_drm2_fb_dmabuf_import
Imports a set of dmabuf buffers as a single Ecore_Drm2_Fb
Derek Foreman [Tue, 21 Mar 2017 19:22:40 +0000 (14:22 -0500)]
ecore_drm2: store 4 handles, strides, and planes
We're going to support multi-planar formats soon.
It'll be great, you'll love it.
Derek Foreman [Tue, 21 Mar 2017 19:21:14 +0000 (14:21 -0500)]
ecore_drm2: Use library function instead of ioctl for addfb2
Minor clean up.
Jean-Philippe Andre [Tue, 18 Apr 2017 05:16:31 +0000 (14:16 +0900)]
eo: Use COW to save 8~16 bytes per object
Summary:
This uses Eina_Cow to implement support for rarely used features
in EO objects. This covers:
- composite objects (eg. UI widgets: combobox, text, video, win)
- vtable for efl_object_override
- del_intercept
All of these features are quite tricky to get right and while
very useful, should still be used with great care. With this patch,
the size of an _Eo_Object struct comes down from 80 bytes (rounded
up from 72b) to 64 bytes (rounded up from 56b) on 64 bits.
Also I haven't measured precisely but I don't expect any performance
impact since the COW data is more likely to remain in L1/L2 cache,
as the default one will be used most often. Unfortunately, the
results of "make benchmark" have been quite inconsistent over
multiple runs.
This saves ~64kb in elementary_test (>4k objects) at the cost of
~100 calls to COW write (del intercept on some events).
@optimization
Reviewers: raster, cedric
Differential Revision: https://phab.enlightenment.org/D4796
Jeeyong Um [Tue, 18 Apr 2017 08:19:56 +0000 (17:19 +0900)]
edje_cc: Clean up repeated code in color setter
Summary: Remove duplicated code
Reviewers: jpeg, cedric
Reviewed By: jpeg
Subscribers: bu5hm4n
Differential Revision: https://phab.enlightenment.org/D4769
Bryce Harrington [Tue, 18 Apr 2017 07:18:56 +0000 (16:18 +0900)]
ecore_evas: Unnecessary to test p before calling free(p)
Summary:
Modern, standards-compliant compilers already test p, so as per the C
spec it is superfluous to do so before the call.
Reviewers: jpeg
Reviewed By: jpeg
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4791
Vyacheslav Reutskiy [Tue, 18 Apr 2017 08:29:29 +0000 (11:29 +0300)]
elm_filselector: don't force the icon size
A icon in the files view, mode grid, should not apply size bigger then
swallow for it. This commit additional fix for
52ddf9331a6eceac4b11fade920a7c6e85fe8a38
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 08:27:21 +0000 (17:27 +0900)]
ecore file - use eina_file_mkstmp to solve umask complaint
this fixes coverity CID 1039614
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 07:58:04 +0000 (16:58 +0900)]
genlist - fix coverity complaint about null check
we checked for null and then just used a null return later inthe loop.
this fixes that. this should fix CID 1360955
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 07:49:39 +0000 (16:49 +0900)]
eina log - try and fix coverity complaint about integer overflow again
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.
CID 1361219
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 07:40:04 +0000 (16:40 +0900)]
eina log - try and fix coverity complaint about integer overflow again
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.
CID 1361220
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 06:55:12 +0000 (15:55 +0900)]
efreet cache create - check return values of i/o funcs
this is pretty harmless but it checks these and at least reports an
error...
this fixes CID 1361941 + 1361940
@fix
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 06:40:23 +0000 (15:40 +0900)]
evas key lock state set - remove dead code
l is checked for NULL twice. this removes the pointless second check.
@fix
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 06:38:32 +0000 (15:38 +0900)]
evas key modifier state set - remove dead code
m is checked for NULL twice. this removes the pointless second check.
@fix
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 06:13:28 +0000 (15:13 +0900)]
evas - table - remove logically dead code
this is right - it is dead code. this fixes CID 1372487
@fix
Jeeyong Um [Tue, 18 Apr 2017 07:50:26 +0000 (16:50 +0900)]
AUTHORS: Add Sungtaek Hong to the authors file
Sungtaek Hong [Tue, 18 Apr 2017 07:48:04 +0000 (16:48 +0900)]
edje_cc: add short state handler for part.description.clip_to
Summary:
part.clip_to statement has short handler named "part.clip"
while part.description.clip_to does not.
Its short handler name should be "part.description.clip"
in order to have same experience with "part.clip".
Reviewers: cedric, Hermet, jpeg, conr2d
Reviewed By: conr2d
Subscribers: conr2d
Differential Revision: https://phab.enlightenment.org/D4789
Jihoon Kim [Tue, 18 Apr 2017 07:18:10 +0000 (16:18 +0900)]
ecore_imf: Added a new ecore_imf_context_keyboard_mode_get API and input_panel_event_callback type
Summary:
Applications want to know the current keyboard mode state to handle application's size manually.
So added a new ecore_imf_context_keyboard_mode_get API and input_panel_event_callback type for
keyboard mode.
Test Plan: Tested in Tizen device
Reviewers: jihoon, woohyun, id213sin
Reviewed By: jihoon
Subscribers: cedric, jsuya, z-wony, jpeg
Differential Revision: https://phab.enlightenment.org/D4790
Vyacheslav Reutskiy [Tue, 18 Apr 2017 06:25:51 +0000 (09:25 +0300)]
elm_fileselector: fix thumbnail size for other themes bisides default
Elm_fileselector has the hardcoded value for calculate the item size
with thumbail, this size was 16, it's looks like thumbnail size plus
labal text height, but hardcoded value haven't effect to scale. Other
problem with items without labels. As a result we have correct
thumbnail size only with default theme and with scale 1.0.
This commit made the item size accordingly to size what user set. It's
made more clearly this API behavior.
@fix
Vyacheslav Reutskiy [Fri, 14 Apr 2017 08:23:47 +0000 (11:23 +0300)]
fileselector: apply style for files view
By some reason style does not applyed to genlist/gengrid in
fileselector. Also fixed issue with applyed style for files view on
change mode. Now this problem is fixed.
@fix
Jean-Philippe Andre [Mon, 17 Apr 2017 04:41:29 +0000 (13:41 +0900)]
eo/elm: Simplify box/grid EO API
After talking with @eunue I realised that the way I'd first
implemented the box/grid "pack" API was simply too complicated.
I had tried to make it possible to change the layout function
at runtime, like good old evas box, but since there are no function
pointers in EO the final design was really convoluted.
If someone really needs to change the layout of a box at runtime,
just create your own subclass, or unpack all items and repack them
in a new box.
Note: there are still some issues with the layout params & flow
Jean-Philippe Andre [Mon, 17 Apr 2017 10:39:42 +0000 (19:39 +0900)]
eo: Fix crash in case of API misuse
If efl_object_override() is called with a function that does
not exist in the original class, it may lead to a crash on
indexing an non-existing array in the vtable.
This is really just a safety check, as the usage was wrong:
* You are only allowed to override functions that are defined in the
* class or any of its interfaces (that is, efl_isa returning true).
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 05:30:22 +0000 (14:30 +0900)]
ecore pipe - fix checking return of read for pipes in new code
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 05:21:06 +0000 (14:21 +0900)]
ecore pipe - fix new coverity complaint about using closed socket
this should fix CID 1374297
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 05:16:53 +0000 (14:16 +0900)]
ecore pipe - fix potential use of freed pipe data
new thanks to new patches so not an existing bug in the last release
Carsten Haitzler (Rasterman) [Tue, 18 Apr 2017 00:55:50 +0000 (09:55 +0900)]
ecore pipe - clean up formatting a bit
Jean-Philippe Andre [Tue, 18 Apr 2017 01:55:14 +0000 (10:55 +0900)]
efl: Remove manual definitions of event "changed"
Honestly I can't see why gfx & gfx.path "changed" need a manual
definition, instead of relying on EO. If the API needs to be
internal only, then EO needs to handle internal APIs. In this
case, the event was exposed as a C API but not a EO... why?
Woochan Lee [Tue, 18 Apr 2017 01:17:06 +0000 (10:17 +0900)]
elm_calendar: Improve code quality.
Summary:
The values(259200, 86400) are hard to know the meaning.
And we don't have to call gmtime() in for loop.
Test Plan: elementary_test -> calendar
Reviewers: jpeg, Hermet, shilpasingh, cedric
Reviewed By: cedric
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4717
Derek Foreman [Mon, 17 Apr 2017 22:06:28 +0000 (17:06 -0500)]
Fix sed error that changed "video" to "videfl"
commit
c662934be8bcbaba60d1688e77533acbea5d09b9 seems to have accidentally
renamed a few instances of _video_ to _videfl_, this hopefully changes
them all back.
Derek Foreman [Mon, 17 Apr 2017 19:45:14 +0000 (14:45 -0500)]
ecore_wl2: Remove unused code
ecore_wl2 contains a bunch of code for compositor side seat handling.
There's really no need for a client to do this, and E does the
compositor side seat stuff internally, so this code will never
be used.
This removes the unused code.
Carsten Haitzler (Rasterman) [Mon, 17 Apr 2017 08:23:19 +0000 (17:23 +0900)]
Revert "ecore_imf: Add ecore_imf_context_keyboard_mode_get API"
This reverts commit
4533eef59b3b84c28ed6cd5814d753291df3f6f1.
this commit breaks efl's build and can't be fixed - missing types.
Carsten Haitzler (Rasterman) [Mon, 17 Apr 2017 08:01:58 +0000 (17:01 +0900)]
ecore pipe - fix cast warning by casting (validly)
Jean Guyomarc'h [Mon, 17 Apr 2017 07:55:34 +0000 (09:55 +0200)]
ecore: fix build on macOS
Epoll/timerfd is not available on "everything but Windows".
This fixes
a76ebea2d840ecc575efb025574c15503225b83f.
Jihoon Kim [Mon, 17 Apr 2017 07:53:50 +0000 (16:53 +0900)]
ecore_imf: Add ecore_imf_context_keyboard_mode_get API
Summary:
When the keyboard mode state is changed, the keyboard_mode_event_cb will be called, too.
But there is no way to get keyboard mode manually.
Test Plan: Tested in Tizen device
Reviewers: jihoon, woohyun, id213sin
Reviewed By: jihoon
Subscribers: jpeg, z-wony, jsuya, cedric
Differential Revision: https://phab.enlightenment.org/D4786
Carsten Haitzler (Rasterman) [Mon, 17 Apr 2017 05:23:33 +0000 (14:23 +0900)]
ecore_pipe - fix recent patch to close on exec the epoll fd
Ivan Furs [Mon, 17 Apr 2017 03:28:41 +0000 (12:28 +0900)]
ecore_pipe: added epoll
Summary: integration epoll in ecore_pipe
Reviewers: cedric, NikaWhite, rimmed, an.kroitor, vtorri, raster
Reviewed By: raster
Subscribers: artem.popov, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4754
Ivan Furs [Mon, 17 Apr 2017 02:51:05 +0000 (11:51 +0900)]
eina: For Windows fix crash when the file was opened many times.
Summary:
A similar problem as:
commit
62b469749a4b
Reviewers: NikaWhite, t.naumenko, an.kroitor, FurryMyad, cedric, raster, vtorri, rimmed
Reviewed By: raster
Subscribers: artem.popov, cedric, jpeg
Tags: #windows, #efl
Differential Revision: https://phab.enlightenment.org/D4788
Carsten Haitzler (Rasterman) [Mon, 17 Apr 2017 02:31:22 +0000 (11:31 +0900)]
elm test - fix windows compilation as _close is used in windows
fix T5391 - windows compilation due to symbol clash
@fix
Carsten Haitzler (Rasterman) [Sun, 16 Apr 2017 03:56:11 +0000 (12:56 +0900)]
emotion - gstreamer1 - fix yuv import funcs to use gst stride + offset
so our yuv import funcs for gstreamer 1.x engine were ignoring the
plane offsets and strides provided by gstreamer. though this nicely
shows that these numbers provided are actually wrong - at least in the
testing with vaapi back-ends with gst.
so this fixes emotions' badness but there is still badness in gst
apparently. the numbers provided if used are just simply wrong for teh
image data. commented code in the src to show how to "Fix it up" by
forcing some alignment of content to get it to work.
@fix
Jean-Philippe Andre [Fri, 14 Apr 2017 04:43:09 +0000 (13:43 +0900)]
evas gl: Fix compilation for EGL
Jean-Philippe Andre [Fri, 14 Apr 2017 03:04:27 +0000 (12:04 +0900)]
makefile: Fix make dist (with filters)
Jean-Philippe Andre [Fri, 14 Apr 2017 02:07:04 +0000 (11:07 +0900)]
evas filters: Fix rare crash with async render
Reported by bu5hm4n
@fix (backport will look slightly different)
Jean-Philippe Andre [Thu, 13 Apr 2017 03:08:31 +0000 (12:08 +0900)]
evas filters: Fix async RW rendering
This fixes a crash (when deleting the output image), and rearranges
the code a bit.
Jean-Philippe Andre [Wed, 5 Apr 2017 10:19:36 +0000 (19:19 +0900)]
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.
Jean-Philippe Andre [Wed, 5 Apr 2017 06:32:07 +0000 (15:32 +0900)]
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).
Jean-Philippe Andre [Tue, 4 Apr 2017 09:51:34 +0000 (18:51 +0900)]
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).
Jean-Philippe Andre [Tue, 4 Apr 2017 05:28:29 +0000 (14:28 +0900)]
evas filters: Fix maps with filtered snapshots
Another wonder of evas render... maps, clips, snapshots, filters...
This fixes animations with windows that have a snapshot decoration.
Jean-Philippe Andre [Tue, 4 Apr 2017 01:25:05 +0000 (10:25 +0900)]
evas filters: Prevent redraws when obscure changed
If the obscured area in a snapshot object changes a lot, do
not try to keep track of it forever. Instead, redraw the filter
over the entire object region, without obscure.
This fixes a performance issue when an opaque window is moved
above a fixed transparent window (the latter has a snapshot with
blur filter).
Jean-Philippe Andre [Mon, 3 Apr 2017 12:24:07 +0000 (21:24 +0900)]
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.
Jean-Philippe Andre [Mon, 3 Apr 2017 06:34:10 +0000 (15:34 +0900)]
evas filters: Avoid creating input buffer for images
When the filtered object is an image, without borders, map,
fill info or anything of this sort, then the filter input
buffer is really just a copy of the original image. We can
skip that to save on memory usage and pixel fetches.
Jean-Philippe Andre [Fri, 31 Mar 2017 04:10:41 +0000 (13:10 +0900)]
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.
Jean-Philippe Andre [Thu, 30 Mar 2017 04:52:48 +0000 (13:52 +0900)]
evas: Fix cutout handling for snapshot objects
This improves over the previous code for handling
snapshot objects and cutouts. Basically any opaque object
above a snapshot should be obscuring it. That is true
unless a crazy filter is applied, or the snapshot object
is itself the source of a map or proxy.
This also uses eina_tiler instead of a custom (and really
bad) algorithm to compute the obscure regions.
Jean-Philippe Andre [Tue, 28 Mar 2017 07:09:34 +0000 (16:09 +0900)]
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
Jean-Philippe Andre [Thu, 30 Mar 2017 01:26:24 +0000 (10:26 +0900)]
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
Jean-Philippe Andre [Tue, 28 Mar 2017 05:44:17 +0000 (14:44 +0900)]
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.
Jean-Philippe Andre [Tue, 28 Mar 2017 05:40:29 +0000 (14:40 +0900)]
evas image: Factorize some code for render
This factorizes some of the common code for image render
and resolving is_inside (verifying alpha value of a pixel).
This should also be used by save(), as well as buffer_map().
This patch introduces lots of whitespace changes by using return
instead of long if() {} or else {} blocks.
Jean-Philippe Andre [Thu, 23 Mar 2017 06:55:41 +0000 (15:55 +0900)]
evas filters: Force redraw of snapshot if cutout shrank
The situation is clearly visible in the Snapshot test case:
increase the radius and a red glow would appear. This is because
the snapshot object was not marked as needing redraw and so had
no pixels under the opaque rectangle.
Jean-Philippe Andre [Thu, 23 Mar 2017 07:22:43 +0000 (16:22 +0900)]
evas filters: Move private data out of evas headers
This moves the filter internal data back to the filters
implementation, rather than inside evas common headers.
Jean-Philippe Andre [Wed, 22 Mar 2017 11:51:53 +0000 (20:51 +0900)]
evas: Fix excessive redraws of snapshot objects
Jean-Philippe Andre [Wed, 22 Mar 2017 07:55:26 +0000 (16:55 +0900)]
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.
Jean-Philippe Andre [Wed, 22 Mar 2017 10:21:24 +0000 (19:21 +0900)]
evas filters: Reduce one log level
Jean-Philippe Andre [Wed, 22 Mar 2017 10:18:41 +0000 (19:18 +0900)]
evas filters: Remove warning about OpenGL
Well... I'm working on making all this work, so the log
is a bit irrelevant now.
Jean-Philippe Andre [Wed, 22 Mar 2017 07:16:22 +0000 (16:16 +0900)]
evas filters: Avoid unnecessary draw
This avoids creating one more FBO and doing one more draw,
by rendering the image input data directly into the input
buffer. This also makes the code common between SW and GL.
Jean-Philippe Andre [Tue, 21 Mar 2017 10:06:05 +0000 (19:06 +0900)]
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.
Jean-Philippe Andre [Mon, 20 Mar 2017 14:25:05 +0000 (23:25 +0900)]
evas filters: Pass gaussian values to GL blur shader
Jean-Philippe Andre [Mon, 20 Mar 2017 11:20:21 +0000 (20:20 +0900)]
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.
Jean-Philippe Andre [Mon, 20 Mar 2017 11:16:19 +0000 (20:16 +0900)]
evas filters: Recompile filter after data_set
Jean-Philippe Andre [Mon, 20 Mar 2017 10:57:56 +0000 (19:57 +0900)]
elm_test: Add slider to control blur radius
Jean-Philippe Andre [Fri, 17 Mar 2017 05:54:40 +0000 (14:54 +0900)]
evas: Consider objects in copy mode as opaque
This skips extra tests with image objects that have the
is_opaque() function. That way, if an object is marked as COPY,
rendering of all objects below it will be skipped.
This can dramatically help with performance when flagging a
snapshot object as COPY. This should not be done if a filter is
applied and is meant to blend with the underlying UI.
Jean-Philippe Andre [Fri, 17 Mar 2017 02:24:10 +0000 (11:24 +0900)]
evas filters: Expand snapshot regions by blur radius
When using a snapshot object we have access to exactly all
the pixels below it inside the snapshot surface. So, in order
to produce a nice blur, it is necessary to expand this snapshot
and then clip it otherwise the edges will look a bit ugly.
Unfortunately, there are still places where blurs didn't look
so good, as objects below an opaque region would never get
rendered into the snapshot object. So the edges, inside a
snapshot object, around an opaque region would have blur
artifacts.
This fixes that by shrinking the cutout regions by the radius
of the filter. Eg for blur this is the blur radius.
The test case in elm_test can exhibit this fix very clearly:
a red glow would be visible around the opaque rectangle, but with
these changes we instead see the blurry edges of the objects
below the rectangle.
Jean-Philippe Andre [Wed, 15 Mar 2017 05:51:51 +0000 (14:51 +0900)]
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.
Jean-Philippe Andre [Wed, 15 Mar 2017 07:37:31 +0000 (16:37 +0900)]
elm_test: Add obscuring rectangle in snapshot test
This will test the obscured region optimization for the
filters.
Jean-Philippe Andre [Wed, 15 Mar 2017 05:49:50 +0000 (14:49 +0900)]
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.
Jean-Philippe Andre [Fri, 10 Feb 2017 07:08:58 +0000 (16:08 +0900)]
evas: Optimize redraws of snapshot objects
If anything in the canvas needs redraw and a snapshot object
happens to intersect with the update region then it was redrawn,
even if all objects below it hadn't changed. This has an insane
performance impact when you apply a blur filter on the snapshot
object. Walking the object list will always be cheaper than
rendering the snapshot!
Note: Added a FIXME comment and forced clean_them to be true
because some odd behaviour happens when breaking with GDB and
the array snapshot_objects keeps growing at each frame (I guess
only if we miss a frame or something like that).
Jean-Philippe Andre [Fri, 10 Feb 2017 06:26:53 +0000 (15:26 +0900)]
elm_test: Add a test case for evas snapshot
This showcases the object (not a widget) and will be the basis
for a necessary optimization patch.
Jean-Philippe Andre [Tue, 7 Feb 2017 09:48:46 +0000 (18:48 +0900)]
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
Jean-Philippe Andre [Wed, 25 Jan 2017 09:06:29 +0000 (18:06 +0900)]
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.
Jean-Philippe Andre [Tue, 24 Jan 2017 06:28:18 +0000 (15:28 +0900)]
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.
Jean-Philippe Andre [Tue, 24 Jan 2017 06:39:29 +0000 (15:39 +0900)]
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.
Jean-Philippe Andre [Tue, 24 Jan 2017 05:23:03 +0000 (14:23 +0900)]
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 :)
Jean-Philippe Andre [Mon, 23 Jan 2017 08:55:17 +0000 (17:55 +0900)]
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).
Jean-Philippe Andre [Wed, 18 Jan 2017 02:47:25 +0000 (11:47 +0900)]
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 ;)
Jean-Philippe Andre [Tue, 17 Jan 2017 12:34:48 +0000 (21:34 +0900)]
evas filters: Prepare GL support for blend operation
No implementation yet, this is just the skeletton!
Jean-Philippe Andre [Tue, 17 Jan 2017 13:15:09 +0000 (22:15 +0900)]
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.
Jean-Philippe Andre [Tue, 17 Jan 2017 12:18:46 +0000 (21:18 +0900)]
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.
Jean-Philippe Andre [Tue, 17 Jan 2017 12:09:18 +0000 (21:09 +0900)]
evas filters: Move transform to software generic (7/8)
Jean-Philippe Andre [Tue, 17 Jan 2017 12:00:36 +0000 (21:00 +0900)]
evas filters: Move bump to software generic (6/8)
Jean-Philippe Andre [Tue, 17 Jan 2017 11:56:33 +0000 (20:56 +0900)]
evas filters: Move displace to software generic (5/8)
Jean-Philippe Andre [Tue, 17 Jan 2017 11:48:31 +0000 (20:48 +0900)]
evas filters: Move fill to software generic (4/8)
This also moves the header evas_engine_filter.h to its subdir.
Jean-Philippe Andre [Tue, 17 Jan 2017 11:34:16 +0000 (20:34 +0900)]
evas filters: Move curve to software generic (3/8)
This moves the RGBA premul/unpremul functions to static_libs/draw.
Jean-Philippe Andre [Tue, 17 Jan 2017 10:33:50 +0000 (19:33 +0900)]
evas filters: Move mask to software generic (2/8)