Commit Graph

217 Commits

Author SHA1 Message Date
Yeongjong Lee 9de082eb83 ecore: remove duplicated conditions
Summary: The macro already checks eina_main_loop_is() when DEBUG_THREADS is enabled.

Test Plan: make

Reviewers: segfaultxavi, ManMower, Hermet, bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7183
2018-10-26 19:25:09 +09:00
Derek Foreman 4dc1e8273d ecore: Add new way to register animators
Summary:
We have back-ends that can generate their own tick sources, but
ecore_animator_add()/ecore_animator_timeline_add() gives no indication
which backend the animator is running on.  This means that all animators
have to cause all currently in use backends to tick.

For example, if under wayland 4 application windows are open, all 4
windows will create ticks when any animator is present.

These new animator APIs that take an evas object allow us to figure out
out the backend and only cause the appropriate one to tick.

Depends on D7040

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7041
2018-09-18 09:42:38 -05:00
Derek Foreman 501114e679 ecore_evas: Refactor out ticking start/stop as functions
Summary:
These are the refcounted ticky guts of the signal add/del catchers, we'll
need to use these to start/stop from other call chains in the near
future.

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7039
2018-09-18 09:42:30 -05:00
Mike Blumenkrantz f2adbe1452 ecore-evas: make manual_render_set a no-op when setting the current value
Summary:
this should not take any action if the existing value of manual_render is
set to the passed value

Reviewers: devilhorns, kimcinoo, ManMower

Reviewed By: devilhorns, kimcinoo, ManMower

Subscribers: ManMower, cedric, #reviewers, #committers

Tags: #efl_display_system

Differential Revision: https://phab.enlightenment.org/D6786
2018-08-09 15:51:41 -04:00
Derek Foreman e382bac1a0 wayland: Fix elementary setting window parents at creation time
Summary:
We need to pass the entire pointer, not just 32-bits of it.

Fixes a crash with enlightenment sandbox gadgets where
ecore_wl2_window_alpha_get() is called with an invalid pointer while
trying to display a pop-up.

Reviewers: zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6775
2018-08-08 09:37:30 -04:00
Derek Foreman 35622614d0 ecore_evas: Make sure a manual render does a manual render
Summary:
If we call ecore_evas_manual_render() during an async render, it does
nothing.

This is harmful if we've added render post callbacks during that async
render and expect them to fire.

Force a sync and another render if we're in an async render.

ref T7156
Depends on D6714

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7156

Differential Revision: https://phab.enlightenment.org/D6715
2018-07-31 17:03:16 -04:00
Derek Foreman b7444e0b87 ecore_evas: Sync evas on manual_render_set
Summary:
Make sure any ongoing async rendering is finished before manual_render_set
returns.
Depends on D6711

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6714
2018-07-31 17:03:16 -04:00
Hosang Kim 1b2408d5f7 ecore_evas: skip rendering evas and making animator tick
Summary:
Some ecore_evas such as ecore_evas_extn_plug doesn't have evas.

ecore_evas_extn_plug seems to be Ecore_Evas, but actually it is Evas_Object_Image.
ecore_evas_extn_plug makes new ecore evas, but it only exists to communicate with ecore_evas_extn_socket.
newly ecore evas  only open and close file(ecore_evas_extn_socket). so it doesn't have evas.

```
EAPI Evas_Object *
ecore_evas_extn_plug_new_internal(Ecore_Evas *ee_target)
{
...
   ee = calloc(1, sizeof(Ecore_Evas));
...
   o = evas_object_image_filled_add(ee_target->evas);
...
  return o;
}
```

Reviewers: zmike, Hermet, woohyun, raster, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6504
2018-07-05 15:15:55 -04:00
Hosang Kim df652673fe evas: move clearing cows to right place.
Summary:
Evas is child of main loop now, so evas is deleted when main loop is quitted.
In case of not calling evas_free() explicitly by app side, a crash occurs.
So move clearing cows to below ecore_shutdown().

Test Plan:
//Compile with:
//gcc evas_test.c -o evas_test `pkg-config --cflags --libs ecore evas`

#include <Evas.h>
#include <Ecore.h>

Eina_Bool
_timer_cb (void *data)
{
    ecore_main_loop_quit();
    return 0;
}
int
main(int argc, char *argv[])
{

   evas_init();
   Evas *evas = evas_new();
   Evas_Object *obj = evas_object_box_add(evas);
   Evas_Object *rect = evas_object_rectangle_add(evas);
   evas_object_color_set(rect, 255, 255, 255, 255);
   evas_object_resize(rect, 300, 400);
   evas_object_show(rect);

   evas_object_box_append(obj, rect);

   evas_object_show(obj);
   ecore_timer_add(2.0, _timer_cb, NULL);
   ecore_main_loop_begin();

   evas_shutdown();
   return 0;
}

Reviewers: devilhorns, cedric, jpeg, id213sin, woohyun, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6346
2018-06-27 07:50:31 -04:00
YeongJong Lee a522bf5d76 ecore_evas: prevent duplicated ecore_evas registration
Summary:
After a44697c37a, we can register same ecore_evas
to ecore_evases using ecore_evas_input_event_register.
(ecore_evas_input_event_register -> ecore_evas_done -> _ecore_evas_register)
This can make infinite loop in EINA_INLIST_FOREACH(ecore_evases, ee) because
next inlist of ecore_evases is ecore_evases after double call of
_ecore_evas_register.

This patch prevent it.

Test Plan:
Ecore_Evas *ee = ecore_evas_new(NULL, 0, 0, 800, 600, NULL);
ecore_evas_input_event_register(ee);
(part of document of ecore_fb_input_device_window_set)

Check that there is no infinite loop

Reviewers: zmike, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6390
2018-06-25 15:14:31 -04:00
Cedric BAIL fe14abd929 evas: refactor efl_input_event and remove some of the lifecycle hack.
Differential Revision: https://phab.enlightenment.org/D6101
2018-05-24 16:02:18 -07:00
Cedric BAIL ccb5642eb9 Revert "efl_add_ref - fis to use efl_add properly with a parent."
This reverts commit 2fb5cc3ad0.

Most of this change where wrong as they didn't affect the destruction
of the object. efl_add_ref allow for manual handling of the lifecycle
of the object and make sure it is still alive during destructor. efl_add
will not allow you to access an object after invalidate also efl.parent.get
will always return NULL once the object is invalidated.

Differential Revision: https://phab.enlightenment.org/D6062
2018-05-24 16:02:17 -07:00
Carsten Haitzler 5b08611a9e ecore animator, x, vsync ecore evas restore x vsync to work again
so i found the work with wayland and having animator sources broke
that same source from ecore_x that was there from long ago, so i've
put in an exception if there are x based engines from restting to a
timer animator because ecore_x would have switched toa custom ticker
already, and this just resets it. also just set the source after
setting the tick callbacks and ensure tick cb's are null before going
to timer source as well. this cleans up this little but of animaatior
vsync modification to properly vsync in both x and wayland too now.

@fix
2018-04-30 15:32:10 +09:00
Xavi Artigas 65ee277a66 Efl.Canvas.Scene (from Efl.Canvas)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:23 -07:00
Derek Foreman 2dbaef9b7c ecore_evas: Make draw_block block drawing
This was only used in the X custom render function, now it's meaningful
everywhere.  (Nothing that uses this code path currently sets it)

ref T6834
2018-04-12 15:59:39 -05:00
Chris Michael c18fac91ff ecore-evas: Remove unused variable 2018-04-11 10:05:33 -04:00
Cedric Bail 23800a06a0 ecore_evas: remove dead code. 2018-04-10 15:01:43 -07:00
Cedric Bail 1ca196fbcd ecore_evas: add a hook interceptor for evas_new, will be useful for a portable Exactness. 2018-04-02 15:12:31 -07:00
Cedric Bail a44697c37a ecore_evas: refactor logic for creating Ecore_Evas. 2018-04-02 15:12:31 -07:00
Carsten Haitzler 2fb5cc3ad0 efl_add_ref - fis to use efl_add properly with a parent.
fixes bc18b7e7ad and
168849e8a0
2018-03-29 13:30:55 +09:00
Hosang Kim 86ae239bae ecore_evas: don't set in_async_render flag if not in use async render.
Reviewers: jypark, raster, cedric

Subscribers: cedric

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-26 15:58:54 -07:00
Cedric BAIL bc18b7e7ad efl: replace efl_del with efl_unref for cases where no parent exists
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Carsten Haitzler 1bdd9e4dd1 ecore - a different take on efl.app class as a super class to efl.loop
so the MAIN loop is actually an efl.app object. which inherits from
efl.loop. the idea is that other loops in threads will not be efl.app
objects. thread on the creator side return an efl.thread object.
inside the thread, like the mainloop, there is now an efl.appthread
object that is for all non-main-loop threads.

every thread (main loop or child) when it spawns a thread is the
parent. there are i/o pipes from parnet to child and back. so parents
are generally expected to, if they want to talk to child thread, so
use the efl.io interfaces on efl.thread, and the main loop's elf.app
class allows you to talk to stdio back to the parent process like the
efl.appthread does the same using the efl.io interfaces to talk to its
parent app or appthread. it's symmetrical

no tests here - sure. i have been holding off on tests until things
settle. that's why i haven't done them yet. those will come back in a
subsequent commit

for really quick examples on using this see:

https://phab.enlightenment.org/F2983118
https://phab.enlightenment.org/F2983142

they are just my test code for this.

Please see this design document:

https://phab.enlightenment.org/w/efl-loops-threads/
2018-03-03 13:40:33 +09:00
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 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
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
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 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
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 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
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
Mike Blumenkrantz 43b6c2eeb1 ecore-evas: use pointer device with mouse move events instead of seat 2017-06-16 12:23:07 -04: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
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
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