fix overdraw issue in evas when clips change
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 16 Apr 2014 07:14:16 +0000 (16:14 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 16 Apr 2014 07:14:16 +0000 (16:14 +0900)
the comments say it all. this stops adding massive full window updates
when clippers lose all children (and are visible) or gain a first
child while visible as all code hides these clip rects (or shows them)
in these cases and other usages just make no sense.

src/lib/evas/canvas/evas_clip.c
src/lib/evas/canvas/evas_object_rectangle.c

index 33c2d6f..20c302c 100644 (file)
@@ -264,7 +264,9 @@ _evas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *
                   state_write->have_clipees = 0;
                }
              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))
                {
                   if (obj->cur->clipper->layer)
@@ -277,6 +279,7 @@ _evas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *
                                                  obj->cur->clipper->cur->geometry.h);
                     }
                }
+ */
           }
         evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
         evas_object_change(eo_obj, obj);
@@ -294,10 +297,14 @@ _evas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Object *
         clip->changed = 1;
         e = clip->layer->evas;
         e->changed = 1;
+/* i know this was to handle a case where a clip starts having children and
+ * stops being a solid colored box - no one ever does that... they hide the clp
+ * so dont add damages
         evas_damage_rectangle_add(e->evas,
                                   clip->cur->geometry.x + e->framespace.x,
                                   clip->cur->geometry.y + e->framespace.y,
                                   clip->cur->geometry.w, clip->cur->geometry.h);
+ */
      }
    EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
      {
@@ -376,7 +383,9 @@ _evas_object_clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj)
                   state_write->have_clipees = 0;
                }
              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))
                {
                   if (obj->cur->clipper->layer)
@@ -389,6 +398,7 @@ _evas_object_clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj)
                                                  obj->cur->clipper->cur->geometry.h);
                     }
                }
+ */
           }
        evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
      }
index 192895f..6903b3a 100644 (file)
@@ -242,8 +242,8 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj,
    /* it obviously didn't change - add a NO obscure - this "unupdates"  this */
    /* area so if there were updates for it they get wiped. don't do it if we */
    /* arent fully opaque and we are visible */
-   if (evas_object_is_visible(eo_obj) &&
-       evas_object_is_opaque(eo_obj) &&
+   if (evas_object_is_visible(eo_obj, obj) &&
+       evas_object_is_opaque(eo_obj, obj) &&
        (!obj->clip.clipees))
      {
         Evas_Coord x, y, w, h;
@@ -260,10 +260,11 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj,
                                 obj->cur->clipper->cur->cache.clip.w,
                                 obj->cur->clipper->cur->cache.clip.h);
           }
-        e->engine.func->output_redraws_rect_del(e->engine.data.output,
-                                                x + e->framespace.x,
-                                                y + e->framespace.y,
-                                                w, h);
+        obj->layer->evas->engine.func->output_redraws_rect_del
+        (obj->layer->evas->engine.data.output,
+         x + obj->layer->evas->framespace.x,
+         y + obj->layer->evas->framespace.y,
+         w, h);
      }
    done:
    evas_object_render_pre_effect_updates(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);