From 8ffc0f2b9e2370d2893fcd6ef5309da4d53ebfda Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 25 Aug 2017 10:47:52 -0700 Subject: [PATCH] evas: prevent double tilebuf creation/destruction during window resize. --- src/modules/evas/engines/eglfs/evas_engine.c | 14 +++---------- src/modules/evas/engines/gl_drm/evas_engine.c | 10 --------- src/modules/evas/engines/gl_x11/evas_engine.c | 24 +++++++--------------- src/modules/evas/engines/wayland_egl/evas_engine.c | 16 ++------------- 4 files changed, 12 insertions(+), 52 deletions(-) diff --git a/src/modules/evas/engines/eglfs/evas_engine.c b/src/modules/evas/engines/eglfs/evas_engine.c index 9bdf1d3..6147775 100644 --- a/src/modules/evas/engines/eglfs/evas_engine.c +++ b/src/modules/evas/engines/eglfs/evas_engine.c @@ -810,20 +810,12 @@ eng_update(void *engine EINA_UNUSED, void *data, void *info, unsigned int w, uns w, h, info->info.rotation, info->info.depth); + evas_render_engine_software_generic_update(&re->generic.software, + re->generic.software.ob, + w, h); } } - if (re->generic.software.tb) - evas_common_tilebuf_free(re->generic.software.tb); - re->generic.software.tb = - evas_common_tilebuf_new(w, h); - if (re->generic.software.tb) - evas_common_tilebuf_set_tile_size(re->generic.software.tb, - TILESIZE, TILESIZE); - - if (re->generic.software.tb) - evas_render_engine_software_generic_tile_strict_set(&re->generic.software, EINA_TRUE); - evas_outbuf_use(eng_get_ob(re)); return 1; diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c index ad56991..13cdb93 100644 --- a/src/modules/evas/engines/gl_drm/evas_engine.c +++ b/src/modules/evas/engines/gl_drm/evas_engine.c @@ -1060,16 +1060,6 @@ eng_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w, unsig } } - if (re->generic.software.tb) - evas_common_tilebuf_free(re->generic.software.tb); - re->generic.software.tb = evas_common_tilebuf_new(w, h); - if (re->generic.software.tb) - evas_common_tilebuf_set_tile_size(re->generic.software.tb, - TILESIZE, TILESIZE); - - if (re->generic.software.tb) - evas_render_engine_software_generic_tile_strict_set(&re->generic.software, EINA_TRUE); - evas_outbuf_use(eng_get_ob(re)); return 1; diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c index 41a4af5..a91bda4 100644 --- a/src/modules/evas/engines/gl_x11/evas_engine.c +++ b/src/modules/evas/engines/gl_x11/evas_engine.c @@ -1736,10 +1736,8 @@ eng_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w, unsig (info->msaa_bits != eng_get_ob(re)->msaa_bits) || (info->info.destination_alpha != eng_get_ob(re)->alpha)) { - Outbuf *ob, *ob_old; + Outbuf *ob; - ob_old = re->generic.software.ob; - re->generic.software.ob = NULL; gl_wins--; ob = eng_window_new(info, @@ -1757,16 +1755,11 @@ eng_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w, unsig info->depth_bits, info->stencil_bits, info->msaa_bits); - if (!ob) - { - if (ob_old) eng_window_free(ob_old); - return 0; - } + if (!ob) return 0; eng_window_use(ob); - if (ob_old) eng_window_free(ob_old); - evas_render_engine_software_generic_update(&re->generic.software, ob, - w, h); + evas_render_engine_software_generic_update(&re->generic.software, + ob, w, h); gl_wins++; } else if ((eng_get_ob(re)->w != w) || @@ -1774,12 +1767,9 @@ eng_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w, unsig (eng_get_ob(re)->info->info.rotation != eng_get_ob(re)->rot)) { eng_outbuf_reconfigure(eng_get_ob(re), w, h, eng_get_ob(re)->info->info.rotation, 0); - if (re->generic.software.tb) - evas_common_tilebuf_free(re->generic.software.tb); - re->generic.software.tb = evas_common_tilebuf_new(w, h); - if (re->generic.software.tb) - evas_common_tilebuf_set_tile_size(re->generic.software.tb, - TILESIZE, TILESIZE); + evas_render_engine_software_generic_update(&re->generic.software, + re->generic.software.ob, + w, h); } } diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c index 25b7d67..0c183ba 100644 --- a/src/modules/evas/engines/wayland_egl/evas_engine.c +++ b/src/modules/evas/engines/wayland_egl/evas_engine.c @@ -722,8 +722,6 @@ eng_update(void *engine EINA_UNUSED, void *data, void *info, unsigned int w, uns eng_window_use(ob); - evas_render_engine_software_generic_update(&re->generic.software, - ob, w, h); gl_wins++; } else if ((ob->w != (int)w) || (ob->h != (int)h) || @@ -736,18 +734,8 @@ eng_update(void *engine EINA_UNUSED, void *data, void *info, unsigned int w, uns if (!eng_get_ob(re)) goto ob_err; - if (re->generic.software.tb) - evas_common_tilebuf_free(re->generic.software.tb); - re->generic.software.tb = evas_common_tilebuf_new(w, h); - - if (re->generic.software.tb) - { - evas_common_tilebuf_set_tile_size(re->generic.software.tb, - TILESIZE, TILESIZE); - evas_render_engine_software_generic_tile_strict_set - (&re->generic.software, EINA_TRUE); - } - + evas_render_engine_software_generic_update(&re->generic.software, + ob, w, h); eng_window_use(eng_get_ob(re)); return 1; -- 2.7.4