Commit Graph

296 Commits

Author SHA1 Message Date
Guilherme Iscaro b42a0ba5d2 Efl.Canvas.Object: Reduce memory used to store Evas_Object_Pointer_Data.
The hash implementation demonstrated that too much memory was being used
to store the Evas_Object_Pointer_Data. In order to reduce the memory usage
this patches now changes the Evas_Object_Pointer_Data storage to an Eina_Inlist and
now Massif profiles shows that the memory usage was drastically reduced.
2016-12-13 03:28:31 -02:00
Guilherme Iscaro ddfc98359f Evas: Add seat_event_filter_set()/get() API.
With this new API one can block or unblock keyboard, mouse and
focus events that was originated from a seat. This is useful to
create applications that wants to establish some kind of seat segregation.
2016-12-12 14:59:22 -02:00
Cedric BAIL 73b308fb66 evas: refactor setup stage and reduce complexity for engine. 2016-12-07 15:47:56 -08:00
Cedric BAIL 8205051ff6 evas: wait on one specific task to be done.
This prevent dead lock.
2016-12-07 11:17:20 -08:00
Cedric BAIL 27a47da15b evas: add infrastructure for Evas_Loader to know if what they are working on is still useful. 2016-12-06 16:26:08 -08:00
Cedric BAIL 3fab272906 evas: add capability to know if a thread has been cancelled. 2016-12-06 16:26:08 -08:00
Jean-Philippe Andre aac516f352 evas: Ensure single init of common per canvas
After @cedric's commit 6427c77707 we end up with E
not working in Xephyr, because evas_common_shutdown() is called
too many times (init_count == -1). So I'm being paranoid and
tracking whether Evas has initialized or not evas_common. That
way we end up with exactly the right number of inits. We even
reach 0 after E shuts down :)
2016-12-06 10:48:17 +09:00
Guilherme Iscaro c3ed1d3154 Evas: Add support for per seat modifiers and locks.
This patch introduces possibility to enable key locks and modifers by seat.
It's very useful when the user has two keyboards attached to different seats.
2016-12-02 09:57:50 -02:00
Guilherme Iscaro 484dae76e6 Evas: Add support for per mouse pointer mode/properties.
This patch introduces the possibility to set the pointer mode and
query other properties like current position per pointer device.
The old API will still works, however it will only act on the default seat.
2016-12-02 09:57:50 -02:00
Jean-Philippe Andre 0891466d5f evas: Fix infinite recursion on smart object resize
In some situations smart object resize could fall in an
infinite loop even though the size was stable.

Thanks @vtorri for the report!
2016-12-01 17:56:18 +09:00
Guilherme Iscaro c5f14a61e3 Evas: Add per seat Evas focus state. 2016-11-28 13:57:55 -02: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 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
Guilherme Iscaro b77f0086f5 Efl.Canvas: Use Efl.Input.Focus as event info for object,focus.in/out. 2016-11-24 19:18:47 -02: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 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 3eb0df1022 evas engines - add more support for noscale pixel buffers esp in gl
for gl noscale buffers are texture atlases that are fbo's. the point
is never to scale or transofmr them but to render them pixel for pixel
and just store pre-rendered data where its cheaper to do this than
rebuild every time. this is the enigne infra for sw and gl with the gl
code... it SHOULD work... in theory...
2016-11-17 18:41:32 +09:00
Carsten Haitzler 622277c82a evas - add engine api to get a specific fbo/surf that wont be scaled
this is to allow gl to specifically use an fbo as an atlas for these
kinds of buffers
2016-11-17 18:41:31 +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
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
Guilherme Iscaro 0e53b9a8ac Evas: Add support for multiple focused objects.
Using the multi-seat support, Evas is able to handle multiple focused objects.
This implementation allows one focused object per seat.
This patch introduces new APIs and events to handle this new scenario,
while keeping compatible with the old focus APIs.
2016-11-08 17:54:34 -02:00
Guilherme Iscaro 453770137f Evas: Add the default input devices for Evas.
This will be useful when Ecore_Evas is setting up the
EFL_POINTER/KEY_EVENT struct.
2016-11-08 17:54:34 -02:00
Jean-Philippe Andre 0c850f67ce evas: Fix previous pointer position in output coords
This fixes the test "Window Socket" map resize.
I broke that in 40fec5f608

Makes me wonder if the previous position should be exposed
in EO as well.
2016-11-08 14:15:14 +09:00
Carsten Haitzler f18d9d7237 remove memcmp calls for better performance where size is known
so i have been doing some profiling on my rpi3 ... and it seems
memcmp() is like the number one top used function - especially running
e in wayland compositor mode. it uses accoring to perf top about 9-15%
of samples (samples are not adding up to 100%). no - i cant seem to
get a call graph because all that happens is the whole kernel locks up
solid if i try, so i can only get the leaf node call stats. what
function was currently active at the sample time. memcmp is the
biggest by far. 2-3 times anything else.

  13.47%  libarmmem.so                [.] memcmp
   6.43%  libevas.so.1.18.99          [.] _evas_render_phase1_object_pro
   4.74%  libevas.so.1.18.99          [.] evas_render_updates_internal.c
   2.84%  libeo.so.1.18.99            [.] _eo_obj_pointer_get
   2.49%  libevas.so.1.18.99          [.] evas_render_updates_internal_l
   2.03%  libpthread-2.24.so          [.] pthread_getspecific
   1.61%  libeo.so.1.18.99            [.] efl_data_scope_get
   1.60%  libevas.so.1.18.99          [.] _evas_event_object_list_raw_in
   1.54%  libevas.so.1.18.99          [.] evas_object_smart_changed_get
   1.32%  libgcc_s.so.1               [.] __udivsi3
   1.21%  libevas.so.1.18.99          [.] evas_object_is_active
   1.14%  libc-2.24.so                [.] malloc
   0.96%  libevas.so.1.18.99          [.] evas_render_mapped
   0.85%  libeo.so.1.18.99            [.] efl_isa

yeah. it's perf. it's sampling so not 100% accurate, but close to
"good enough" for the bigger stuff. so interestingly memcmp() is
actually in a special library/module (libarmmem.so) and is a REAL
function call. so doing memcmp's for small bits of memory ESPECIALLY
when we know their size in advance is not great. i am not sure our own
use of memcmp() is the actual culprit because even with this patch
memcmp still is right up there. we use it for stringshare which is
harder to remove as stringshare has variable sized memory blobs to
compare.

but the point remains - memcmp() is an ACTUAL function call. even on
x86 (i checked the assembly). and replacing it with a static inline
custom comparer is better. in fact i did that and benchmarked it as a
sample case for eina_tiler which has 4 ints (16 bytes) to compare
every time. i also compiled to assembly on x86 to inspect and make sure
things made sense.

the text color compare was just comparing 4 bytes as a color (an int
worth) which was silly to use memcmp on as it could just cast to an
int and do a == b. the map was a little more evil as it was 2 ptrs
plus 2 bitfields, but the way bitfields work means i can assume the
last byte is both bitfields combined. i can be a little more evil for
the rect tests as 4 ints compared is the same as comparing 2 long
longs (64bit types). yes. don't get pedantic. all platforms efl works
on work this way and this is a base assumption in efl and it's true
everywhere worth talking about.

yes - i tried __int128 too. it was not faster on x86 anyway and can't
compile on armv7. in my speed tests on x86-64, comparing 2 rects by
casting to a struct of 2 long long's and comparing just those is 70%
faster than comapring 4 ints. and the 2 long longs is 360% faster than
a memcmp. on arm (my rpi3) the long long is 12% faster than the 4 ints,
and it is 226% faster than a memcmp().

it'd be best if we didnt even have to compare at all, but with these
algorithms we do, so doing it faster is better.

we probably should nuke all the memcmp's we have that are not of large
bits of memory or variable sized bits of memory.

i set breakpoints for memcmp and found at least a chunk in efl. but
also it seems the vc4 driver was also doing it too. i have no idea how
much memory it was doing this to and it may ultimately be the biggest
culprit here, BUT we may as well reduce our overhead since i've found
this anyway. less "false positives" when hunting problems.

why am i doing this? i'm setting framerate hiccups. eg like we drop 3,
5 or 10 frames, then drop another bunch, then go back to smooth, then
this hiccup again. finding out WHAT is causing that hiccup is hard. i
can only SEE the hiccups on my rpi3 - not on x86. i am not so sure
it's cpufreq bouncing about as i've locked cpu to 600mhz and it still
happens. it's something else. maybe something we are polling? maybe
it's something in our drm/kms backend? maybe its in the vc4 drivers or
kernel parts? i have no idea. trying to hunt this is hard, but this is
important as this is something that possibly is affecting everyone but
other hw is fast enough to hide it...

in the meantime find and optimize what i find along the way.

@optimize
2016-11-06 13:13:10 +09:00
Carsten Haitzler b533f15880 evas - fix smart clipped if a move happens to recurse within itself
so since this uses new pos - cur pos to move BY x pixels... there is
an issue that if the move of the obj ends up re-moving the current obj
TO the same pos. it moved BY the same delta again thus racing ahead.
not great. because x/y is not stored until the call stack returns to
after the smart move func and the pos set storce the new position in
the object struct. the easiest way atm until we have relative
positioning etc. is to store this in the smart obj and use the delta
at that time of the call then store it immediately so a recursion ends
up with a delta of 0 if its the same pos, so go back to where we were.

this fixes a nasty issue i spotted in fileselector that made filesel
icons race along when scrolling 2x as fast as everything else. oddly i
couldnt see this in any other widget that scrolled when i looked...
which is odd, but... either way a nasty issue... subtle... and now
fixed. never saw this before so this seems new.
2016-10-28 08:21:50 +09:00
Jean-Philippe Andre 40fec5f608 evas: Fix legacy events output vs. canvas coords
In case of a mapped object (eg. when applying a map to a window
in wayland compositor), the canvas and output coordinates are
not meant to be the same.

In EO land, applications should instead use the common interface
Efl.Input.Interface.pointer_xy.get (on the canvas).

@fix
2016-10-26 13:42:54 +09:00
Subhransu Mohanty 8b7f060946 evas/module: add a new module in vg_saver for eet
Reviewers: cedric, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4350
2016-10-14 15:52:51 +09:00
Subhransu Mohanty 0d9b168146 evas/module: Added a new module vg_loader for svg
Reviewers: cedric, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4346
2016-10-12 18:39:10 +09:00
Jean-Philippe Andre 8a9f0bd603 evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
 - intercept
 - smart resize (do stuff), super, super, super
 - evas object resize

The new code is more like:
 - intercept
 - super, super, super, evas object resize
 - do stuff

But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 62abe2cbff evas: Move clip_unset to legacy, remove group_clip
Similarly to group_color_set, group_clip_[un]set should not
exist and should be a result of efl_super and inheritance.

This patch also removes clip_unset from the EO API and keeps
only clip_set(NULL). The reason is that it will avoid bad overrides
of clip_unset() vs. clip_unset(NULL). This also simplifies the code
a bit. Ideally we should be able to reintroduce clip_unset in EO
if we can have a "@final" tag (like java's final keyword), to
prevent overrides.
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre c60cc50f5a evas: Remove inexisting private function declarations 2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 39949b022d evas: Add pseudo-internal API to intercept basic calls
This is a poor man's solution to get rid of group functions such
as clip_set, clip_unset, color_set, etc... See the following
commits.

This API needs to be EAPI for elementary but shouldn't be used
outside EFL. This is required purely for legacy compatibility.

Here's the call flow, inside show(obj):
1. if (intercept_show(obj)) return;
2. show(super(obj));
3. do other stuff
2016-10-12 11:25:55 +09:00
Cedric BAIL b5456893ee evas: start working on efl_canvas_output.
This should when done enable the possibility for multi screen in wayland
along with remote display, wireless display and screencasting.
2016-09-12 16:19:10 -07: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
Jean-Philippe Andre b2d92f2626 evas: Implement support for external buffers
This brings support for the eo api for external buffers (like
the old data_set / data_get). The new API now works with slices
and planes.

The internal code still relies on the old cs.data array for
YUV color conversion. This makes the code a little bit too
complex to my taste.

Tested with expedite for RGBA and YUV 422 601 planar, both
SW and GL engines (x11).
2016-09-06 16:55:00 +09:00
Jean-Philippe Andre 2f737e8f3b evas: Change internal function image_data_direct 2016-09-06 16:54:54 +09:00
Jean-Philippe Andre 8ee431572d evas: Switch EO APIs to Eina_Slice for gfx buffers (map)
This adds a plane and eina slice argument to the map/unmap
functions, instead of void_ptr + length.
2016-09-06 16:54:53 +09:00
Jean-Philippe Andre 1773ba5d82 evas: Internally switch to Eina_Slice for buffers
This will be used for the gfx buffer map/unmap eo apis.
2016-09-06 16:54:53 +09:00
Jean-Philippe Andre b3993b684e win: Add EO API to query state of multi touch points
This combines evas canvas functions to list and query
touch points into a single iterator:
 - evas_touch_point_list_count
 - evas_touch_point_list_nth_xy_get
 - evas_touch_point_list_nth_id_get
 - evas_touch_point_list_nth_state_get

This also fixes a number of issues related to feeding fake
input events.

Note: I wanted to add delta x,y information as well but it's
in fact not really possible outside the event callback itself,
as the previous x,y position will not be updated unless there's
an event.

@feature
2016-09-01 14:57:11 +09:00
Jean-Philippe Andre d504284dd2 efl: Rename Efl.Event.XX to Efl.Input.XX
This removes:
 Efl.Event interface

And renames:
 Efl.Event.Input -> Efl.Input.Event
 Efl.Event -> Efl.Input.Event (merged)
 Efl.Event.Pointer -> Efl.Input.Pointer
 Efl.Event.Key -> Efl.Input.Key
 Efl.Event.Hold -> Efl.Input.Hold

This also moves some interfaces from efl/ to evas/ where they
belong better.

This allows renaming Eo_Event to Efl_Event.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 443aa91d53 evas: Simplify internal evas_object_event_callback_call
This removes the distinction between legacy and new eo style
event info, since all those types have now been ported to eo.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre ef4859d5bd evas: Optimize out most callback call events
This sets a bit whenever a callback listener is added.
I couldn't get any profiling data easily (too small for
valgrind).

Note: This removes the proper refcounting on the "move"
event listeners. I believe this is not a problem as most times
the move_ref goes to 0, it is because the object is deleted.
Worst case, we just trigger a callback_call with no listeners.

This adds 32 bits to each evas object private data.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 57f0c850ec evas: Move event catcher to evas_callbacks.c
No functional change.
2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 049a5ddb44 evas events: Remove now unused code 2016-08-26 10:18:01 +09:00
Jean-Philippe Andre 290413543d evas events: Switch wheel event to the new type
For now this covers only the wheel event.

Note: This patch also modifies evas map to use double in an
internal function, rather than ints.
2016-08-26 10:18:00 +09:00
Jean-Philippe Andre 6d6e41c5c9 evas: Fix mouse inputs when also listening to multi
Since the new event type is the same for multi and single
touch (finger id is the only difference), multi touch listeners
would get triggered even for single mouse events.

Fixes https://phab.enlightenment.org/T4345
Fixes https://phab.enlightenment.org/T4378

This raises a question though: How do we want to differentiate
between single & multi touch events in the eo interfaces?
2016-08-17 13:13:23 +09:00
Jean-Philippe Andre 6d52d1db2b evas: Fix ordering of input event
The previous patch 1185c40e50 shows how having
two event types for the same thing (key or mouse input events)
was a bad idea. The only guaranteed order of callbacks is the
priority but even that was not enforced (since legacy or eo
style event had to come first).

Fixes T4310
2016-08-16 20:22:57 +09:00
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