Commit Graph

332 Commits

Author SHA1 Message Date
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
Carsten Haitzler 6a462f925f evas render - don't do extra if checks or loops if not needed
remove some extra looping and if checkign that is taken care of
already and just is pointless extra checks in the code creating
overhead. tiny amounts, but the amount of meaty speedups lef it
running low, so profiling, reading, working and repeating.

@optimize
2016-11-27 16:58:56 +09:00
Carsten Haitzler bba368cf79 evas render - evas_object_clip_recalc - dont call uselessly
evas_object_clip_recalc was already called ... multiple times in
pending and phase1 on all objects, so there is no value in calling it
again and again in later evbas render phases when it's already been
done.

this and moving this to a real func sees evas_object_clip_recalc usage
in perf drop from 1.8% to 1.4% or so of total perf sample time. tiny
win, but we're at the point where i can't find big meaty wins, so i'm
looking for a string of small wins to add up.

@optimize
2016-11-27 13:05:18 +09:00
Carsten Haitzler d7c6fca6c0 evas render and clip calc - move evas_object_clip_recalc out of inline
evas_object_clip_recalc is big. it's fat. it shouldnt be inline. so
make it a real function. being inline just hurts performance by making
our code bigger, hurting l1 instruction prefetch and cache
performance. this function isn't small. it's huge and should not be
inline basically because of that reason.

also throw in some likely/unlikely hints etc.

@optimize
2016-11-27 12:10:12 +09:00
Carsten Haitzler e3489d5f89 evas_render - store active obj geom in array to be able to filter faster
part of rendering is figuring if obj is inside current geometry.
before we had to actuall poke around inside the object. this moves the
geometry into the active object array so the data is fecthed fast and
already there for filtering as this is the most likely thing to filter
out an object.

unfortunately this seems to have some bugsd and i'm baffled why, so
leave it there and ifdefed out for now for suture hunting.
2016-11-27 12:09:25 +09:00
Carsten Haitzler 4a1dd9e0d9 evas render - remove unsed eo obj handle in pending object smart change
unused eo obj id, so dont have the line of code. - clean up code
2016-11-26 18:33:56 +09:00
Carsten Haitzler f10638cd98 evas render - remove another scope data get when we already have it
we already have the obj protected data so why scope data get it again?
fix and optiomize.

@optimize
2016-11-26 18:33:56 +09:00
Carsten Haitzler 26189dc9a4 evas render - get scope data less in phase 1 where obj data passed
in much of phase1 we already know the evas object protected data ptr,
so dont scope data get it or even pass the eo obj id around as we can
get it from obj->object
2016-11-26 18:33:56 +09:00
Carsten Haitzler a4aac60a67 evas render - remove excess scope data get when we already have the ptr
_evas_render_is_relevant() needs the obj protected data, so it gets
scrop data, but the only place it is called already has this pointer,
so avoid an extra lookup.

@optimize
2016-11-26 18:33:56 +09:00
Carsten Haitzler 69cb85aaca evas render - cache object arrays rto avoid processing them in phase1
evas render in phase1 in order to generate update rects, active,
render etc. object arrays has to walk every object in our tree. this
is a waste of time if we already have walked objects in a previous
frame if they havent changed, so cache this data in render cache in
smart objects to avoid re-walking and now just dumbly "memcpy" these
cached arrays into the master array. i have seen cpu usage by e drop
like about 15% in the sencarios i'm looking at "enlightenment
compositor with some window updating animation all the time, but most
other stuff being static).

@optimize
2016-11-26 18:33:56 +09:00
Carsten Haitzler 1bba6d5759 evas phase 1 process - shortcut objects that are pure static clips only
these objects don't actually produce - or should produce update
regions etc. etc. as the objects that are clipped should produce those.
they are not active objects. so skip them very early after just
ensuring they are in delete objects if needed.
2016-11-26 18:33:56 +09:00
Carsten Haitzler 7bdcb0b8ca evas render - clean up phase 1 process to be more funcs and faster
this refactors _evas_render_phase1_object_process() into a bunch of
sub functions with leaner code, some LIKELY/UNLIKELY hints etc. etc.
in the hope that we have better l1 instruction cache use when
executing. this actually measureably helps and drops the overhead of
this func ANd all its sub functions from (in my tests in enlightenment
compositing while a video plays) from about 13.2% of all cpu usage by
e to 10%. that's about a 25% drop in cost for passing through phase 1
of evas render... and thats a good thing.

and it also makes the code nicer and more broken up.

@optimize
2016-11-22 21:07:29 +09:00
Carsten Haitzler c844d9ae3d evas render - clean up phase1 process calls a bit to pass less in
we are passing the same things into every phase 1 process func - the
same ptrs to the same arrays of objects... why eat up valuable
registers with this? collect into context struct and just pass a ptr
to that. this also makes the code easier to read and maintain too so
bonus all over. also a tiny win in performance but i'd say its "within
error margins" (go from 11.48% to 11.42% overhead).
2016-11-22 20:01:25 +09:00
Wonki Kim 88e1fc9613 evas: Add shutdown logic on thread creation failure
Summary:
In case of thread creation failure, shutdown logic will be stuck.
To prevent stuck, set exit variables to make thread_shutdown working
even if init fails.

Also modify init logics to return init result to a caller.

Reviewers: jypark, woohyun, cedric, jpeg

Subscribers: cedric

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

Note (@jpeg):
I have modified the patch just a little bit.

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2016-11-22 14:50:38 +09:00
Carsten Haitzler 470478030b evas map redraw update handling - dont trigger full redraw in e menus
this fixes T4904

dif e pops up menus it uses zoomap to zoom an existing object in and
out by forcing it to be mapped and controlling the map geom based on
smart obj geom. this will do a minimum update region for the case
where a map just got turned on or off for an obj since last frame and
cut this out.

@optimize
2016-11-18 18:59:03 +09:00
Carsten Haitzler f504950597 image prepares - put in some disabled code to show how to possibly use
this is how you would possibly use prepare stages for objects like
image objects by pre-rendering them to a buffer. this is not complete
and it's actually disabled right now, but it's to show how it might be
done. some more exploring is needed, but this is to share how it
might/should work.
2016-11-17 18:41:32 +09:00
Carsten Haitzler a479745e4f evas - add a prepare stage for objects before render
preparing an object is a good idea. especially with gl. you want to do
texture uploads BEFORE using textures all in one batch. otherwise this
may mean the gl implementation has to make a copy of your data in a
tmp location then copy it in later when texture becomes "unused" as it
may be in use at the moment, or it may have to stall and wait.

i have seen somewhere around 7-10% speedups on nvidia and intel
drivers with this on given a very special test case i brewed up (1000
32x32 images where i change 1 pixel every frame). this should have
impact really when we are modifying textures a lot. this is all i've
implemented for now, but this should/would/could do much more like
re-order map, proxy renders to render FIRST in a pre-render list
instead of inline and to pre-render fbo/buffer content for complex
objects like text or textblock etc.
2016-11-17 18:41:31 +09:00
Cedric BAIL 55ab71bd67 evas: make sync and async work in the same way and not trigger empty flush/clear. 2016-11-16 11:31:04 -08:00
Jean-Philippe Andre f50b0fed13 elm/evas: Fix disappearance of window icons with CSD
After a few patches trying to fix clipping of frame or
non-frame objects the icon finally ended up invisible. Even
if the elm_icon was marked as is_frame, its internal evas
object image would not have the flag set, thus it would be
clipped out.

Solution: Propagate the is_frame flag to all smart children,
not only when setting it but also when adding new members.
A hack with the API indicates that the frame edje is a very
special object that does not propagate the flag.

See also:
7ce79be1a1
0f6c33eff1
9c9c8809a7
ac5ca9281c
2016-11-16 20:48:58 +09:00
Jean-Philippe Andre ac5ca9281c evas: Try to fix bad clipping of non-frame objects
Test cases (in WL or X with client-side decorations on):

1. elementary_test -to Animation
  Resize the window to a small size (eg, 100x100) and observe the
  balls overflowing outside the window content part. This tests
  unclipped normal objects.

2. elementary_test "Window Plug" (requires also Window Socket)
  Drag the handles outside the window, observe overflow in the
  framespace area. This tests mapped images ('can_map').

3. elementary_test -to "Gesture Layer"
  Drag a photo around. This tests non-image mapped objects.
  NOTE: This test is badly broken!

This patch fixes both of those issues. I'm not sure what I'm
breaking, though.
2016-11-16 20:48:37 +09:00
Cedric BAIL ee16c647dc evas: make sure that the documentation match the behavior by return true only when something is rendering. 2016-11-15 15:54:29 -08:00
Jean-Philippe Andre bff8dcfe21 evas: Fix clipping of masks and masks of masks
When an object inside a genlist is masked, scrolling would
cause render issues as the mask is not redrawn on move (only
the clip geometry is marked as dirty and recalculated, the
mask pixels are assumed to be well prepared already). As a
result, masked objects in a genlist would not show up
properly once you start scrolling.

This fixes that by hacking into evas a safety test to avoid
unnecessary clipping, and by using parent masks even if they
are not the direct clipper.

Note that no_render is still quite broken (eg. a no_render
mask may cause major issues, even crashes).

This reverts 5917b49f59
2016-11-09 10:52:26 +09:00
Carsten Haitzler d6ed9e048d evas render evlog - add more evlog spots to help identify issues
this adds more logging spots to provide to evlog + efl debugd so we
can identify issues much more easily
2016-11-07 11:26:22 +09:00
Jean-Philippe Andre a8ff76eb0d evas: Fix debug logs with REND_DBG (typo) 2016-11-03 17:22:14 +09:00
Jean-Philippe Andre 4d1c53d916 evas: Avoid calling render() on smart objects
Smart objects do not render themselves. This can avoid a
bit of extra unnecessary work.
2016-11-03 17:22:14 +09:00
Chris Michael 9c9c8809a7 evas: Fix framespace object clipping detection
This patch fixes an issue where border icons were missing when running
EFL Wayland client applications. This also fixes the issue where
softcursor mouse pointers would not draw over bottom window border.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-24 13:08:00 -04:00
Chris Michael 0f6c33eff1 evas: Fix issue of wayland clients not drawing border icons
Due to commit 7ce79be1a1, EFL Wayland
Client applications stopped rendering their window icons. This was due
to the code which tried to detect if an object is in framespace.
Previous version would just check the obj->is_frame flag ... which is
insufficient to determine if an object is in Framespace. This commit
fixes that issue by checking an objects geometry also.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-10-21 15:32:47 -04:00
Jean-Philippe Andre 9b9c044865 evas: Improve render debug logs
Compiled out by default
2016-10-14 13:59:41 +09:00
Ji-Youn Park 7ce79be1a1 evas_render: fix clipping the whole area in each rendering.
evas_render should not be going and doing evas_object_clip_set () at all.
The framespace clip should be enforced at RENDER time.
2016-09-08 09:56:30 +08:30
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
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Carsten Haitzler ac10a00acc evas - on shutdown avoid potential invalid memory access
i don't know for sure if this fixes T4103 but in theory i think it
might given a reading of the backtrace and a guess at what might
happen, so try this fix. it doesn't hurt and can only help.

@fix
2016-07-19 15:43:22 +09:00
Jean-Philippe Andre 38a32e98fb evas: Avoid proxy subrender if size is 0
See also D4159. This is an alternative to the proposed patch.

Fixes T3949 (I hope!)
2016-07-19 14:43:33 +09:00
Jean-Philippe Andre 07ea964e9f evas: Fix rare issue with recursive proxy src invisible
Scenario:
  smart {
    text
    proxy -> text, src_invisible
  }
  proxy -> smart

What we should see:
  smart {
    (blank)
    proxy -> text
  }
  proxy -> {
    (blank)
    proxy -> text
  }

What we saw:
  smart {
    (blank)
    proxy -> text
  }
  proxy -> {
    text
    proxy -> text
  }

Solution:
Check in evas render, when we're inside a proxy render, and the
proxy src_invisible flag is on (evas_object_source_visible_set(0),
that we're rendering the object itself to its proxy surface. If not,
it means we're rendering another proxy surface, ie. a parent smart
object's proxy surface.

Still loving evas render.

Fixes T4006.

@fix
2016-07-04 16:09:39 +09:00
Carsten Haitzler 5fa3815e01 evas update buf - dont ref and unref outbug as an evas image - it's not
we need calls to ref/unref them from engines, but atm it's ok because
they dont get deleted until the flush is done and not used after that...

@fix
2016-07-03 15:45:46 +09:00
Hermet Park 05d81d3c63 evas/canvas: rewrite a previous patch, ed444b698b
Reviwed further, I found out the origin shouldn't be accumulated with
previous clippers origin. I forgot this function is recursive
function.
2016-06-24 11:33:04 +09:00
Hermet Park ed444b698b evas canvas: fix broken proxy clipping.
Origin of clipper's clipper won't be transformed to derivative space.
So it needs to transform the coordinate additionally.
2016-06-24 00:48:34 +09:00
Hermet Park 48a64d827f evas canvas: code refactoring.
Compare integers clearly.
2016-06-24 00:27:45 +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
Jean-Philippe Andre 52f9220b3f Evas: Rename smart object into Efl.Canvas.Group 2016-06-17 19:32:43 +09:00
Jean-Philippe Andre 79abba52c5 Evas: Rename Evas.Image into Efl.Canvas.Image.Internal
Make it abstract.
And add Evas.Image as a legacy-only class.
2016-06-10 13:21:20 +09:00
Jean Guyomarc'h 5b0ddfec38 evas: fix huge memory leak for non-async rendering
So... I had issues with evas-fb engine which was massively leaking,
one image per frame.
After investigating a bit with @cedric on IRC, the reference count
of the cache entries was always 2 before the engine dropped.
So, for each frame with an animation, we could never drop a cache
entry, leading to a trumendous amount of memory leaking.

Now for non-async rendering, we copy the behaviour of
evas_render_pipe_wakeup() which is called in async-mode,
and actually drops a reference in the cache entry.

Fixes T3763
2016-06-03 12:17:12 +02:00
Carsten Haitzler ecc556c715 evas - use actual smart bounding box not obj geometry for render incl
render inclusion has bene used smart geom not bounding box from actual
objects for inclusion in rendering. use the bounding box to be correct.

@fix
2016-05-25 11:45:16 +09:00
Cedric BAIL ddf92ba61b evas: let's reuse what we know when possible to avoid more useless eo_data_scope_get. 2016-05-06 17:01:10 -07:00
Carsten Haitzler 4dee873ab6 evas render: fix updates sometimes are list of rects sometimes updates
ssometimes the evas render updates are a list of Render_Updates
structs ... sometimes Eina_Rectangles. this is horrible and i think a
bug turns up (but its not reproducable on linux - just bsd) with an
invalid free ... likely because we free() a ptr from the mem pool
eina_rectangle gets rects from. thats most likely the cause of
https://phab.enlightenment.org/T3226 - but as i can't know for sure,
this is a guess, but readiong the code i see posible vectors of
problemss here ... maybe.

so this redoes the update rects to ALWAYS be Render_Updates struct
and appropriately returns correct structures etc. etc. in api which
demand a list of Eina_Rectangles there.

pending testing on foreign sysstems to confirm this by @netstar

@fix
2016-04-01 08:57:09 +09:00
Jean-Philippe Andre 8fb8e6d257 Evas render: Fix no-render with smart objects
Setting the no-render flag on an elm widget had no effect,
as it was not properly propagated to its children. This should
fix that, but I'm not a fan of the solution.

Fixes T3371
2016-03-29 10:43:00 +09:00
Jean-Philippe Andre b7e0eec089 Evas.Image: Fix legacy proxy API 2016-03-15 11:11:59 +09:00
Jean-Philippe Andre 06cf9e6bea Evas.Image: Complete implementation of proxy and snapshot
This moves the EO APIs away from Evas.Image and adds the required
legacy bindings.
2016-03-15 11:11:59 +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 64aff0a7f0 evas: Fix segfault when trying to determine overlay usage
Previously, _evas_render_can_use_overlay would segfault here when
trying to make use of an Evas_Video_Surface. This is because eo_tmp
variable was never reassigned to be the smart parent before we tried
to get eo data from it.

@fix

NB: Thanks Frenchie !! ;)

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
2016-01-25 16:10:25 -05:00
Jean-Philippe Andre 81ed0de016 Evas render: Fix typo (use & instead of &)
Thanks @stefan_schmidt for the report
2016-01-13 14:49:41 +09:00
Jean-Philippe Andre e61182f7ac Evas render: Fix render artifacts with a mapped object
Problem visible in Enventor "map" example, with the SW engine.

Fixes T2979
2016-01-07 11:12:51 +09:00
Jean-Philippe Andre f00f466250 Evas render: Distinguish has_map and can_map
This patch is a minor code cleanup before fixing T2979
(render artifacts inside Enventor).
2016-01-07 11:12:51 +09:00
Mike Blumenkrantz fb8c547077 evas: do not unset/delete master clip after every frame
this is not ideal since it triggers a client-side rerender of every object
which was clipped to the master clip (double render) and then this ends up
forcing the server to rerender the same area twice as well

not only that, it causes all surface damages to to be the size of the entire
window - framespace for every frame

@fix
2015-12-15 17:24:52 -05:00
Mike Blumenkrantz 1d3c4162b3 evas: trigger FLUSH_PRE callback prior to kicking off an async render
while not occurring immediately before flush as in sync rendering, this
is functionally close enough that it will serve the purpose for which the
callback was intended, namely receiving a callback that occurs after render
update calculations have occurred but before flush happens

@fix

ref cbb447c878
2015-12-15 17:24:52 -05:00
Mike Blumenkrantz 092d7a6f3d evas: resize master clip if framespace|viewport.changed is set 2015-12-15 17:24:52 -05:00
Mike Blumenkrantz 990c23c840 evas: do not add unclipped smart members to the master clip
this is probably a pretty unlikely scenario, but messing with smart
members in this way is probably not a great idea

@fix
2015-12-15 17:24:52 -05:00
Carsten Haitzler 000beb2f17 Revert "evas: trigger RENDER_FLUSH callbacks during async render"
This reverts commit cbb447c878.

1. this is wrong because evas_render_pipe_wakeup() is being called IN
THE RENDER THREAD. it... SENDS a wakeup back to the mainloop with

   evas_async_events_put(data, 0, NULL, evas_render_async_wakeup);

and you can see that evas_render_async_wakeup() calls
evas_render_wakeup() and in evas_render_wakeup() flush pre/post are
called, but since the trhead does the flush we cant realyl call
before/after, but it retains order... IF there are updates (haveup).

so calling these callbacks FROM a thread is now leading to apps
mysteriously exiting. this is mucho bad. just at random i now have my
terminals exiting.
2015-12-11 15:15:36 +09:00
Mike Blumenkrantz cbb447c878 evas: trigger RENDER_FLUSH callbacks during async render
these callbacks are used, so ensure that they get called in the expected
order

@fix

 #PatchesFromCedric
2015-12-10 16:00:45 -05:00
Vincent Torri 3b44645363 efl: add binary mode to f(re)open() calls
This allows better compatibility with Windows

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-05 21:04:36 +01:00
Jean-Philippe Andre 58a1b2767e Evas render: Fix another map clip render issue
This time it's only about performance. We seem to be setting the
changed flag too often, which might trigger unnecessary redraws.

- map flag is set if there is currently a map AND it's not an image
  object (because images can map themselves)
- hmap flag is set if there was a map before

So, map != hmap does not imply a transition between a mapped and
non-mapped state. Add an extra check before marking the clip
as dirty and changed.
2015-11-20 14:23:29 +09:00
Jean-Philippe Andre 6e96d75c76 Evas: Remove dead code (cached surfaces)
While cached surfaces is a topic we're discussing recently,
this code is dead right now, and we will have to redesign the
buffer caching better to handle proxies, maps, smart objects, etc...
2015-11-02 16:22:19 +09:00
Jean-Philippe Andre b4fc15311c Evas render: Fix 'no_render' when object is proxy source
When the no_render flag was set on a proxy source, the object would
not be visible, but it would also not render inside the proxy surface,
which completely beats the purpose of this flag. This patch makes
the objects render inside a proxy surface.
2015-11-02 13:40:00 +09:00
Amitesh Singh 8e87e56a7c evas: render - use evas_object_clipees_has instead of evas_object_clipees_get
evas_object_clipees_has is far cheaper than evas_object_clipees_get in case of checking if
clipees exist or not. This should improve the performance in case of large set of clipees.

@fix
2015-10-15 15:02:22 +05:30
Carsten Haitzler 094b781b7f evas - fix evlog to push and pop properly 2015-10-14 14:50:53 +09:00
Jean-Philippe Andre 7b266b5518 Evas render: Fix proxy source_clip logic inversion
As spotted by @FurryMyad I inverted the logic for source_clip.
This should restore the proper behaviour while keeping my previous
fixes working. See D2940.
2015-10-14 11:14:36 +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
Jean-Philippe Andre 57afb0986b Evas render: Don't render deleted / invisible snapshots
Don't render them. They are not visible
2015-10-12 13:40:20 +09:00
Jean-Philippe Andre ff706b7e53 Evas render: Minor debug code improvements 2015-10-12 13:40:20 +09:00
Jean-Philippe Andre 2b47181f4e Evas render: Fix another bad proxy clipping issue
This is an ugly hack to fix an issue reported in D3114. I don't
understand how the proposed patch could even fix anything given
the current situation.

Test case:
 - Create edje object with textblock inside
 - Clip out edje object (--> all children become not visible)
 - Take textblock from edje and set it as source of a proxy
 - Mark proxy as source_clip

Result: Nothing visible.

Expected: Proxy should contain the textblock object, since
  source_clip means we ignore the edje object's clipper, and
  only care about the textblock's clipper (entire canvas).

Here's what was happening:
 - During a first pass, textblock is not visible, cur->cache.clip
   is calculated, marked as clip_use=1 with geom 0,0 0x0
 - In a second pass, the proxy is rendered, which needs to draw
   the textblock in a surface. But cache.clip was used and it was
   wrong.

Solution:
 - Ignore cache.clip when rendering inside a proxy. I'm pretty
   sure there are other instances where cache.clip will still
   be a problem.

Problem: textblock never called relayout since it was not
  visible.

Conclusion: cache.clip needs to die. It's a legacy optimization
  that now causes more issues than it fixes.
2015-10-07 10:48:18 +09:00
Carsten Haitzler f169d7ed27 evas - cutouts - use less cpu by skipping non-intersecting cutout objs
@feature
2015-10-05 15:51:02 +09:00