evas: Fix bad clipping with proxy 09/82609/2
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 27 Jun 2016 11:36:24 +0000 (20:36 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Sat, 6 Aug 2016 00:44:06 +0000 (17:44 -0700)
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

Signed-off-by: Pankaj Mittal <m.pankaj@samsung.com>
Change-Id: I910f57162064aafecc1b0397f8c7af6ba1469e94

src/lib/evas/canvas/evas_object_image.c

index 1a56d29..dc52388 100644 (file)
@@ -3354,13 +3354,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