From 8be4940bb356838c28b72553c277762d581206c6 Mon Sep 17 00:00:00 2001 From: Rafael Antognolli Date: Tue, 19 Feb 2013 09:56:39 -0300 Subject: [PATCH] evas/wayland_shm: Remove x,y offsets from swapbuf related APIs. These offsets can be calculated later during the resize operations. --- src/modules/evas/engines/wayland_shm/evas_engine.c | 18 ++++++------------ src/modules/evas/engines/wayland_shm/evas_engine.h | 2 +- src/modules/evas/engines/wayland_shm/evas_swapbuf.c | 10 +++------- src/modules/evas/engines/wayland_shm/evas_swapbuf.h | 2 +- src/modules/evas/engines/wayland_shm/evas_swapper.c | 14 +++++++------- src/modules/evas/engines/wayland_shm/evas_swapper.h | 2 +- 6 files changed, 19 insertions(+), 29 deletions(-) diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c b/src/modules/evas/engines/wayland_shm/evas_engine.c index 4c5802d..6e6f73f 100644 --- a/src/modules/evas/engines/wayland_shm/evas_engine.c +++ b/src/modules/evas/engines/wayland_shm/evas_engine.c @@ -34,7 +34,7 @@ struct _Render_Engine }; /* local function prototypes */ -static void *_output_engine_setup(int x, int y, int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool destination_alpha, struct wl_shm *wl_shm, struct wl_surface *wl_surface, int try_swap); +static void *_output_engine_setup(int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool destination_alpha, struct wl_shm *wl_shm, struct wl_surface *wl_surface, int try_swap); static Tilebuf_Rect *_merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3); /* engine function prototypes */ @@ -60,7 +60,7 @@ int _evas_engine_way_shm_log_dom = -1; /* local functions */ static void * -_output_engine_setup(int x, int y, int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool destination_alpha, struct wl_shm *wl_shm, struct wl_surface *wl_surface, int try_swap) +_output_engine_setup(int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool destination_alpha, struct wl_shm *wl_shm, struct wl_surface *wl_surface, int try_swap) { Render_Engine *re = NULL; @@ -82,13 +82,10 @@ _output_engine_setup(int x, int y, int w, int h, unsigned int rotation, unsigned if (try_swap) { - if ((re->ob = evas_swapbuf_setup(x, y, w, h, rotation, depth, - destination_alpha, wl_shm, + if ((re->ob = evas_swapbuf_setup(w, h, rotation, depth, + destination_alpha, wl_shm, wl_surface))) { - re->ob->x = x; - re->ob->y = y; - re->outbuf_free = evas_swapbuf_free; re->outbuf_reconfigure = evas_swapbuf_reconfigure; re->outbuf_update_region_new = evas_swapbuf_update_region_new; @@ -238,8 +235,7 @@ eng_setup(Evas *eo_evas, void *einfo) } if (!(re = - _output_engine_setup(0, 0, - epd->output.w, epd->output.h, + _output_engine_setup(epd->output.w, epd->output.h, info->info.rotation, info->info.depth, info->info.destination_alpha, info->info.wl_shm, info->info.wl_surface, @@ -257,9 +253,7 @@ 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(0, - 0, - epd->output.w, epd->output.h, + if ((re->ob = evas_swapbuf_setup(epd->output.w, epd->output.h, info->info.rotation, info->info.depth, info->info.destination_alpha, diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h b/src/modules/evas/engines/wayland_shm/evas_engine.h index e25a887..190a8cc 100644 --- a/src/modules/evas/engines/wayland_shm/evas_engine.h +++ b/src/modules/evas/engines/wayland_shm/evas_engine.h @@ -60,7 +60,7 @@ enum struct _Outbuf { - int x, y, w, h; + int w, h; unsigned int rotation; Outbuf_Depth depth; int onebuf; diff --git a/src/modules/evas/engines/wayland_shm/evas_swapbuf.c b/src/modules/evas/engines/wayland_shm/evas_swapbuf.c index e1717c2..da82623 100644 --- a/src/modules/evas/engines/wayland_shm/evas_swapbuf.c +++ b/src/modules/evas/engines/wayland_shm/evas_swapbuf.c @@ -21,7 +21,7 @@ /* local function prototypes */ Outbuf * -evas_swapbuf_setup(int x, int y, int w, int h, unsigned int rotation, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *wl_shm, struct wl_surface *wl_surface) +evas_swapbuf_setup(int w, int h, unsigned int rotation, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *wl_shm, struct wl_surface *wl_surface) { Outbuf *ob = NULL; @@ -32,8 +32,6 @@ evas_swapbuf_setup(int x, int y, int w, int h, unsigned int rotation, Outbuf_Dep return NULL; /* set some properties */ - ob->x = x; - ob->y = y; ob->w = w; ob->h = h; ob->rotation = rotation; @@ -45,13 +43,13 @@ evas_swapbuf_setup(int x, int y, int w, int h, unsigned int rotation, Outbuf_Dep if ((ob->rotation == 0) || (ob->rotation == 180)) { ob->priv.swapper = - evas_swapper_setup(x, y, w, h, depth, alpha, ob->priv.wl.shm, + evas_swapper_setup(0, 0, w, h, depth, alpha, ob->priv.wl.shm, ob->priv.wl.surface); } else if ((ob->rotation == 90) || (ob->rotation == 270)) { ob->priv.swapper = - evas_swapper_setup(x, y, h, w, depth, alpha, ob->priv.wl.shm, + evas_swapper_setup(0, 0, h, w, depth, alpha, ob->priv.wl.shm, ob->priv.wl.surface); } @@ -103,8 +101,6 @@ evas_swapbuf_reconfigure(Outbuf *ob, int x, int y, int w, int h, unsigned int ro return; /* set some properties */ - ob->x = x; - ob->y = y; ob->w = w; ob->h = h; ob->rotation = rotation; diff --git a/src/modules/evas/engines/wayland_shm/evas_swapbuf.h b/src/modules/evas/engines/wayland_shm/evas_swapbuf.h index 874b820..cc895f6 100644 --- a/src/modules/evas/engines/wayland_shm/evas_swapbuf.h +++ b/src/modules/evas/engines/wayland_shm/evas_swapbuf.h @@ -3,7 +3,7 @@ # include "evas_engine.h" -Outbuf *evas_swapbuf_setup(int x, int y, int w, int h, unsigned int rotation, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *wl_shm, struct wl_surface *wl_surface); +Outbuf *evas_swapbuf_setup(int w, int h, unsigned int rotation, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *wl_shm, struct wl_surface *wl_surface); void evas_swapbuf_free(Outbuf *ob); void evas_swapbuf_reconfigure(Outbuf *ob, int x, int y, int w, int h, unsigned int rotation, Outbuf_Depth depth, Eina_Bool alpha); RGBA_Image *evas_swapbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch); diff --git a/src/modules/evas/engines/wayland_shm/evas_swapper.c b/src/modules/evas/engines/wayland_shm/evas_swapper.c index 796489b..2c77a9b 100644 --- a/src/modules/evas/engines/wayland_shm/evas_swapper.c +++ b/src/modules/evas/engines/wayland_shm/evas_swapper.c @@ -28,7 +28,7 @@ struct _Wl_Buffer struct _Wl_Swapper { Wl_Buffer buff[3]; - int x, y, w, h, depth; + int dx, dy, w, h, depth; int buff_cur, buff_num; struct wl_shm *shm; struct wl_surface *surface; @@ -56,7 +56,7 @@ static const struct wl_buffer_listener _evas_swapper_buffer_listener = /* local variables */ Wl_Swapper * -evas_swapper_setup(int x, int y, int w, int h, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface) +evas_swapper_setup(int dx, int dy, int w, int h, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface) { Wl_Swapper *ws; int i = 0; @@ -69,8 +69,8 @@ evas_swapper_setup(int x, int y, int w, int h, Outbuf_Depth depth, Eina_Bool alp return NULL; /* set some properties */ - ws->x = x; - ws->y = y; + ws->dx = dx; + ws->dy = dy; ws->w = w; ws->h = h; ws->depth = depth; @@ -419,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, ws->x, ws->y); - ws->x = 0; - ws->y = 0; + wl_surface_attach(ws->surface, wb->buffer, ws->dx, ws->dy); + ws->dx = 0; + ws->dy = 0; sent = wb->buffer; } diff --git a/src/modules/evas/engines/wayland_shm/evas_swapper.h b/src/modules/evas/engines/wayland_shm/evas_swapper.h index e711b8f..7506793 100644 --- a/src/modules/evas/engines/wayland_shm/evas_swapper.h +++ b/src/modules/evas/engines/wayland_shm/evas_swapper.h @@ -5,7 +5,7 @@ typedef struct _Wl_Swapper Wl_Swapper; -Wl_Swapper *evas_swapper_setup(int x, int y, int w, int h, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface); +Wl_Swapper *evas_swapper_setup(int dx, int dy, int w, int h, Outbuf_Depth depth, Eina_Bool alpha, struct wl_shm *shm, struct wl_surface *surface); void evas_swapper_swap(Wl_Swapper *ws, Eina_Rectangle *rects, unsigned int count); void evas_swapper_free(Wl_Swapper *ws); void *evas_swapper_buffer_map(Wl_Swapper *ws); -- 2.7.4