summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-08-27Efl.Loop.coro: easy to use coroutines attached to a main loop.devs/barbieri/coroutinesGustavo Sverzut Barbieri
While Eina_Coro provides a solid base, to use the main loop to schedule coroutines it needs some manual work we want to avoid. Efl.Loop.coro method will take a function and schedule it using the given priority, the returned value is then resolved in a promise for the returned future. Basically all users must do is write a function that looks like a synchronous code and calls eina_coro_yield() (or helper macros), that will go back to the main loop and then it will reschedule the coroutine to run according to its priority. This should reduce the number of callbacks in user's code.
2017-08-27Efl_Object: make main domain accessible in Eina_Coro.Gustavo Sverzut Barbieri
Currently Eina_Coro is implemented with actual threads, that barf Eo checkings and makes main thread objects unusuable. Since this is an implementation detail, let's use Eina_Coro hooks to adopt the main domain and return when it's done... The user doesn't see this, it's transparent.
2017-08-27eina: add Eina_Coro - coroutine support.Gustavo Sverzut Barbieri
Coroutines are cooperative tasks, in the sense that the caller will stop until the target function runs. The target function must either yield control back to the caller (main thread), or exit. There is no preemption of the two tasks, thus no special care needs to be taken regarding shared data. If the target coroutine yields control using eina_coro_yield(), then it will be paused until it's manually ran again by caller (main thread), which is executed with eina_coro_run(). Another common usage is to await for another task to be completed, this can be done by waiting for a future to be resolved. It will automatically yield and inform the caller of the future so it can schedule properly instead of keep calling the task. Waiting for many tasks can be achieved by using eina_future_all() or eina_future_race(). This is done with eina_coro_await(). Due portability it was implemented using Eina_Thread, Eina_Lock and Eina_Condition. Regular threads will ensure that the state is fully preserved (stack, registers) in a platform independent way. Each thread will wait on its own turn using the Eina_Lock and Eina_Condition, thus it's guaranteed that only one is being executed at the same time. The API is small and should allow different implementations shall we need them, like manually saving the stack and registers, then restoring those -- problem is doing that in a portable way, setjmp()/longjmp() won't save the stack, makecontext()/swapcontext() doesn't work right on MacOS... Hooks can be used to be informed when the main routine exits and then enters, likewise when the coroutine enters and exits. These will be used, for instance, to automatically get, adopt and return Efl_Domain_Data needed to make Efl_Object work in such environment. The flow is simple: - main exit (called from main thread) - coroutine enter (called from worker thread) - coroutine exit (called from worker thread) - main enter (called from main thead) Performance may not be optimal, however this is meant as easy-to-use and it shouldn't be an issue in real life. It will be mostly exposed in two layers: - Efl.Loop.coro: will wrap eina_coro and and schedule using its main loop instance, returns an Eina_Future so it's easy to chain. - Eina_Promise/Eina_Future "async/await"-like behavior: will allow to write "synchronous" code that can wait for promises to be resolved. When eina_future_await(), it will actually register a new Eina_Future in the chain and then eina_coro_yield(). Once the future is called back it will call eina_coro_run() and allow the coroutine to resume. This is done on top fo eina_coro_await().
2017-08-27Efl_Loop: add job, timeout and idle based on Eina_Future.devs/barbieri/futureGustavo Sverzut Barbieri
Since some clash with old version, then add Eina_FutureXXX to their name, later we'll sed.
2017-08-27export efl_future_then() for Eina_Future syntax sugar.Gustavo Sverzut Barbieri
This is actually written as efl_future_Eina_FutureXXX_then() as the old API clashes, after removing the old code we'll "sed" to fix those.
2017-08-27Eina_Future: add eina_future_resolved()Gustavo Sverzut Barbieri
This is a helper that creates a promise, then a future and immediately resolves the promise, this will let the future be dispatched as usual, from a clean main loop context.
2017-08-27Eina_Future: add to eina_types.eotGustavo Sverzut Barbieri
2017-08-27fixup Efl_Object: Add integration with Eina_Future.Gustavo Sverzut Barbieri
Rename _from_array() to _array(), following others. Fix variable to be signed so -1 is clean (it would work due overlow, but not that clear).
2017-08-27fixup Eina: Add Eina_Promise/Eina_Future (convert_to)Gustavo Sverzut Barbieri
convert_to() should just setup for empty, getting the default value. on errors it should convert to EINA_VALUE_TYPE_ERROR, otherwise pass thru.
2017-08-27fixup Eina: Add Eina_Promise/Eina_FutureGustavo Sverzut Barbieri
_eina_promise_clean_dispatch() must call _eina_future_dispatch() since complex chains will need to be walked -- this bugged me for some complex tests I'm doing with coroutines. Unfortunately that will modify the value and cause problems since the caller trust it wasn't modified and could cause double-free or invalid memory access. Then we must copy it in _future_proxy(). Other usage for _eina_promise_clean_dispatch() were leaking and are now "auto fixed".
2017-08-25Add new Future/Promise API.Guilherme Iscaro
Summary: Eina: Add Eina_Promise/Eina_Future. This commit adds a new promise/future API which aims to replace efl_future. Efl_Object: Add integration with Eina_Future. This commit adds the EO support for the new future infra. From now on there's no need to efl_future_link()/efl_future_unlink() object and futures since the new API already handles that internally. Eina_Promise/Eina_Future: Add example and tests. Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5131
2017-08-25Efl_Object: Add integration with Eina_Future.Guilherme Iscaro
This commit adds the EO support for the new future infra. From now on there's no need to efl_future_link()/efl_future_unlink() object and futures since the new API already handles that internally.
2017-08-25Eina: Add Eina_Promise/Eina_Future.Guilherme Iscaro
This commit adds a new promise/future API which aims to replace efl_future.
2017-08-25theme: let notifications wrapMike Blumenkrantz
infinitely wide notification popups are hard to read
2017-08-25evas image cache: notify preload for image objects without explicit callbacksMike Blumenkrantz
non-gl images do not have an explicit callback and so the preload inform callback must be triggered manually for all cases fix T5200
2017-08-25evas image cache: break out preload complete notification code into functionMike Blumenkrantz
no functional changes
2017-08-25efl_ui_image: maintain geometry for prev image while preloading new imageMike Blumenkrantz
if prev_img exists then it is visible, so continue maintaining its geometry until it is deleted fix T5936 @fix
2017-08-25elm_win: check for wayland engine during finalize by checking for wl winMike Blumenkrantz
fake wins don't provide engine info, but a wl win will still exist @fix
2017-08-25elm_win: update opaque region for fake windowsMike Blumenkrantz
fake windows still gotta render @fix
2017-08-25efl-wl: match nested wl seats based on display orderingMike Blumenkrantz
a nested compositor will have a mismatch between canvas seat id and compositor seat id, so this attempts to perform matching based on the order that they are listed, which should be identical @fix
2017-08-25ecore-wl2: normalize axis event valuesMike Blumenkrantz
this is value * 10 from the compositor, so /= 10 to get real value fix T5427 @fix
2017-08-25evas: enable rendering of multiple output.Cedric BAIL
2017-08-25evas: no more ENDT.Cedric BAIL
2017-08-25evas: move updates to be per output.Cedric BAIL
2017-08-25evas: decorrelate canvas size from output size.Cedric BAIL
2017-08-25evas gl: fix glview by avoiding make currentCedric BAIL
gl_generic_context_find() returns the gl shared context struct but this is not just a read-only operation. It in turn calls window_use which may call make_current. This can invalidate the work of evas gl when the API tried to switch to a specific context. This fixes evas gl with multiple outputs. Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-08-25evas: remove dead code to improve readability.Cedric BAIL
2017-08-25evas: make Evas_GL work with multi output.Cedric BAIL
2017-08-25evas: reorder rendering phase to group output related operation.Cedric BAIL
2017-08-25evas: Evas_Canvas3D rendering logic need a complete overhaul.Cedric BAIL
For now, do not use Evas_Canvas3D in multi output context, it won't work. The update code for Evas_Canvas3D_Node might trigger rendering logic, which is opposite to what the scene graph logic should do. It require to much reshuffle around to handle that case at the moment. So I am just adding a warning.
2017-08-25evas: propagate output in evas_render_updates_internal_loop instead of using ↵Cedric BAIL
ENDT.
2017-08-25evas: enable handling multi output in evas_render_mapped.Cedric BAIL
2017-08-25evas: propagate output to evas_render_mask_subrender and don't use ENDT there.Cedric BAIL
2017-08-25evas: use output instead of default one during rendering of proxy.Cedric BAIL
2017-08-25evas: remove unused engine data from error set/get code.Cedric BAIL
2017-08-25evas: destroy seats and inputs before the display disapear.Cedric BAIL
2017-08-25evas: no more use of ENDT outside of evas_render.Cedric BAIL
2017-08-25evas: make vector graphic support multi output.Cedric BAIL
2017-08-25evas: do not use default output or any other during render pre.Cedric BAIL
2017-08-25evas: remove unecessary use of output in filter code.Cedric BAIL
2017-08-25evas: make image_native_set use engine context not output.Cedric BAIL
2017-08-25evas: make all window GLES3 or none.Cedric BAIL
2017-08-25evas: make function to find evas gl context from engine shared across backend.Cedric BAIL
2017-08-25evas: make filter handle multi output.Cedric BAIL
2017-08-25evas: make Evas_GL start to use engine and output separately.Cedric BAIL
2017-08-25evas: convert Evas3D use of output to engine when meaningful.Cedric BAIL
2017-08-25evas: find a best possible output to manage an object to get pixels from.Cedric BAIL
The code shouldn't really need an output for getting the pixels, it just happen that some of the backend function really need one to get a GL context.
2017-08-25evas: remove dead code that won't be easy to bring back to life.Cedric BAIL
2017-08-25evas: all context function use already ENC.Cedric BAIL
2017-08-25evas: remove image_content_hint_get from backend as it is unused.Cedric BAIL