jpeg pushed a commit to branch efl-1.13.

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

commit e1bcd5ccae5d8c89ac1ab14e8aea2f2c45f6e4c1
Author: Youngbok Shin <[email protected]>
Date:   Tue Mar 17 11:02:04 2015 +0900

    evas/clip: If the clipper is image or has color, clipped area should be 
redrawn.
    
    Summary:
    If the clipper is image or has color, it affects to its clipees.
    Even if we unset the clipper or change the clipper to another object,
    it seems the clipper is not changed.
    
    Test Plan:
    Make two clipper objects and one clipee object.
    And make clip the clipee according to following example
    
    ex) Clipee object -> inner_clipper -> clipper
    
    evas_object_clip_set(clipee, inner_clipper);
    evas_object_clip_set(inner_clipper, clipper);
    
    After checking the result and hide inner_clipper.
    
    evas_object_clip_set(clipee, clipper);
    evas_object_hide(inner_clipper);
    
    See the result.
    
    Reviewers: raster, cedric, Hermet, jpeg
    
    Subscribers: woohyun, cedric
    
    Differential Revision: https://phab.enlightenment.org/D2112
    
    Signed-off-by: Jean-Philippe Andre <[email protected]>
    
    Note: Technically we should not check the color of the fact that
          the clipper is a mask and not a simple rect. But because of
          real-life performance issues, damage_add was disabled so we're
          trying to keep the perf in most cases while being correct in
          cases where the clipper is visually important.
    
    @fix (following hermet's advice)
---
 src/lib/evas/canvas/evas_clip.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c
index 0e1d43a..4eb3101 100644
--- a/src/lib/evas/canvas/evas_clip.c
+++ b/src/lib/evas/canvas/evas_clip.c
@@ -289,8 +289,13 @@ _evas_object_clip_set(Eo *eo_obj, 
Evas_Object_Protected_Data *obj, Evas_Object *
              EINA_COW_STATE_WRITE_END(obj->cur->clipper, state_write, cur);
 /* i know this was to handle a case where a clip stops having children and
  * becomes a solid colored box - no one ever does that... they hide the clip
- * so dont add damages
-             if ((obj->cur->clipper->cur) && (obj->cur->clipper->cur->visible))
+ * so dont add damages.
+ * But, if the clipper could affect color to its clipees,
+ * the clipped area should be redrawn. */
+             if (((obj->cur->clipper->cur) && 
(obj->cur->clipper->cur->visible)) &&
+                 (((obj->cur->clipper->cur->color.r != 255) || 
(obj->cur->clipper->cur->color.g != 255) ||
+                   (obj->cur->clipper->cur->color.b != 255) || 
(obj->cur->clipper->cur->color.a != 255)) ||
+                  (obj->cur->clipper->mask->is_mask)))
                {
                   if (obj->cur->clipper->layer)
                     {
@@ -302,7 +307,7 @@ _evas_object_clip_set(Eo *eo_obj, 
Evas_Object_Protected_Data *obj, Evas_Object *
                                                  
obj->cur->clipper->cur->geometry.h);
                     }
                }
- */
+
              _evas_object_clip_mask_unset(obj->cur->clipper);
           }
         evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
@@ -411,8 +416,13 @@ _evas_object_clip_unset(Eo *eo_obj, 
Evas_Object_Protected_Data *obj)
              EINA_COW_STATE_WRITE_END(obj->cur->clipper, state_write, cur);
 /* i know this was to handle a case where a clip stops having children and
  * becomes a solid colored box - no one ever does that... they hide the clip
- * so dont add damages
-             if ((obj->cur->clipper->cur) && (obj->cur->clipper->cur->visible))
+ * so dont add damages.
+ * But, if the clipper could affect color to its clipees,
+ * the clipped area should be redrawn. */
+             if (((obj->cur->clipper->cur) && 
(obj->cur->clipper->cur->visible)) &&
+                 (((obj->cur->clipper->cur->color.r != 255) || 
(obj->cur->clipper->cur->color.g != 255) ||
+                   (obj->cur->clipper->cur->color.b != 255) || 
(obj->cur->clipper->cur->color.a != 255)) ||
+                  (obj->cur->clipper->mask->is_mask)))
                {
                   if (obj->cur->clipper->layer)
                     {
@@ -424,7 +434,7 @@ _evas_object_clip_unset(Eo *eo_obj, 
Evas_Object_Protected_Data *obj)
                                                  
obj->cur->clipper->cur->geometry.h);
                     }
                }
- */
+
              _evas_object_clip_mask_unset(obj->cur->clipper);
           }
        evas_object_change(obj->cur->clipper->object, obj->cur->clipper);

-- 


Reply via email to