Commit Graph

320 Commits

Author SHA1 Message Date
Myoungwoon Roy, Kim 1b7089a26b ecore_evas: Check for null ptr deref
Summary:
This patch fixes a tentative crash owing to ptr dereference.
Unlike ecore_evas_object_cursor_set and ecore_evas_object_cursor_device_set,
ecore_evas_cursor_set uses Ecore_Evas *ee before calling internal function which
internally checks null ptr dereference of Ecore_Evas *ee.

Test Plan: Executes test suite

Reviewers: cedric, raster, stefan, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5753
2018-01-22 18:28:24 +09:00
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
Jean Guyomarc'h 34d9f20706 eina: remove usless newline
Summary:
ecore_evas: remove debug

eina: unregister log level when done with

Fixes a constant memory leak.

eina: introduce EINA_HOT and EINA_COLD

These attributes respectivelly expand to __attribute__ ((hot)) and
__attribute__ ((cold)) when available. They allow to mark functions are
being hot/cold (frequently used or not) as well as to qualify labels
within a function (likely/unlikely branches).

eo: speed-up generated calls by removing call cache

The call cache needed to by thread-local, to avoid concurrency issues.
Problem with TLS is that is adds an extra overhead, which appears to be
greater than the optimization the cache provides.

Op is naturally atomic, because it is an unsigned integer. As such, it
cannot be tempered with while another thread is reading it. When
entering the generated function, the first operation done is reading
'op'. If we have concurrency, we will have access sequences returning
either EFL_NOOP or a VALID op, because 'op' is not set until the very
end of the function, when everything has been computed. As such, we now
use the 'op' atomic integer to instore a lock-free/wait-free mechanism,
which allows to drop the TLS nature of the cache, speeding up the access
to the cache, and therefore making functions execute faster.

We don't test anymore the generation count. This can be put as a
limitation. If means that if you call efl_object_shutdown() and
re-initialize it later with different data, opcodes will be invalid.
I am not sure there is any usecase for this to ever happen.
We could move all the caches in a dedicated section, that can be
overwritten after a call to efl_object_shutdown(), but I am not sure it
will be very portable.

Benchmark: mean over 3 executions of
   ELM_TEST_AUTOBOUNCE=100 time elementary_test -to genlist

```
                     BEFORE               AFTER
------------------------------------------------------------
time (ns)            11114111647.0        9147676220.0
frames               2872.3333333333335   2904.6666666666665
time per frame (ns)  3869364.6666666665   3149535.3333333335
user time (s)        11.096666666666666   9.22
cpu (%)              22.666666666666668   18.333333333333332
```

Ref T6580

Reviewers: raster, cedric

Subscribers: cedric, jpeg

Maniphest Tasks: T6580

Differential Revision: https://phab.enlightenment.org/D5738
2018-01-16 17:50:46 +09:00
Vincent Torri 4ae6eeb2cf efl: remove _MSC_VER (Visual Studio macro) usage in source code 2018-01-04 12:59:47 -08:00
Carsten Haitzler 0fd8cd82e3 ecore evas init - init ecore then evas not the other way...
because as of... i don't know when, evas relies on ecore with
ecore_pipe_add to create the async fd... and if you init evas then
ecore this doesnt work. obviously. well now it isn't working. probably
due to new efl loop work. but the efl loop code is correct.
ecore_pipe_add should never work until you init ecore... it just
happesn to have managed to be gotten away with for a while.

@fix
2018-01-05 02:34:16 +09:00
Jean-Philippe Andre ff24ac2d6d efl: Reset ecore event types on init
This fixes cycles of init/shutdown/init where ecore event types would
become invalid, since they are now stored in a dynamic array rather than
a statically stored array.

The risk here is that if a module of EFL tends to init/shutdown in a
"normal" scenario then the event type array will grow in a leaking
manner. This could be fixed by resetting those event ID's only when the
loop actually exits (EFL_EVENT_DEL on the main loop). I'm not using
EFL_EVENT_DEL in this patch as this would add too many event callbacks
to the main loop object, which may result in slightly slower event calls
to it, affecting the overall performance.
2017-12-19 11:14:37 +09:00
Lauro Moura 3afbcb2e27 ecore_evas: use access() instead of stat()
Summary: stat() wasn't working on Windows due to some msys2/mingw quirk.

Reviewers: felipealmeida, cedric, vtorri

Subscribers: jenkins, jpeg

Tags: #windows

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-11-23 15:31:01 -08:00
Cedric Bail 3b7607d7f6 ecore_evas: improve ecore_evas fallback animator logic for legacy case.
In Enlightenment with internal window being WL window connected to the
X11 backend, you end up with the later requiring the former to tick, even
if the former do not have a proper animator source. To work around the
problem when there is one backend that is not providing support for
animator source, we do need to avoid switching on another window source
as they could be linked somehow and we can not know.
2017-11-09 18:07:31 -08:00
Cedric Bail e5d1cc731a ecore_evas: always find a source for ticking legacy animator.
As we do not know when a window won't be able to tick, and we do
not know which window a legacy animator is attached to, we require
all windows to tick as often as they can and only generate one tick
per loop run.

This might need more adjustement especially with multi output.
2017-11-02 15:26:08 -07:00
Cedric BAIL 83493bba73 ecore_evas: if an async rendering is still going on, there won't be a new one starting. 2017-11-01 15:33:44 -07:00
Cedric BAIL 925d558780 ecore_evas: do not propagate drawing change blindly from sub surface to parent.
It is not because a round of rendering happen for a child, that it result in
actually drawing anything in the parent. The parent will always be aware of
the rendering request of the sub surface and we should only track what the
parent think.

T6049

Tested-by: Derek Foreman <derekf@osg.samsung.com>
2017-11-01 15:32:36 -07:00
Taehyub Kim 5360034675 ecore: remove doxygen warning messages
Summary:
remove doxygen warning messages
@fix

Reviewers: jpeg, cedric, woohyun

Reviewed By: jpeg

Differential Revision: https://phab.enlightenment.org/D5339
2017-10-18 19:24:28 +09:00
Cedric Bail 6232fa2a9b ecore_evas: skip deleted Ecore_Evas while searching for a general animator source. 2017-09-22 14:57:15 -07:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Jean-Philippe Andre a72f3ec64e efl: Use Eina.Size2D for size hint combined min
For this patch I decided to add a pseudo legacy wrapper as the function
is called in a very large number of places. Fixing all those calls to
use the size2d form is a lot of work and a greater risk of b0rking
something.
2017-09-18 16:33:33 +09:00
Jean-Philippe Andre f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
Cedric BAIL d179a5c2a9 efl: remove PS3 backend.
This backend has received no patch and maintenance from anyone who could
actually test it over the last few years. After talking with KaKaRoTo it
is best to remove it. If anyone want to take over its maintenance, you
are welcome to revert this patch.
2017-08-25 10:48:42 -07:00
Marcel Hollerbach 190af04983 ecore_evas: define the predefine for wl2 instead of wayland 2017-08-12 15:30:53 +02:00
Jean-Philippe Andre d4b4ee867b evas: Modify wheel events direction to bool (EO)
The orientation was overkill here. We only want a bool.

Ref T5870
2017-08-10 14:42:08 +09:00
Cedric BAIL 2330d4fec1 ecore_evas: make sure fn_post_render callback is called last.
Should fix T5595.
2017-07-17 11:51:15 -07:00
Mike Blumenkrantz 3d4bb3851c ecore-evas: make the window_get apis return null without errors on failure
the normal usage of these is something like

if (!strcmp(engine, my_engine))
  win = window_get(ee);

which is a waste of effort since the window_get() functions all check
the engine interface internally
2017-07-14 18:43:00 -04:00
Derek Foreman 981d851d57 ecore_evas: Perform a tick before a manual render if we're not ticking
If we turned off the ticking with manual_render_set then perform a
manual render, we need animators to update.

ref T5462
2017-07-13 18:07:42 -05:00
Derek Foreman b86e6611f3 ecore_evas: Don't start custom tickers for manually rendered canvases
When a canvas is manually rendered the ticker is just a waste of cpu, and
worse - it can wake the drm back-end from dpms sleep, as the display needs
to be awake to generate vblanks.

We fire a DBG message when attempting to start an animator in this state
because it's frequently a bug that wastes battery life - (like E doing idle
cursor animations or clock updates while the display is off)

However, dpms off is not the only potential usage of manual render, so
another commit will follow shortly to fix the bug this commit introduces -
when using a backend with a custom ticker and doing manual render with
the display on, calling ecore_evas_manual_render() will not draw with
updated animator state.

Fix T5462
Again.
Really.
2017-07-13 18:07:42 -05:00
Derek Foreman aa8d9c1829 ecore_evas: Add a function pointer for last_tick_get
Engines that provide their own tickers may need to be able to provide the
time of the last tick even if they weren't sending ticks to EFL at the
time.

This is a feature added during freeze as it's necessary to resolve a bug.

ref T5462
2017-07-13 18:07:42 -05:00
Derek Foreman 7e0beea3f5 ecore_evas: Refactor event catchers to call custom_tick_begin/end
Make the event catcher functions call the custom_tick_begin/end helpers
instead of directly calling the engine functions.
2017-07-13 18:07:42 -05:00
Cedric BAIL 7d9f1dbfd3 ecore_evas: protect against application holding a reference on the canvas while destroying the ecore_evas. 2017-07-13 15:35:17 -07:00
Bryce Harrington ae1d78c36a evas: Fix stray periods
Summary: "to the Evas. @b buffer engine"

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5014
2017-07-11 12:22:11 +09:00
Derek Foreman cae1927554 ecore_evas: Don't start backend ticking for manually rendered canvases
Shortcut the code that starts up a back-end ticker if we're manually
rendered.

ref T5462
2017-07-10 16:24:25 -05:00
Jean-Philippe Andre 7f724f6c5d evas: Fix mouse event info in global events
When using the legacy API (and in fact also with the EO API) to
listen to mouse events (move, in, out...) on a window instead
of an actual evas object, some information was missing:
 - buttons (bitmask of pressed buttons)
 - prev.x/y (previous position)

This is because Evas had not handled the event yet at this
point, it was coming directly from ecore_evas with incomplete
information. This patch involves evas a little bit earlier, and
also fixes evas_events_legacy.c to have consistent values for
cur/prev canvas/ouput coordinates. See also 890a91785 and
484dae76e6. Those commits were making the pointer coord
a seat-based property (instead of canvas-based) but the event
should already have those proper values before converting to
a legacy struct. This patch restores the meaning of the DUP
macros, as I observed 4 different coordinates from the app side
(instead of just 2: prev and cur).

Thanks to Andy for reporting the original issue on the ML!
2017-07-10 17:01:05 +09:00
Jean-Philippe Andre 76a668f022 ecore_evas_x: Track changes in framespace size
If the framespace size has changed and by accident (or in fact, by
design) the evas size + framespace size is equal to the size sent
by the X server, ecore_evas_x was skipping the resize event. This
patch adds a tracking of the framespace size so that we redraw the
canvas if it changed.

This will fix issues with the main menu (since it's in the framespace,
23 pixels tall with the default theme & scale).

Note that all this is partly because the ecore evas size is the size
without the framespace, so weird calculations are made during resize...

Ref T5482
2017-07-05 17:43:59 +09:00
Bryce Harrington 08f04b1496 ecore_evas: Document remaining new/get calls for misc. backends
Summary:
This completes the documentation for Ecore_Evas for all (non-deprecated)
APIs.

Note that ecore_evas_software_16_ddraw_new, ecore_evas_direct3d_new,
ecore_evas_gl_glew_new, and ecore_evas_sdl16_new are left undocumented
because while they're not declared as deprecated their implementations
are either missing or marked as obsolete or legacy.  I suspect a few of
the remaining routines are likely also obsolete but I added
documentation anyway.

Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4972
2017-06-19 15:14:20 +09:00
Mike Blumenkrantz db06108f0d ecore-evas: block buffer canvas events during deletion
internal evas is destroyed before engine delete function is called,
so do not refeed events received during this time

@fix
2017-06-16 12:23:07 -04:00
Mike Blumenkrantz 43b6c2eeb1 ecore-evas: use pointer device with mouse move events instead of seat 2017-06-16 12:23:07 -04:00
Bryce Harrington 79e8444c91 ecore_evas: Document the drm and gl drm window constructors
Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4965
2017-06-15 10:09:30 +09:00
Bryce Harrington 60e0e3d1d5 ecore_evas: document client leader routines
Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-14 14:26:28 -07:00
Chris Michael a5d93a4ece ecore-evas: Fix return value in ecore_evas_aux_hint_val_set function
Small patch to fix misleading return value when
ecore_evas_aux_hint_val_set fails. In the above code, we will return
EINA_TRUE already if the aux_hints_set works, so this return value at
the bottom of the function should be EINA_FALSE.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-13 12:57:29 -04:00
Chris Michael 0d5d157559 ecore-evas: Support auxiliary hints for ecore-evas-wayland
Small patch to support using Ecore_Evas_Interface_Wayland in order to
add support for setting auxiliary hints on a surface

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-13 12:57:29 -04:00
Chris Michael 9de25efcff ecore-evas-wayland: Add aux_hint functions to Wayland Interface
@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-06-13 12:57:17 -04:00
Jean-Philippe Andre e8f9f109a6 evas: Rename device Class to Type, remove Sub_Class
1. The word "class" is a pain point with many languages where
   it's a keyword. Type is a little better. Also, the property
   was already named "device_type" and not "device_class".

2. Remove Efl.Input.Device.Sub_Class
   It's not used inside EFL upstream codebase, and unlikely to
   be used anywhere else (even in Tizen).

Hopefully no one used the Efl_ enum types. So far only the Evas_
types should be in used.

Ref T5540
2017-06-12 15:21:55 +09:00
Bryce Harrington 67295ed747 ecore_evas: Document ecore_evas Wayland operations
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4954
2017-06-12 11:54:06 +09:00
Mike Blumenkrantz a777fcb679 ecore-evas: make focus-setting work with async device init
@fix
2017-06-09 19:14:58 -04:00
Mike Blumenkrantz 7e3c108382 ecore-evas: safety -> normal null check in _ecore_evas_focus_device_set()
when unsetting focus, if the specified seat doesn't exist then there is no
focus to unset
2017-06-09 19:14:58 -04:00
Mike Blumenkrantz 9828981585 ecore-evas: safety -> normal null check in ecore_evas_cursor_device_unset
if there is already no cursor then this is not an error
2017-06-09 19:14:58 -04:00
Bryce Harrington bc644f0d9b ecore_evas: Document the X11 XShape input region APIs
Reviewers: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4951
2017-06-09 12:02:29 +09:00
Cedric BAIL a784e4ac42 ecore_evas: use strbuf instead of PATH_MAX. 2017-06-05 13:53:28 -07:00
Bryce Harrington 2f025184f7 evas: document the wayland ecore_evas constructors
Reviewers: cedric

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-05 12:07:56 -07:00
Mike Blumenkrantz 6632f4d906 ecore-evas: directly get the seat device instead of the parent
no functional changes
2017-06-02 18:23:42 -04:00
Mike Blumenkrantz a7ed5d0540 ecore-evas: redo per-device cursor internals to be per-seat
seats have cursors, pointer devices do not.

@fix

fix T5531
2017-06-02 18:23:42 -04:00
Mike Blumenkrantz 466456b4f0 ecore-evas: init cursors for all pointer-ish objects
all of these will use a cursor visual if one is set

@fix
2017-05-26 16:27:43 -04:00
Mike Blumenkrantz 50381e7911 ecore-evas: clear cursor object cache when setting default cursor
@fix
2017-05-26 16:27:43 -04:00