From d38a32c36e7abecd49cabf81b64db7049edaad84 Mon Sep 17 00:00:00 2001 From: raster Date: Fri, 21 May 2010 07:10:45 +0000 Subject: [PATCH] big patch from Samsung SAIT (Advanced research group) for async multi-frame rendering. to turn on: 1. configure with --enable-async-render 2. export EVAS_RENDER_MODE=non-blocking presto. necessitates some api swizzling (thus the expedite. ecore etc. changes) the kind of results you get on a desktop: http://www.rasterman.com/files/evas-async-vs-none.html git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@49087 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- AUTHORS | 2 ++ src/lib/ecore/ecore_private.h | 2 ++ src/lib/ecore_evas/ecore_evas_x.c | 48 +++++++++++++++++++++++++++++++++------ src/lib/ecore_x/xlib/ecore_x.c | 3 +++ 4 files changed, 48 insertions(+), 7 deletions(-) diff --git a/AUTHORS b/AUTHORS index 4acdbfb..e9bda20 100644 --- a/AUTHORS +++ b/AUTHORS @@ -29,3 +29,5 @@ Lars Munch Andre Dieb Mathieu Taillefumier Rui Miguel Silva Seabra +Saumsung Electronics +Samsung SAIT diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h index ea59794..86c0d71 100644 --- a/src/lib/ecore/ecore_private.h +++ b/src/lib/ecore/ecore_private.h @@ -57,6 +57,8 @@ extern int _ecore_log_dom ; # define CLAMP(x, min, max) (((x) > (max)) ? (max) : (((x) < (min)) ? (min) : (x))) #endif +#define EVAS_FRAME_QUEUING 1 /* for test */ + #define READBUFSIZ 65536 #define ECORE_MAGIC_NONE 0x1234fedc diff --git a/src/lib/ecore_evas/ecore_evas_x.c b/src/lib/ecore_evas/ecore_evas_x.c index ff5a36e..c322f65 100644 --- a/src/lib/ecore_evas/ecore_evas_x.c +++ b/src/lib/ecore_evas/ecore_evas_x.c @@ -237,9 +237,21 @@ _ecore_evas_x_render(Ecore_Evas *ee) EINA_LIST_FOREACH(updates, l, r) ecore_x_window_area_clear(ee->prop.window, r->x, r->y, r->w, r->h); if ((ee->shaped) && (updates)) - ecore_x_window_shape_mask_set(ee->prop.window, ee->engine.x.mask); -// if ((ee->alpha) && (updates)) -// ecore_x_window_shape_input_mask_set(ee->prop.window, ee->engine.x.mask); + { +#ifdef EVAS_FRAME_QUEUING + /* wait until ee->engine.x.mask being updated */ + evas_sync(ee->evas); +#endif + ecore_x_window_shape_mask_set(ee->prop.window, ee->engine.x.mask); + } + if ((ee->alpha) && (updates)) + { +#ifdef EVAS_FRAME_QUEUING + /* wait until ee->engine.x.mask being updated */ +// evas_sync(ee->evas); +#endif +// ecore_x_window_shape_input_mask_set(ee->prop.window, ee->engine.x.mask); + } evas_render_updates_free(updates); _ecore_evas_idle_timeout_update(ee); rend = 1; @@ -351,14 +363,25 @@ _ecore_evas_x_render(Ecore_Evas *ee) ((ee->should_be_visible) && (ee->prop.fullscreen)) || ((ee->should_be_visible) && (ee->prop.override))) { - updates = evas_render_updates(ee->evas); if (updates) { if (ee->shaped) - ecore_x_window_shape_mask_set(ee->prop.window, ee->engine.x.mask); -// if (ee->alpha) -// ecore_x_window_shape_input_mask_set(ee->prop.window, ee->engine.x.mask); + { +#ifdef EVAS_FRAME_QUEUING + /* wait until ee->engine.x.mask being updated */ + evas_sync(ee->evas); +#endif + ecore_x_window_shape_mask_set(ee->prop.window, ee->engine.x.mask); + } + if (ee->alpha) + { +#ifdef EVAS_FRAME_QUEUING + /* wait until ee->engine.x.mask being updated */ +// evas_sync(ee->evas); +#endif +// ecore_x_window_shape_input_mask_set(ee->prop.window, ee->engine.x.mask); + } evas_render_updates_free(updates); _ecore_evas_idle_timeout_update(ee); rend = 1; @@ -2829,6 +2852,17 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent, einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB; einfo->info.connection = ecore_x_display_get(); einfo->info.screen = NULL; +#ifdef EVAS_FRAME_QUEUING + { + char *render_mode; + render_mode = getenv("EVAS_RENDER_MODE"); + if (render_mode && !strcmp(render_mode, "non-blocking")) + { + einfo->render_mode = EVAS_RENDER_MODE_NONBLOCKING; + } + } +#endif + # endif /* ! BUILD_ECORE_EVAS_SOFTWARE_XCB */ einfo->info.drawable = ee->prop.window; if (argb) diff --git a/src/lib/ecore_x/xlib/ecore_x.c b/src/lib/ecore_x/xlib/ecore_x.c index 547b7ba..32c27f5 100644 --- a/src/lib/ecore_x/xlib/ecore_x.c +++ b/src/lib/ecore_x/xlib/ecore_x.c @@ -254,6 +254,9 @@ ecore_x_init(const char *name) _ecore_xlib_log_dom = -1; return --_ecore_x_init_count; } +#ifdef EVAS_FRAME_QUEUING + XInitThreads(); +#endif _ecore_x_disp = XOpenDisplay((char *)name); if (!_ecore_x_disp) goto shutdown_ecore_event; -- 2.7.4