jpeg pushed a commit to branch master.

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

commit 89ee8e1446ca20e5d7a0d0df9da45003ddef0cc8
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Feb 3 15:38:50 2015 +0900

    Evas masking: Prevent drawing masks in the wrong surface
    
    Masks should be actually rendered only to their specific target
    surface.
---
 src/lib/evas/canvas/evas_object_image.c |  7 +++++++
 src/lib/evas/canvas/evas_render.c       | 10 ++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/lib/evas/canvas/evas_object_image.c 
b/src/lib/evas/canvas/evas_object_image.c
index 63a9838..9ec344a 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -2880,6 +2880,13 @@ evas_object_image_render(Evas_Object *eo_obj, 
Evas_Object_Protected_Data *obj, v
         return;
      }
 
+   /* Mask sanity */
+   if (obj->mask->is_mask && (surface != obj->mask->surface))
+     {
+        ERR("Drawing a mask to another surface? Something's wrong...");
+        return;
+     }
+
    /* We are displaying the overlay */
    if (o->video_visible)
      {
diff --git a/src/lib/evas/canvas/evas_render.c 
b/src/lib/evas/canvas/evas_render.c
index e4e9f3a..43c55cc 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1238,9 +1238,15 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object 
*eo_obj,
 
    if (mapped)
      {
-        if (use_mapped_ctx && _evas_render_object_is_mask(obj))
+        if (_evas_render_object_is_mask(obj))
           {
-             // don't return;
+             if (!use_mapped_ctx || (surface != obj->mask->surface))
+               {
+                  RDI(level);
+                  RD("      }\n");
+                  return clean_them;
+               }
+             // else don't return: draw mask in its surface
           }
         else if (proxy_src_clip)
           {

-- 


Reply via email to