summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-03-21 09:29:32 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-03-21 09:29:32 -0400
commit6a1a1305b5111df48834afe155df7751e4430608 (patch)
treec27a20e0bfe70bf01f899c65557c578184268e52 /src
parentce17d5d9870a59396eb66c7ac55502cac3a9859a (diff)
downloadefl-6a1a1305b5111df48834afe155df7751e4430608.tar.gz
evas-wayland-shm: Fix rotation for wayland shm engine
Prior to this fix, window rotation was not operating correctly and the surface contents would get rendered at the wrong size and position. This patch fixes the engine so that rotation operates properly now. NB: Tested with the Window States(2) test in elementary Thanks to shiin for reporting :) @fix Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_outbuf.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
index 36a0cffa1e..492607ae9d 100644
--- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
@@ -43,9 +43,20 @@ _evas_outbuf_setup(int w, int h, int rot, Outbuf_Depth depth, Eina_Bool alpha, s
}
/* try to create the outbuf surface */
- if (!(ob->surface =
- _evas_shm_surface_create(disp, shm, surface, w, h, ob->num_buff, alpha, compositor_version)))
- goto surf_err;
+ if ((ob->rotation == 0) || (ob->rotation == 180))
+ {
+ ob->surface =
+ _evas_shm_surface_create(disp, shm, surface, w, h, ob->num_buff,
+ alpha, compositor_version);
+ if (!ob->surface) goto surf_err;
+ }
+ else if ((ob->rotation == 90) || (ob->rotation == 270))
+ {
+ ob->surface =
+ _evas_shm_surface_create(disp, shm, surface, h, w, ob->num_buff,
+ alpha, compositor_version);
+ if (!ob->surface) goto surf_err;
+ }
eina_array_step_set(&ob->priv.onebuf_regions, sizeof(Eina_Array), 8);
@@ -303,8 +314,16 @@ _evas_outbuf_reconfigure(Outbuf *ob, int x, int y, int w, int h, int rot, Outbuf
else
ob->surface->flags = 0;
- _evas_shm_surface_reconfigure(ob->surface, x, y, w, h,
- ob->num_buff, ob->surface->flags);
+ if ((ob->rotation == 0) || (ob->rotation == 180))
+ {
+ _evas_shm_surface_reconfigure(ob->surface, x, y, w, h,
+ ob->num_buff, ob->surface->flags);
+ }
+ else if ((ob->rotation == 90) || (ob->rotation == 270))
+ {
+ _evas_shm_surface_reconfigure(ob->surface, x, y, h, w,
+ ob->num_buff, ob->surface->flags);
+ }
_evas_outbuf_idle_flush(ob);
}