hermet pushed a commit to branch efl-1.11.

http://git.enlightenment.org/core/efl.git/commit/?id=a30bc6c18f47635c44807b7fd0a1c11888dde3c6

commit a30bc6c18f47635c44807b7fd0a1c11888dde3c6
Author: Gwanglim Lee <[email protected]>
Date:   Wed Aug 27 19:35:27 2014 +0900

    ecore_evas: Ecore_Evas_X - Fix broken rendering during rotation with resize
    
    Summary:
    When ee is trying to do rotation, ee should check whether given rotation 
value
    is portrait or not. Then it sets output size of evas canvas according to 
rotation value.
    But, ECORE_EVAS_PORTRAIT macro used in ee x engine only checks ee's 
rotation value, even
    if ee's rotation value is not updated yet. Thus we should change the logic 
to compare with
    given rotation value, not ee's rotation, before setting output size of evas.
    
    This fixes T1371 problem.
    @fix
    
    Test Plan:
    1. run elementary_test -to "window states"
    2. check resize
    3. rotation 0 ~ 270
    
    Reviewers: jpeg, raster, cedric, zmike, devilhorns, Hermet
    
    Reviewed By: Hermet
    
    Subscribers: cedric
    
    Maniphest Tasks: T1371
    
    Differential Revision: https://phab.enlightenment.org/D1351
---
 src/lib/ecore_evas/ecore_evas_private.h         | 5 ++++-
 src/modules/ecore_evas/engines/x/ecore_evas_x.c | 8 ++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/lib/ecore_evas/ecore_evas_private.h 
b/src/lib/ecore_evas/ecore_evas_private.h
index e84550b..3463599 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -33,8 +33,11 @@ EAPI extern int _ecore_evas_log_dom;
 #endif
 #define CRI(...) EINA_LOG_DOM_CRIT(_ecore_evas_log_dom, __VA_ARGS__)
 
+#define PORTRAIT_CHECK(r) \
+  ((r == 0) || (r == 180))
+
 #define ECORE_EVAS_PORTRAIT(ee) \
-  ((ee->rotation == 0) || (ee->rotation == 180))
+  (PORTRAIT_CHECK(ee->rotation))
 
 
 #define IDLE_FLUSH_TIME 0.5
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c 
b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index 7a54893..ab3f571 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -2197,7 +2197,7 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int 
rotation, int resize,
 
                   ecore_x_window_size_get(ee->prop.window, &w, &h);
                   ecore_x_window_resize(ee->prop.window, h, w);
-                  if (ECORE_EVAS_PORTRAIT(ee))
+                  if (PORTRAIT_CHECK(rotation))
                     {
                        evas_output_size_set(ee->evas, ee->req.w, ee->req.h);
                        evas_output_viewport_set(ee->evas, 0, 0, ee->req.w, 
ee->req.h);
@@ -2209,7 +2209,7 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int 
rotation, int resize,
                     }
                   if (ee->func.fn_resize) ee->func.fn_resize(ee);
                }
-             if (ECORE_EVAS_PORTRAIT(ee))
+             if (PORTRAIT_CHECK(rotation))
                evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.w, ee->req.h);
              else
                evas_damage_rectangle_add(ee->evas, 0, 0, ee->req.h, ee->req.w);
@@ -2219,7 +2219,7 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int 
rotation, int resize,
              /* int w, h; */
 
              /* ecore_x_window_size_get(ee->prop.window, &w, &h); */
-             if (ECORE_EVAS_PORTRAIT(ee))
+             if (PORTRAIT_CHECK(rotation))
                {
                   evas_output_size_set(ee->evas, ee->w, ee->h);
                   evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
@@ -2230,7 +2230,7 @@ _ecore_evas_x_rotation_set_internal(Ecore_Evas *ee, int 
rotation, int resize,
                   evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
                }
              if (ee->func.fn_resize) ee->func.fn_resize(ee);
-             if (ECORE_EVAS_PORTRAIT(ee))
+             if (PORTRAIT_CHECK(rotation))
                evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
              else
                evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);

-- 


Reply via email to