From d67edd059475e1831dcc08bd338fd2d47375066d Mon Sep 17 00:00:00 2001
From: Li Peng <peng.li@intel.com>
Date: Thu, 10 Jan 2013 14:35:56 +0800
Subject: [PATCH] reuse evas gl context and surface if change to new rotation

It will save the efforts to destroy and recreate gl context and
surface in evas window rotate

Signed-off-by: Li Peng <peng.li@intel.com>

---
 src/modules/engines/gl_x11/evas_engine.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/modules/engines/gl_x11/evas_engine.c b/src/modules/engines/gl_x11/evas_engine.c
index 370b77e..a9e4743 100755
--- a/src/modules/engines/gl_x11/evas_engine.c
+++ b/src/modules/engines/gl_x11/evas_engine.c
@@ -714,8 +714,7 @@ eng_setup(Evas *e, void *in)
                  (re->info->info.visual != re->win->visual) ||
                  (re->info->info.colormap != re->win->colormap) ||
                  (re->info->info.depth != re->win->depth) ||
-                 (re->info->info.destination_alpha != re->win->alpha) ||
-                 (re->info->info.rotation != re->win->rot))
+                 (re->info->info.destination_alpha != re->win->alpha))
                {
                   int inc = 0;
 
@@ -754,6 +753,12 @@ eng_setup(Evas *e, void *in)
                   eng_window_use(re->win);
                   evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot);
                }
+             else if (re->info->info.rotation != re->win->rot)
+               {
+                  re->win->rot = re->info->info.rotation;
+                  eng_window_use(re->win);
+                  evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot);
+               }
           }
      }
    if ((s = getenv("EVAS_GL_SWAP_MODE")))
-- 
1.7.2.2

