evas: Fix bad clipping with proxy
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 27 Jun 2016 11:36:24 +0000 (20:36 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 27 Jun 2016 12:04:49 +0000 (21:04 +0900)
evas-images2 example was broken due to excessive clipping.
This is one more issue with the cached clip geometry.

By default proxy_src_clip is true. The doc (that I wrote)
mentions that it means both objects (image proxy & source)
share the same clipper. So, this does not mean that the proxy
is clipped to the geometry of the source (this can be useful
in some cases, when replacing an object with a proxy to apply
some kind of effect on it... but this could be rare).

Thanks Amitesh for the report.

@fix

src/lib/evas/canvas/evas_object_image.c

index 2bfd1fa..4bd1257 100644 (file)
@@ -1841,13 +1841,13 @@ _evas_image_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
         uvw = source->cur->geometry.w;
         uvh = source->cur->geometry.h;
         /* check source_clip since we skip proxy_subrender here */
-        if (o->proxy_src_clip)
+        if (o->proxy_src_clip && source->cur->clipper)
           {
              ENFN->context_clip_clip(ENDT, context,
-                                     source->cur->cache.clip.x + x,
-                                     source->cur->cache.clip.y + y,
-                                     source->cur->cache.clip.w,
-                                     source->cur->cache.clip.h);
+                                     source->cur->clipper->cur->cache.clip.x + x,
+                                     source->cur->clipper->cur->cache.clip.y + y,
+                                     source->cur->clipper->cur->cache.clip.w,
+                                     source->cur->clipper->cur->cache.clip.h);
           }
      }
    else