evas: Some more opacity check fixes
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 18 Jul 2016 04:37:15 +0000 (13:37 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 18 Jul 2016 04:38:05 +0000 (13:38 +0900)
This should fix T3309

Snapshot objects are image objects, so the function is_opaque
exists. No need to bypass it. Also, alpha rectangles are not
opaque. Assume that anything with a filter is not opaque.

All of this fixes T3309 but the main point was on snapshot
objects (probably because the only point of a snapshot is
to apply a filter on it).

src/lib/evas/canvas/evas_object_image.c
src/lib/evas/canvas/evas_object_rectangle.c
src/lib/evas/include/evas_inline.x

index 8f40147..36babe3 100644 (file)
@@ -2489,6 +2489,8 @@ evas_object_image_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
           return o->cur->opaque;
         if (!o->engine_data)
           return o->cur->opaque;
+        if (o->has_filter)
+          return o->cur->opaque;
 
         // FIXME: use proxy
         if (o->cur->source)
index 122d755..d394546 100644 (file)
@@ -362,7 +362,7 @@ evas_object_rectangle_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
        return 1;
    if (obj->cur->render_op != EVAS_RENDER_BLEND)
        return 0;
-   return 1;
+   return (obj->cur->cache.clip.a == 255) ? 1 : 0;
 }
 
 static int
index 6255614..510077c 100644 (file)
@@ -79,9 +79,6 @@ evas_object_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
         if ((obj->cur->clipper && obj->cur->clipper->mask->is_mask) ||
             (obj->clip.mask))
           return 0;
-        /* Non masked snapshot are supposed to be opaque */
-        if (obj->cur->snapshot)
-          return 1;
         if (obj->func->is_opaque)
           return obj->func->is_opaque(eo_obj, obj, obj->private_data);
         return 1;