aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@linux.intel.com>2013-02-18 14:31:17 -0300
committerRafael Antognolli <rafael.antognolli@linux.intel.com>2013-02-19 10:18:03 -0300
commitdc0d88df9cd12839c2cd2c931e3510a2478ca59d (patch)
treeb589272d7019202353a5edd3d10a6df524d6783a /src
parentcf67e69b50698acf16e10004af0c8432d1c366d1 (diff)
downloadefl-dc0d88df9cd12839c2cd2c931e3510a2478ca59d.tar.gz
efl-dc0d88df9cd12839c2cd2c931e3510a2478ca59d.tar.xz
efl-dc0d88df9cd12839c2cd2c931e3510a2478ca59d.zip
ecore_evas/wayland_shm: Fixed window resize.
Using the server_allocation/allocation to determine the resize offset was not completely precise, and causing the window to not always resize correctly. Additionally, calling evas_engine_info_set() on every resize step caused the window content to blink and resize very slow, because the swap buffer, swapper, and everything were being destroyed and recreated. Now only the swapbuf_reconfigure is being called during the resize, which is way faster.
Diffstat (limited to 'src')
-rw-r--r--src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c20
-rw-r--r--src/modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h5
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_engine.c41
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_swapper.c10
4 files changed, 34 insertions, 42 deletions
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
index 6105863bc..27e98656d 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
@@ -299,28 +299,14 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
if (wdata->win)
{
Ecore_Wl_Window *win;
- Evas_Coord x = 0, y = 0;
Evas_Engine_Info_Wayland_Shm *einfo;
win = wdata->win;
- if (win->surface)
- {
- if (win->edges & 4)
- x = win->server_allocation.w - win->allocation.w;
- if (win->edges & 1)
- y = win->server_allocation.h - win->allocation.h;
- }
-
- win->edges = 0;
if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
- {
- printf("Setting Resize Edges: %d %d\n", x, y);
- einfo->info.edges.x = x;
- einfo->info.edges.y = y;
- if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
- ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
- }
+ einfo->info.edges = win->edges;
+
+ win->edges = 0;
win->server_allocation = win->allocation;
ecore_wl_window_update_size(wdata->win, w, h);
diff --git a/src/modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h b/src/modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h
index 7482cde0d..b1cb310dc 100644
--- a/src/modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h
+++ b/src/modules/evas/engines/wayland_shm/Evas_Engine_Wayland_Shm.h
@@ -18,10 +18,7 @@ struct _Evas_Engine_Info_Wayland_Shm
unsigned int rotation, depth;
Eina_Bool destination_alpha : 1;
- struct
- {
- int x, y;
- } edges;
+ int edges;
} info;
/* non-blocking or blocking mode */
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c b/src/modules/evas/engines/wayland_shm/evas_engine.c
index f6fc17e97..4c5802d91 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.c
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.c
@@ -9,6 +9,7 @@ typedef struct _Render_Engine Render_Engine;
struct _Render_Engine
{
+ Evas_Engine_Info_Wayland_Shm *info;
Outbuf *ob;
Tilebuf *tb;
@@ -237,13 +238,14 @@ eng_setup(Evas *eo_evas, void *einfo)
}
if (!(re =
- _output_engine_setup(info->info.edges.x, info->info.edges.y,
- epd->output.w, epd->output.h,
- info->info.rotation, info->info.depth,
- info->info.destination_alpha,
- info->info.wl_shm, info->info.wl_surface,
+ _output_engine_setup(0, 0,
+ epd->output.w, epd->output.h,
+ info->info.rotation, info->info.depth,
+ info->info.destination_alpha,
+ info->info.wl_shm, info->info.wl_surface,
try_swap)))
return 0;
+ re->info = info;
}
else
@@ -255,13 +257,13 @@ eng_setup(Evas *eo_evas, void *einfo)
/* we have an existing render engine */
if (re->ob) re->outbuf_free(re->ob);
- if ((re->ob = evas_swapbuf_setup(info->info.edges.x,
- info->info.edges.y,
- epd->output.w, epd->output.h,
- info->info.rotation,
- info->info.depth,
- info->info.destination_alpha,
- info->info.wl_shm,
+ if ((re->ob = evas_swapbuf_setup(0,
+ 0,
+ epd->output.w, epd->output.h,
+ info->info.rotation,
+ info->info.depth,
+ info->info.destination_alpha,
+ info->info.wl_shm,
info->info.wl_surface)))
{
re->outbuf_free = evas_swapbuf_free;
@@ -320,14 +322,23 @@ static void
eng_output_resize(void *data, int w, int h)
{
Render_Engine *re;
+ Evas_Engine_Info_Wayland_Shm *info;
+ int dx = 0, dy = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!(re = (Render_Engine *)data)) return;
- re->outbuf_reconfigure(re->ob, re->ob->x, re->ob->y, w, h,
- re->ob->rotation, re->ob->depth,
- re->ob->priv.destination_alpha);
+ if (!(info = re->info)) return;
+
+ if (info->info.edges & 4)
+ dx = re->ob->w - w;
+ if (info->info.edges & 1)
+ dy = re->ob->h - h;
+
+ re->outbuf_reconfigure(re->ob, dx, dy, w, h,
+ info->info.rotation, info->info.depth,
+ info->info.destination_alpha);
evas_common_tilebuf_free(re->tb);
if ((re->tb = evas_common_tilebuf_new(w, h)))
evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
diff --git a/src/modules/evas/engines/wayland_shm/evas_swapper.c b/src/modules/evas/engines/wayland_shm/evas_swapper.c
index 34f1b66cb..796489bf9 100644
--- a/src/modules/evas/engines/wayland_shm/evas_swapper.c
+++ b/src/modules/evas/engines/wayland_shm/evas_swapper.c
@@ -17,7 +17,7 @@
typedef struct _Wl_Buffer Wl_Buffer;
struct _Wl_Buffer
{
- int x, y, w, h;
+ int w, h;
struct wl_buffer *buffer;
void *data;
int offset;
@@ -320,8 +320,6 @@ _evas_swapper_buffer_new(Wl_Swapper *ws, Wl_Buffer *wb)
/* make sure swapper has a shm */
if (!ws->shm) return EINA_FALSE;
- wb->x = ws->x;
- wb->y = ws->y;
wb->w = ws->w;
wb->h = ws->h;
@@ -421,9 +419,9 @@ _evas_swapper_buffer_put(Wl_Swapper *ws, Wl_Buffer *wb, Eina_Rectangle *rects, u
/* surface attach */
if (sent != wb->buffer)
{
- wl_surface_attach(ws->surface, wb->buffer, wb->x, wb->y);
- wb->x = 0;
- wb->y = 0;
+ wl_surface_attach(ws->surface, wb->buffer, ws->x, ws->y);
+ ws->x = 0;
+ ws->y = 0;
sent = wb->buffer;
}