Commit Graph

258 Commits

Author SHA1 Message Date
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