From 1563956299b6af669f5014e4cdc49b6f41b27934 Mon Sep 17 00:00:00 2001 From: Gwanglim Lee Date: Thu, 21 Aug 2014 11:01:17 +0200 Subject: [PATCH] evas: Evas_wayland_Egl - fix black surface during resize Summary: use eng_output_resize of software_generic engine and move wl_egl_window_resize to eng_outbuf_reconfigure. and remove eng_output_resize of wayland_egl. @fix Test Plan: run elementary_test with wayland_egl engine under wayland Reviewers: devilhorns, raster, stefan_schmidt, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1343 Signed-off-by: Cedric BAIL --- .../evas/engines/wayland_egl/evas_engine.c | 57 ------------------- .../evas/engines/wayland_egl/evas_wl_main.c | 31 ++++++++++ 2 files changed, 31 insertions(+), 57 deletions(-) diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c index 59f72408b2..6e5b9719a4 100644 --- a/src/modules/evas/engines/wayland_egl/evas_engine.c +++ b/src/modules/evas/engines/wayland_egl/evas_engine.c @@ -774,62 +774,6 @@ eng_output_free(void *data) } } -static void -eng_output_resize(void *data, int w, int h) -{ - Render_Engine *re; - Outbuf *ob; - - if (!(re = (Render_Engine *)data)) return; - if (!(ob = eng_get_ob(re))) return; - - eng_window_use(ob); - - if (ob->win) - { - int aw, ah, dx = 0, dy = 0; - - if ((ob->rot == 90) || (ob->rot == 270)) - wl_egl_window_get_attached_size(ob->win, &ah, &aw); - else - wl_egl_window_get_attached_size(ob->win, &aw, &ah); - - if (ob->info->info.edges & 4) // resize from left - { - if ((ob->rot == 90) || (ob->rot == 270)) - dx = ah - h; - else - dx = aw - w; - } - - if (ob->info->info.edges & 1) // resize from top - { - if ((ob->rot == 90) || (ob->rot == 270)) - dy = aw - w; - else - dy = ah - h; - } - - if ((ob->rot == 90) || (ob->rot == 270)) - wl_egl_window_resize(ob->win, h, w, dx, dy); - else - wl_egl_window_resize(ob->win, w, h, dx, dy); - } - - glsym_evas_gl_common_context_resize(ob->gl_context, w, h, ob->rot); - - 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_common_tilebuf_tile_strict_set(re->generic.software.tb, EINA_TRUE); - } -} - static void eng_output_dump(void *data) { @@ -1072,7 +1016,6 @@ module_open(Evas_Module *em) ORD(canvas_alpha_get); ORD(output_free); - ORD(output_resize); ORD(output_dump); ORD(image_native_set); diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c b/src/modules/evas/engines/wayland_egl/evas_wl_main.c index f64dabc5cd..3c6d29edbf 100644 --- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c +++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c @@ -316,6 +316,37 @@ eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth EIN ob->rot = rot; eng_window_use(ob); glsym_evas_gl_common_context_resize(ob->gl_context, w, h, rot); + + if (ob->win) + { + int aw, ah, dx = 0, dy = 0; + + if ((ob->rot == 90) || (ob->rot == 270)) + wl_egl_window_get_attached_size(ob->win, &ah, &aw); + else + wl_egl_window_get_attached_size(ob->win, &aw, &ah); + + if (ob->info->info.edges & 4) // resize from left + { + if ((ob->rot == 90) || (ob->rot == 270)) + dx = ah - h; + else + dx = aw - w; + } + + if (ob->info->info.edges & 1) // resize from top + { + if ((ob->rot == 90) || (ob->rot == 270)) + dy = aw - w; + else + dy = ah - h; + } + + if ((ob->rot == 90) || (ob->rot == 270)) + wl_egl_window_resize(ob->win, h, w, dx, dy); + else + wl_egl_window_resize(ob->win, w, h, dx, dy); + } } int