From ef3c3c69ff2b97f4525dd9de5a0f5297cdb62c31 Mon Sep 17 00:00:00 2001 From: Seokjae Jeong Date: Mon, 25 Oct 2010 23:40:07 +0900 Subject: [PATCH] [evas blend fix] SVN Changeset 52782: evas: fix rendering of object with color (*,*,*,0) and render_op != BLEND. raster, I have merged this one urgenly due to a request from MM FW. --- src/lib/canvas/evas_object_main.c | 14 +++++++------- src/lib/canvas/evas_render.c | 2 +- src/lib/include/evas_inline.x | 12 ++++++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/lib/canvas/evas_object_main.c b/src/lib/canvas/evas_object_main.c index 9f084f8..235a185 100644 --- a/src/lib/canvas/evas_object_main.c +++ b/src/lib/canvas/evas_object_main.c @@ -426,8 +426,8 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) obj->doing.in_move++; if (obj->smart.smart) { - if (obj->smart.smart->smart_class->move) - obj->smart.smart->smart_class->move(obj, x, y); + if (obj->smart.smart->smart_class->move) + obj->smart.smart->smart_class->move(obj, x, y); } obj->cur.geometry.x = x; obj->cur.geometry.y = y; @@ -477,7 +477,7 @@ evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) * @endcode * This is more evident in images, but text, textblock, lines * and polygons will behave similarly. Check their specific APIs - * to know how to achive your desired behavior. + * to know how to achieve your desired behavior. * * @ingroup Evas_Object_Group_Basic */ @@ -495,7 +495,7 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) if (obj->doing.in_resize > 0) { WRN("evas_object_resize() called on object %p when in the middle of resizing the same object", obj); - return; + return; } if ((obj->cur.geometry.w == w) && (obj->cur.geometry.h == h)) return; if (obj->layer->evas->events_frozen <= 0) @@ -509,7 +509,7 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) obj->doing.in_resize++; if (obj->smart.smart) { - if (obj->smart.smart->smart_class->resize) + if (obj->smart.smart->smart_class->resize) obj->smart.smart->smart_class->resize(obj, w, h); } obj->cur.geometry.w = w; @@ -517,7 +517,7 @@ evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) //// obj->cur.cache.geometry.validity = 0; evas_object_change(obj); evas_object_clip_dirty(obj); - obj->doing.in_resize--; + obj->doing.in_resize--; /* NB: evas_object_recalc_clippees was here previously ( < 08/07/2009) */ if (obj->layer->evas->events_frozen <= 0) { @@ -1210,7 +1210,7 @@ evas_object_color_set(Evas_Object *obj, int r, int g, int b, int a) obj->cur.color.g = g; obj->cur.color.b = b; evas_object_clip_dirty(obj); - if ((obj->cur.color.a == 0) && (a == 0)) return; + if ((obj->cur.color.a == 0) && (a == 0) && (obj->cur.render_op == EVAS_RENDER_BLEND)) return; obj->cur.color.a = a; evas_object_change(obj); } diff --git a/src/lib/canvas/evas_render.c b/src/lib/canvas/evas_render.c index 01cd61e..5bcd58d 100644 --- a/src/lib/canvas/evas_render.c +++ b/src/lib/canvas/evas_render.c @@ -1095,7 +1095,7 @@ evas_render_updates_internal(Evas *e, (!obj->delete_me) && (obj->cur.cache.clip.visible) && // (!obj->smart.smart) && - (obj->cur.color.a > 0)) + ((obj->cur.color.a > 0 || obj->cur.render_op != EVAS_RENDER_BLEND))) { int x, y, w, h; diff --git a/src/lib/include/evas_inline.x b/src/lib/include/evas_inline.x index 18b8e88..193eb63 100644 --- a/src/lib/include/evas_inline.x +++ b/src/lib/include/evas_inline.x @@ -12,7 +12,8 @@ evas_object_was_visible(Evas_Object *obj) { if ((obj->prev.visible) && ((obj->prev.cache.clip.visible) || (obj->smart.smart)) && - (obj->prev.cache.clip.a > 0)) + ((obj->prev.cache.clip.a > 0 && obj->prev.render_op == EVAS_RENDER_BLEND) + || obj->prev.render_op != EVAS_RENDER_BLEND)) { if (obj->func->was_visible) return obj->func->was_visible(obj); @@ -62,6 +63,8 @@ evas_object_is_opaque(Evas_Object *obj) return obj->func->is_opaque(obj); return 1; } + if (obj->cur.render_op == EVAS_RENDER_COPY) + return 1; return 0; } @@ -88,7 +91,8 @@ evas_object_is_visible(Evas_Object *obj) { if ((obj->cur.visible) && ((obj->cur.cache.clip.visible) || (obj->smart.smart)) && - (obj->cur.cache.clip.a > 0)) + ((obj->cur.cache.clip.a > 0 && obj->cur.render_op == EVAS_RENDER_BLEND) + || obj->cur.render_op != EVAS_RENDER_BLEND)) { if (obj->func->is_visible) return obj->func->is_visible(obj); @@ -196,7 +200,7 @@ evas_object_clip_recalc(Evas_Object *obj) } //// cx = obj->cur.cache.geometry.x; cy = obj->cur.cache.geometry.y; //// cw = obj->cur.cache.geometry.w; ch = obj->cur.cache.geometry.h; - if (obj->cur.color.a == 0) cvis = 0; + if (obj->cur.color.a == 0 && obj->cur.render_op == EVAS_RENDER_BLEND) cvis = 0; else cvis = obj->cur.visible; cr = obj->cur.color.r; cg = obj->cur.color.g; cb = obj->cur.color.b; ca = obj->cur.color.a; @@ -223,7 +227,7 @@ evas_object_clip_recalc(Evas_Object *obj) cb = (cb * (nb + 1)) >> 8; ca = (ca * (na + 1)) >> 8; } - if ((ca == 0) || (cw <= 0) || (ch <= 0)) cvis = 0; + if ((ca == 0 && obj->cur.render_op == EVAS_RENDER_BLEND) || (cw <= 0) || (ch <= 0)) cvis = 0; obj->cur.cache.clip.x = cx; obj->cur.cache.clip.y = cy; obj->cur.cache.clip.w = cw; -- 2.7.4