evas: Fix masks of masks
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 16 Dec 2016 03:16:01 +0000 (12:16 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 16 Dec 2016 05:09:00 +0000 (14:09 +0900)
Don't ask. This is a world of magic.

src/lib/evas/canvas/evas_object_main.c
src/lib/evas/canvas/evas_render.c
src/lib/evas/include/evas_inline.x

index a4b67d8836dc21aae14250ecf831fdfb3ffb39f1..795ac3f98e6be83e2254baa4715f0862ea3859ad 100644 (file)
@@ -298,6 +298,7 @@ evas_object_clip_recalc(Evas_Object_Protected_Data *obj)
                {
                   Evas_Object_Protected_Data *parent =
                     efl_data_scope_get(obj->smart.parent, EFL_CANVAS_OBJECT_CLASS);
+                  evas_object_clip_recalc(parent);
                   if (parent->clip.mask)
                     {
                        if (parent->clip.mask != obj->clip.mask)
index 85acd3f75461bf09ccfac394242130d33b7ba269..a3b4a14d8f8e1cc89839b535ef09ce405cb225d8 100644 (file)
@@ -894,10 +894,8 @@ _evas_render_phase1_object_changed_normal(Phase1_Context *p1ctx,
              RD(level, "  skip - not smart, not active or clippees or not relevant\n");
           }
      }
-   else if (is_active &&
-            _evas_render_object_is_mask(obj) &&
-            (evas_object_is_visible(eo_obj, obj) ||
-             evas_object_was_visible(eo_obj, obj)))
+   else if (is_active && _evas_render_object_is_mask(obj) &&
+            (obj->cur->visible || obj->prev->visible))
      {
         if (EINA_UNLIKELY(obj->restack))
           OBJ_ARRAY_PUSH(p1ctx->restack_objects, obj);
@@ -1137,7 +1135,7 @@ _evas_render_phase1_object_process(Phase1_Context *p1ctx,
           }
         else if (EINA_UNLIKELY(is_active &&
                                _evas_render_object_is_mask(obj) &&
-                               evas_object_is_visible(eo_obj, obj)))
+                               obj->cur->visible))
           {
              RD(level, "  visible clipper image\n");
              OBJ_ARRAY_PUSH(p1ctx->render_objects, obj);
@@ -2812,8 +2810,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *evas,
              x = cx; y = cy; w = cw; h = ch;
              if (((w > 0) && (h > 0)) || (obj->is_smart))
                {
-                  Evas_Object_Protected_Data *prev_mask = NULL;
-                  Evas_Object_Protected_Data *mask = NULL;
+                  Evas_Object_Protected_Data *mask;
 
                   if (!obj->is_smart)
                     {
@@ -2835,15 +2832,11 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *evas,
 
                   ENFN->context_clip_set(ENDT, context, x, y, w, h);
 
-                  /* Clipper masks */
-                  if (_evas_render_object_is_mask(obj->cur->clipper))
-                    mask = obj->cur->clipper; // main object clipped by this mask
-                  else if (obj->clip.mask)
-                    mask = obj->clip.mask; // propagated clip
-                  prev_mask = obj->clip.prev_mask;
-
+                  mask = obj->clip.mask;
                   if (mask)
                     {
+                       Evas_Object_Protected_Data *prev_mask = obj->clip.prev_mask;
+
                        if (mask->mask->redraw || !mask->mask->surface)
                          evas_render_mask_subrender(obj->layer->evas, mask, prev_mask, 4, do_async);
 
index d56d36537483309a33d06167f5211c1995dc89e3..fdf91ddcac9d0a0ad7fd2886c229314e2b472092 100644 (file)
@@ -245,6 +245,8 @@ evas_object_is_active(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
       need to be smarter and only do that when really needed. */
    if (obj->proxy->proxies && obj->changed)
      return 1;
+   if (obj->mask->is_mask && obj->clip.clipees)
+     return 1;
    return 0;
 }