From b492280687aaf2402c5ff0571f826c1ae4f25c41 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Fri, 31 May 2013 21:30:34 +0900 Subject: [PATCH] evas - fixed source clip. If the source object is a evas primitive object, then proxy won't clipped by proxy clipper itself. commit 11b43dad4b0565ac93e2f5d79c1d22e68c41f95d Author: ChunEon Park @hermet.pe.kr> Date: Fri May 31 20:28:12 2013 +0900 Change-Id: I353da496a518e9d8cec9395dac56bf2ff5d1759a --- src/lib/canvas/evas_object_image.c | 11 ++++++++++- src/lib/canvas/evas_render.c | 33 ++++++++++++++++++++++----------- src/lib/include/evas_private.h | 10 +++++++++- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/lib/canvas/evas_object_image.c b/src/lib/canvas/evas_object_image.c index a99b914..79893e7 100644 --- a/src/lib/canvas/evas_object_image.c +++ b/src/lib/canvas/evas_object_image.c @@ -2426,10 +2426,19 @@ _proxy_subrender(Evas *e, Evas_Object *source, Evas_Object *proxy) e->engine.func->context_free(e->engine.data.output, ctx); ctx = e->engine.func->context_new(e->engine.data.output); + + Eina_Bool source_clip = evas_object_image_source_clip_get(proxy); + + Evas_Proxy_Render_Data proxy_render_data = { + .proxy_obj = proxy, + .src_obj = source, + .source_clip = source_clip + }; + evas_render_mapped(e, source, ctx, source->proxy.surface, -source->cur.geometry.x, -source->cur.geometry.y, - 1, 0, 0, e->output.w, e->output.h, proxy + 1, 0, 0, e->output.w, e->output.h, &proxy_render_data #ifdef REND_DBG , 1 #endif diff --git a/src/lib/canvas/evas_render.c b/src/lib/canvas/evas_render.c index c0ef897..ea67e45 100644 --- a/src/lib/canvas/evas_render.c +++ b/src/lib/canvas/evas_render.c @@ -848,7 +848,8 @@ _smart_members_changed_check(Evas_Object *obj) Eina_Bool evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, int off_x, int off_y, int mapped, - int ecx, int ecy, int ecw, int ech, Evas_Object *proxy_obj + int ecx, int ecy, int ecw, int ech, + Evas_Proxy_Render_Data *proxy_render_data #ifdef REND_DBG , int level #endif @@ -859,13 +860,13 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, Eina_Bool clean_them = EINA_FALSE; Eina_Bool proxy_src_clip = EINA_TRUE; - if (!proxy_obj) + if (!proxy_render_data) { if (evas_object_is_source_invisible(obj)) return clean_them; } else - proxy_src_clip = evas_object_image_source_clip_get(proxy_obj); + proxy_src_clip = proxy_render_data->source_clip; evas_object_clip_recalc(obj); @@ -1016,7 +1017,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, obj->map.surface, off_x2, off_y2, 1, ecx, ecy, ecw, ech, - proxy_obj + proxy_render_data #ifdef REND_DBG , level + 1 #endif @@ -1130,7 +1131,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, surface, off_x, off_y, 1, ecx, ecy, ecw, ech, - proxy_obj + proxy_render_data #ifdef REND_DBG , level + 1 #endif @@ -1167,20 +1168,30 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, } else { + if (_evas_render_has_map(obj)) + evas_object_clip_recalc(obj); + //FIXME: Consider to clip by the proxy clipper. - if (proxy_obj && (proxy_obj != obj)) + if (proxy_render_data->src_obj != obj) { - if (_evas_render_has_map(obj)) - evas_object_clip_recalc(obj); - x = obj->cur.clipper->cur.geometry.x + off_x; y = obj->cur.clipper->cur.geometry.y + off_y; w = obj->cur.clipper->cur.geometry.w; h = obj->cur.clipper->cur.geometry.h; - e->engine.func->context_clip_set(e->engine.data.output, - ctx, x, y, w, h); } + else + { + Evas_Object *proxy = + proxy_render_data->proxy_obj; + x = proxy->cur.clipper->cur.geometry.x + off_x; + y = proxy->cur.clipper->cur.geometry.y + off_y; + w = proxy->cur.clipper->cur.geometry.w; + h = proxy->cur.clipper->cur.geometry.h; + } + e->engine.func->context_clip_set(e->engine.data.output, + ctx, x, y, w, h); + } } obj->func->render(obj, e->engine.data.output, ctx, diff --git a/src/lib/include/evas_private.h b/src/lib/include/evas_private.h index 982be8a..9f44098 100644 --- a/src/lib/include/evas_private.h +++ b/src/lib/include/evas_private.h @@ -50,6 +50,7 @@ typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array; typedef struct _Evas_Smart_Interfaces_Array Evas_Smart_Interfaces_Array; typedef struct _Evas_Post_Callback Evas_Post_Callback; typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point; +typedef struct _Evas_Proxy_Render_Data Evas_Proxy_Render_Data; enum _Evas_Font_Style { @@ -1076,6 +1077,13 @@ struct _Evas_Imaging_Font RGBA_Font *font; }; +struct _Evas_Proxy_Render_Data +{ + Evas_Object *proxy_obj; + Evas_Object *src_obj; + Eina_Bool source_clip : 1; +}; + int evas_async_events_init(void); int evas_async_events_shutdown(void); int evas_async_target_del(const void *target); @@ -1099,7 +1107,7 @@ Eina_Bool evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, int off_x, int off_y, int mapped, int ecx, int ecy, int ecw, int ech, - Evas_Object *proxy_obj + Evas_Proxy_Render_Data *proxy_render_data #ifdef REND_DBG , int level #endif -- 2.7.4