ecore-evas-wl: Reduce useless compositor redraws during render update
authorChris Michael <cp.michael@samsung.com>
Wed, 9 Apr 2014 08:44:16 +0000 (09:44 +0100)
committerChris Michael <cp.michael@samsung.com>
Wed, 9 Apr 2014 08:56:41 +0000 (09:56 +0100)
and update input & opaque regions after resizing.

@bugfix: We do not need to call ecore_wl_window_damage & commit here.
The damages are already handled in the evas engine for both shm & egl.
Those damages are sent to the compositor Already from the evas engine,
so we don't need to send the same damages twice. This reduces more
useless compositor redraws as we are not constantly sending damages &
calling commit twice for every frame.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c

index ef5ec4a..e1ef5a6 100644 (file)
@@ -69,19 +69,18 @@ _ecore_evas_wl_common_render_updates_process(Ecore_Evas *ee, Eina_List *updates)
 
    if ((ee->visible) && (updates))
      {
-        Eina_List *l = NULL;
-        Eina_Rectangle *r;
-        Ecore_Evas_Engine_Wl_Data *wdata;
+        /* Eina_List *l = NULL; */
+        /* Eina_Rectangle *r; */
+        /* Ecore_Evas_Engine_Wl_Data *wdata; */
 
-        if (!(wdata = ee->engine.data)) return 0;
+        /* if (!(wdata = ee->engine.data)) return 0; */
 
-        EINA_LIST_FOREACH(updates, l, r)
-          ecore_wl_window_damage(wdata->win,
-                                 r->x, r->y, r->w, r->h);
+        /* EINA_LIST_FOREACH(updates, l, r) */
+        /*   ecore_wl_window_damage(wdata->win, */
+        /*                          r->x, r->y, r->w, r->h); */
 
-        ecore_wl_window_commit(wdata->win);
-
-        ecore_wl_flush();
+        /* ecore_wl_window_commit(wdata->win); */
+        /* ecore_wl_flush(); */
 
         _ecore_evas_idle_timeout_update(ee);
         rend = 1;
@@ -740,7 +739,11 @@ _ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
           evas_object_resize(wdata->frame, w, h);
 
         if (wdata->win)
-          ecore_wl_window_update_size(wdata->win, w, h);
+          {
+             ecore_wl_window_update_size(wdata->win, w, h);
+             ecore_wl_window_input_region_set(wdata->win, 0, 0, w, h);
+             ecore_wl_window_opaque_region_set(wdata->win, 0, 0, w, h);
+          }
 
         if (ee->func.fn_resize) ee->func.fn_resize(ee);
      }