devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5ebba4463570626f836cfb0b07b647c36aad7825

commit 5ebba4463570626f836cfb0b07b647c36aad7825
Author: Chris Michael <[email protected]>
Date:   Tue Dec 6 13:01:35 2016 -0500

    evas-wayland-shm: Don't destroy Outbuf on resize
    
    On an engine resize, rather than destroy & recreate the Outbuf
    structure (and the associated surface) we can just call the
    eng_output_resize function (which in turn will call
    outbuf_reconfigure) to update Outbuf with new properties. This saves
    us from having to create a whole new Outbuf every time we resize.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/modules/evas/engines/wayland_shm/evas_engine.c | 14 +++++---------
 src/modules/evas/engines/wayland_shm/evas_engine.h |  2 +-
 src/modules/evas/engines/wayland_shm/evas_outbuf.c |  3 ++-
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c 
b/src/modules/evas/engines/wayland_shm/evas_engine.c
index c8e4c19..385c713 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.c
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.c
@@ -20,6 +20,8 @@ static Evas_Func func, pfunc;
 Evas_Native_Tbm_Surface_Image_Set_Call  
glsym__evas_native_tbm_surface_image_set = NULL;
 Evas_Native_Tbm_Surface_Stride_Get_Call  
glsym__evas_native_tbm_surface_stride_get = NULL;
 
+static void eng_output_resize(void *data, int w, int h);
+
 /* engine structure data */
 typedef struct _Render_Engine Render_Engine;
 struct _Render_Engine
@@ -162,14 +164,7 @@ eng_setup(Evas *eo_evas, void *info)
           goto err;
      }
    else if ((einfo->info.wl_surface) && (!einfo->info.hidden))
-     {
-        Outbuf *ob;
-
-        ob = _evas_outbuf_setup(epd->output.w, epd->output.h, einfo);
-        if (ob)  evas_render_engine_software_generic_update(&re->generic, ob,
-                                                            epd->output.w,
-                                                            epd->output.h);
-     }
+     eng_output_resize(re, epd->output.w, epd->output.h);
 
    epd->engine.data.output = re;
    if (!epd->engine.data.output)
@@ -218,7 +213,8 @@ eng_output_resize(void *data, int w, int h)
 
    _evas_outbuf_reconfigure(re->generic.ob, w, h,
                             einfo->info.rotation, einfo->info.depth,
-                            einfo->info.destination_alpha, resize);
+                            einfo->info.destination_alpha, resize,
+                            einfo->info.hidden);
 
    evas_common_tilebuf_free(re->generic.tb);
    if ((re->generic.tb = evas_common_tilebuf_new(w, h)))
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h 
b/src/modules/evas/engines/wayland_shm/evas_engine.h
index 5bfb6c1..2708739 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.h
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.h
@@ -147,7 +147,7 @@ void _evas_outbuf_idle_flush(Outbuf *ob);
 
 Render_Engine_Swap_Mode _evas_outbuf_swap_mode_get(Outbuf *ob);
 int _evas_outbuf_rotation_get(Outbuf *ob);
-void _evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth 
depth, Eina_Bool alpha, Eina_Bool resize);
+void _evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth 
depth, Eina_Bool alpha, Eina_Bool resize, Eina_Bool hidden);
 void *_evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, 
int *cx, int *cy, int *cw, int *ch);
 void _evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, 
int y, int w, int h);
 void _evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update);
diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c 
b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
index fcfb8b9..e801474 100644
--- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
@@ -344,7 +344,7 @@ _evas_outbuf_rotation_get(Outbuf *ob)
 }
 
 void 
-_evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth 
depth, Eina_Bool alpha, Eina_Bool resize)
+_evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth 
depth, Eina_Bool alpha, Eina_Bool resize, Eina_Bool hidden)
 {
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -362,6 +362,7 @@ _evas_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, 
Outbuf_Depth depth,
    ob->rotation = rot;
    ob->depth = depth;
    ob->priv.destination_alpha = alpha;
+   ob->hidden = hidden;
 
    if (ob->hidden) return;
 

-- 


Reply via email to