Commit Graph

302 Commits

Author SHA1 Message Date
Jean-Philippe Andre 505aca0e42 evas: Fix compilation warnings
See 7365c087c7
Shadow variable.
2017-06-29 16:02:36 +09:00
Derek Foreman 7365c087c7 evas_render: Use hardware planes
This is a very simple proof of concept for using hardware planes for
evas image objects.

Right now only dmabuf objects will be dropped into planes, and they're
considered in the order they're in in the scene graph with no attention
paid to which objects will have the most benefit from being on a plane
at all.  There's nothing to prevent your mouse cursor from consuming the
only hardware plane capable of UHD video. :)

This is mostly just to help test the low level functionality in the
engines and ecore_drm2 that enable hardware planes.  Smarter plane usage
is coming.
2017-06-23 08:15:42 -05:00
Cedric BAIL 35e54acc46 evas: stat introducing a concept of engine and output in the backend. 2017-05-12 15:24:45 -07:00
Mike Blumenkrantz ef471e4eca evas: ensure even no-op renders emit RENDER_PRE
ref 67fae7aa0fdc9d778e8db88fc49bc149576994d2
2017-05-12 12:08:24 -04:00
Jean-Philippe Andre 0a224da86f evas map: Introduce new API for maps (Efl.Gfx.Map)
This implements an entirely new API model for Evas Map by relying
on high-level transformations on the object rather than an external
Evas_Map structure that needs to be constantly updated manually.

The implementation relies on Evas_Map.

To rotate an object all you need to do now is
  efl_gfx_map_rotate(obj, 45.0, NULL, 0.5, 0.5);

Or with a C++ syntax:
  obj.rotate(45.0, NULL, 0.5, 0.5);

Or even simply (with default arguments):
  obj.rotate(45.0);

The map transformation functions are:
 - rotate
 - rotate_3d
 - rotate_quat
 - zoom
 - translate (new!)
 - perspective_3d
 - lightning_3d

@feature
2017-05-11 17:54:00 +09:00
Cedric BAIL 688cbeae97 evas: make sure that even when nothing is rendered there is a pair of RENDER_PRE and RENDER_POST events generated. 2017-05-09 15:40:14 -07:00
Cedric Bail dc841ed9b2 evas: always pair RENDER_PRE and RENDER_POST. 2017-05-05 17:55:06 -07:00
Cedric Bail 689e1c8ded evas: don't double check if the canvas has changed. 2017-05-05 17:55:06 -07:00
Cedric BAIL 849a182018 evas: only call output function on initialized output. 2017-04-28 16:11:23 -07:00
Jean-Philippe Andre ac121a628d evas: Fix crash in idle_flush
As reported by raster on the ML. The pointer passed to the
engines is not an engine output but an Efl_Canvas_Output.
2017-04-25 21:19:42 +09:00
Jean-Philippe Andre b25d464f9f evas render: Fix issue with map render
Test case:
  elementary_test -to "Gesture Layer"

Just move the pictures around (eg. to the bottom). They could
disappear entirely.

This is because the geometry used was based on the smart
object "bounding box" rather than the mapped output.

@fix
2017-04-25 14:37:00 +09: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
Derek Foreman fddbf75fc9 Fix sed error that changed "video" to "videfl"
commit c662934be8 seems to have accidentally
renamed a few instances of _video_ to _videfl_, this hopefully changes
them all back.
2017-04-17 17:06:28 -05:00
Jean-Philippe Andre 4cbff5f0ea 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.
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 08a8072571 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.
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 530399acde 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.
2017-04-14 11:26:44 +09:00
Jean-Philippe Andre b6c5af5edc evas: Fix excessive redraws of snapshot objects 2017-04-14 11:26:44 +09:00
Jean-Philippe Andre 1336b2d9e0 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.
2017-04-14 11:26:43 +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 a6951397f6 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).
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
Cedric BAIL 8280e523ee evas: always send a proper event to simplify callee logic.
@fix
2017-04-06 13:31:53 -07:00
Jean-Philippe Andre 1bfce47bf3 evas: Fix non-disappearance of text entry cursor
The mouse cursor in a text entry tends to not disappear even when
the mouse moves out of the entry. This seems to happen more when
the cursor was visible for a single frame only (although I'm not
100% sure about this condition).

One important difference with previous versions of EFL is that
the cursor is now part of the theme, so it is an image object
and not set by the compositor (it looks vastly different).

Anyway, when processing the list of pending_objects, we look at
the flags render_pre and rect_del which were (re)set during the
previous frame. Those flags are then (re)set during phase 1 which
happens after processing the pending objects list... only if
needed. So, phase 1 sets the condition to invalidate the current
lists of objects but that condition is checked for before phase 1.

This patch adds a check on delete_me which should hopefully make
it a rare enough case, for performance, but still force correct
rendering.

This is all spaghetti code, sorry if this explanation also reads
like pasta.

Note that exactness tests may still be broken because earlier
versions of EFL simply did not have the cursor inside the canvas
itself.

Fixes T5231
2017-03-06 17:04:26 +09:00
jiin.moon f506f65141 evas: Fix double clipping issue with map
If object's parent has map and object also has map, the evas
clip would be applied twice.

The context already applied clip area when drawing on map_surface.
So don't need more clipping when drawing map_image.

Also, make sure to apply the framespace clip when drawing the map
surface onto the final canvas. Thanks @jiin.moon for the initial
patch (see D4694).

@fix

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2017-03-02 16:43:47 +09:00
Jean-Philippe Andre 51765b8b9f evas: Avoid data_scope_get in internal function 2017-02-21 12:24:56 +09:00
Jean-Philippe Andre 0d555dda7f evas: Optimize out some calls to data_scope_get
Within evas when we know an object is marked as is_smart, then
we know it's a smart object. :)

@optimize
2017-02-21 10:52:40 +09:00
Jean-Philippe Andre d150cdfd9d evas: Assume object is valid and avoid call to efl_isa
In an internal function we should be able to safely assume an
object is indeed a smart object.

@optimization
2017-02-21 10:52:39 +09:00
Jean-Philippe Andre b7213f2d64 evas_render: Remove data_unref that has no data_ref 2017-02-15 15:35:38 +09:00
Carsten Haitzler 51638afbeb evas render - drop eo overhead by using ptrs we already have
several calls, specifically evas_object_change_reset,
evas_object_cur_prev, and evas_object_clip_changes_clean that are
called directly or indirectly as part of evas render on at least every
active object if not more, were doing full eo obj lookups when their
calling functions already all had the eo protected data looked up.
tha's silly and just adds overhead we don't need. my test dropped
_eo_obj_pointer_get overhead in perf profiles from 4.48% to 2.65%. see:

   4.48%  libeo.so.1.18.99            [.] _eo_obj_pointer_get
   4.23%  libevas.so.1.18.99          [.] evas_render_updates_internal
   2.61%  libevas.so.1.18.99          [.] evas_render_updates_internal_loop
   1.68%  libeo.so.1.18.99            [.] efl_data_scope_get
   1.57%  libc-2.24.so                [.] _int_malloc
   1.42%  libevas.so.1.18.99          [.] evas_object_smart_changed_get
   1.09%  libevas.so.1.18.99          [.] evas_object_clip_recalc.part.37
   1.08%  libpthread-2.24.so          [.] pthread_getspecific
   1.05%  libevas.so.1.18.99          [.] efl_canvas_object_class_get
   1.01%  libevas.so.1.18.99          [.] evas_object_cur_prev
   0.99%  libeo.so.1.18.99            [.] _efl_object_event_callback_legacy_call
   0.87%  libevas.so.1.18.99          [.] _evas_render_phase1_object_ctx_render_cache_append
   0.82%  libpthread-2.24.so          [.] pthread_mutex_lock
   0.81%  libevas.so.1.18.99          [.] _evas_render_phase1_object_process
   0.79%  libc-2.24.so                [.] _int_free

vs now the improved:

   4.82%  libevas.so.1.18.99          [.] evas_render_updates_internal
   3.44%  libevas.so.1.18.99          [.] evas_render_updates_internal_loop
   2.65%  libeo.so.1.18.99            [.] _eo_obj_pointer_get
   2.22%  libc-2.24.so                [.] _int_malloc
   1.46%  libevas.so.1.18.99          [.] evas_object_smart_changed_get
   1.04%  libeo.so.1.18.99            [.] _efl_object_event_callback_legacy_call
   1.03%  libevas.so.1.18.99          [.] _evas_render_phase1_object_ctx_render_cache_append
   0.97%  libeina.so.1.18.99          [.] eina_chained_mempool_malloc
   0.93%  libevas.so.1.18.99          [.] evas_object_clip_recalc.part.37
   0.92%  libpthread-2.24.so          [.] pthread_mutex_lock
   0.91%  libevas.so.1.18.99          [.] _evas_render_phase1_object_process
   0.84%  libc-2.24.so                [.] _int_free
   0.84%  libevas.so.1.18.99          [.] evas_object_cur_prev
   0.83%  libeina.so.1.18.99          [.] eina_chained_mempool_free
   0.80%  libeo.so.1.18.99            [.] efl_data_scope_get

of course other things "increase their percentage" as oe overhead now
dropped, and things seem to move around a bit, but it does make sense
to do this with no downsides i can see as we already are accessing the
protected data ptr in the parent func.
2017-02-04 11:49:56 +09:00
Carsten Haitzler a279852c86 evas - proxy - fix clipping of proxy renders that broke terminology
so proxies just rendered nothing when used in terminology. they used
to work for the tab switcher (ctl+shift+home). this now works again.

there is a good chance this may break something else though... what i
can't seem to find...

this fixes T5131
2017-01-25 18:44:58 +09:00
Jean-Philippe Andre c2ba0939d8 evas: Add a very simple post-render job list
This will be used by the filters
2017-01-17 14:35:27 +09:00
Jean-Philippe Andre 3f24b6ea2f evas: Use eina_slstr to simplify render debug
Only enabled if REND_DBG is manually enabled inside evas_render.c
2017-01-17 14:21:13 +09:00
Carsten Haitzler b0530aba4f evas cutouts - quickly avoid huge per issues with large nos of cutouts
i found evas_common_draw_context_apply_cutouts() was procsessing 300+
cutouts and as it's O(n^2)/2 to try and merge adjacent rects for
cutouts this really performs like complete junk. we apply cutout rects
a LOT. this is not the best solution, but it's quick and much faster
than doing the clipouts which drop framerate to like 1-2fps or so in the
nasty case i say (tyls -m of photos in a dir with a 2160 high
terminal).

this figures out the target area to limit the count of rects
significantly so O(n^2) is far far better when n is now < 10 most of
the time. and for the few operations where it's a high value this now
uses qsort to speed up merges etc. etc.

@optimize
2017-01-02 18:53:56 +09:00
Jean-Philippe Andre a28cb93d0d Revert "evas: Add source_region property to proxy objects"
This reverts commit 4e110a34bf.

Urgh. I'm stupid. Conceptually I still like the idea of the
region proxy, that only renders part of the source object
in a proxy surface. The problem right now is that the proxy
subrender mechanism renders to a surface that belongs to
the **source** and not the proxy object. As a consequence,
the region would become a property of the source, rather than
the proxy, which is not at all the intention of the original
patch. In other words, everything would fall apart if an object
has more than one proxy, for whatever reason.

I realized that when trying to actually test the region proxy.
It didn't work at all. Revert for now.
2016-12-20 15:47:54 +09:00
Jean-Philippe Andre 03eb4c6409 evas: Fix issues with masking (make check)
After a previous patch, mask_subrender worked differently, and
didn't reset the object's cache clip color. This made evas_suite
fail. But also it seems some other issues creeped in and it was
necessary to fix the test case by adding data_updates (mistake!)
and removing an invalid draw call.
2016-12-16 17:10:01 +09:00
Jean-Philippe Andre 489815457b evas: Apply clip when rendering a masked mask
This fixes a rare crash in the SW engine when a masked mask is
to be rerendered. The clip adds more safety as the lower render
draw functions assume it is properly set.
2016-12-16 15:21:01 +09:00
Jean-Philippe Andre e3b8bcc771 evas: Change int into a single bit
clean_layer is a bool
2016-12-16 14:35:52 +09:00
Jean-Philippe Andre b0c67adb10 evas: Fix masks of masks
Don't ask. This is a world of magic.
2016-12-16 14:09:00 +09:00
Jean-Philippe Andre 2bed30b398 evas: "fix" masks of masks inside a proxy
Here's the situation:

1. A container (genlist) has a mask, M0.
2. An item I0 inside this container uses a proxy P0 as render object
   rather than the item directly (eg. for zooming in/out).
3. An element E0 inside this item has another mask, M1.

Theory:
1. The proxy surface for P0 is rendered, and M1 is applied to
   the element E0.
2. The proxy P0 is rendered on the canvas, with M0 applied.

Practice:
1. The element E0 is prepared for rendering, this triggers
   a mask subrender for M1.
2. M1 is rendered with M0 as a prev mask, then kept in cache and
   not redrawn (no geometry change, etc...)
3. When P0's surface is rendered, M1's surface is the result of M1+M0.
4. When P0 is drawn on screen, we can see the effect of M1+M0 as
   P0's geometry might be different from the item's I0.

Solution:
Discard prev masks and force a mask redraw when we're inside a
proxy. Ideally we should detect if the prev mask belongs to the
insides of the proxy or not.

Problems:
_mask_apply_inside_proxy() is definitely not correct, but it's
not easy to test it. Anyway I believe that in order to properly
implement all of this, we need to rethink evas_render and
the draw context. Non-primary render surfaces (maps, proxies,
masks, filters, ...) should be rendered with a clean context
and clipping, masking, etc should be computed appropriately.
2016-12-16 11:29:47 +09:00
Jean-Philippe Andre 1c21cdfdbb evas: Remove flag use_mapped_ctx and add do_async
Always assume use_mapped_ctx as true, the caller of evas_render_mapped
must ensure that the context is suitable (so either clean or contains
the appropriate clip info).

Also pass do_async to mask_subrender. For now it will always be reset
to false as the SW engine requires sync render to convert from RGBA
to Alpha (not great). The upcoming GL async engine should be able to
render masks asynchronously without any problem.
2016-12-16 11:05:45 +09:00
Jean-Philippe Andre 3e0f3822f1 evas: Call object render in mask_subrender
This can avoid some invalid render from evas_render_mapped in
a rare case. I'm not sure about the conditions but I know for
sure that at the moment mask_subrender should be only rendering
plain old images into a dedicated surface. So no need for
evas_render_mapped here.
2016-12-16 10:53:03 +09:00
Jean-Philippe Andre 70676a4179 evas: Remove context from the evas public data
It was never used, except in dubious situations (most likely a typo).
A clean context is now used in the top-most call to
evas_render_updates_internal_loop.
2016-12-16 10:51:05 +09:00
Jean-Philippe Andre 581505791a evas: Remove context from some engine function
This is for canvas_alpha_get. context is never used.
2016-12-16 10:40:55 +09:00
Jean-Philippe Andre 4f78aba9bf evas: Use ENFN, ENDT in evas_render
This makes code shorter and easier to read (imo).
Also introduce ENCTX for the engine context. It's used in a couple
places and I believe it's just wrong - but works because the engine
context and the current context are the same.
2016-12-16 10:31:53 +09:00
Jean-Philippe Andre ae69b10455 evas: Avoid calling efl_isa in proxy_subrender
It's not necessary.
2016-12-16 10:24:52 +09:00
Jean-Philippe Andre 4e110a34bf evas: Add source_region property to proxy objects
This will allow partially rendering a proxy in a smaller image,
limited to the specified region. At the moment, this will allow
apps to create proxies of very large objects and let them deal
with the geometry & clipping.

This is not directly solving the issues with adding a filter
to textblock or the infinite page scrollers.

@feature
2016-12-16 10:24:52 +09:00
Hermet Park 8233770e36 evas render: code refactoring.
There were some obj->map->surface validation check
but final map drawing was in the out of the surface valid scope.

Actually, this change does nothing but logically this change makes sense.
2016-12-06 18:59:42 +09:00
Carsten Haitzler 8dd20ad8ed evas - more render cache cleanups
i forgot to save this file before git committing... so also delete
update rect del array from render cache.
2016-12-03 12:44:57 +09:00
Carsten Haitzler 496f2ed427 Revert "evas render - evas_object_clip_recalc - dont call uselessly"
This reverts commit bba368cf79.

if this is causing test suite fails ( i saw no actual visual problems
tho in apps or e etc.)... then revert. sadness. :(
2016-11-30 17:36:42 +09:00