jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=84634ea51f18e6f88ca43527cfb7f2f56828e76a
commit 84634ea51f18e6f88ca43527cfb7f2f56828e76a 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. --- 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 833a7e4..a6f1e6f 100644 --- a/src/lib/evas/canvas/evas_clip.c +++ b/src/lib/evas/canvas/evas_clip.c @@ -294,8 +294,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) { @@ -307,7 +312,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); @@ -417,8 +422,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) { @@ -430,7 +440,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); --
