From 6e3d6712193ee22495fe5539fd663ba1078f52c0 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 1 Sep 2010 22:45:30 +0000 Subject: [PATCH] and fix up some related map+clip+smart render issues along with fixing map boundary bugs as in trying to fix it i added some bugs. SVN revision: 51826 --- legacy/evas/src/lib/canvas/evas_clip.c | 16 +++---- legacy/evas/src/lib/canvas/evas_map.c | 1 + legacy/evas/src/lib/canvas/evas_render.c | 60 +++++++++++++++++++----- 3 files changed, 56 insertions(+), 21 deletions(-) diff --git a/legacy/evas/src/lib/canvas/evas_clip.c b/legacy/evas/src/lib/canvas/evas_clip.c index 6b0ae2bdf5..b983e6c079 100644 --- a/legacy/evas/src/lib/canvas/evas_clip.c +++ b/legacy/evas/src/lib/canvas/evas_clip.c @@ -111,14 +111,8 @@ void evas_object_mapped_clip_across_mark(Evas_Object *obj) { #ifdef MAP_ACROSS - Eina_Bool map = 0; - - if ((obj->cur.map) && (obj->cur.usemap)) map = 1; - - if (map) - { - evas_object_child_map_across_mark(obj, obj, 0); - } + if ((obj->cur.map) && (obj->cur.usemap)) + evas_object_child_map_across_mark(obj, obj, 0); else { if (obj->smart.parent) @@ -241,7 +235,8 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip) evas_object_change(obj); evas_object_clip_dirty(obj); evas_object_recalc_clippees(obj); - if (!obj->smart.smart) + if ((!obj->smart.smart) && + (!((obj->cur.map) && (obj->cur.usemap)))) { if (evas_object_is_in_output_rect(obj, obj->layer->evas->pointer.x, @@ -343,7 +338,8 @@ evas_object_clip_unset(Evas_Object *obj) evas_object_change(obj); evas_object_clip_dirty(obj); evas_object_recalc_clippees(obj); - if (!obj->smart.smart) + if ((!obj->smart.smart) && + (!((obj->cur.map) && (obj->cur.usemap)))) { if (evas_object_is_in_output_rect(obj, obj->layer->evas->pointer.x, diff --git a/legacy/evas/src/lib/canvas/evas_map.c b/legacy/evas/src/lib/canvas/evas_map.c index df4147753d..53d31b3ebc 100644 --- a/legacy/evas/src/lib/canvas/evas_map.c +++ b/legacy/evas/src/lib/canvas/evas_map.c @@ -429,6 +429,7 @@ evas_object_map_set(Evas_Object *obj, const Evas_Map *map) { _evas_map_free(obj, obj->cur.map); obj->cur.map = NULL; + evas_object_mapped_clip_across_mark(obj); return; } _evas_map_free(obj, obj->cur.map); diff --git a/legacy/evas/src/lib/canvas/evas_render.c b/legacy/evas/src/lib/canvas/evas_render.c index 571ae7ed95..2bc980b9bf 100644 --- a/legacy/evas/src/lib/canvas/evas_render.c +++ b/legacy/evas/src/lib/canvas/evas_render.c @@ -707,6 +707,8 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, // clear surface before re-render if ((changed) && (obj->cur.map->surface)) { + int off_x2, off_y2; + RDI(level); RD(" children redraw\n"); // FIXME: calculate "changes" within map surface and only clear @@ -727,8 +729,8 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, e->engine.func->context_free(e->engine.data.output, ctx); } ctx = e->engine.func->context_new(e->engine.data.output); - off_x = -obj->cur.geometry.x; - off_y = -obj->cur.geometry.y; + off_x2 = -obj->cur.geometry.x; + off_y2 = -obj->cur.geometry.y; if (obj->smart.smart) { EINA_INLIST_FOREACH @@ -736,7 +738,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, { clean_them |= evas_render_mapped(e, obj2, ctx, obj->cur.map->surface, - off_x, off_y, 1 + off_x2, off_y2, 1 #ifdef REND_DGB , level + 1 #endif @@ -750,22 +752,22 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, w = obj->cur.map->surface_w; h = obj->cur.map->surface_h; RECTS_CLIP_TO_RECT(x, y, w, h, - obj->cur.geometry.x + off_x, - obj->cur.geometry.y + off_y, + obj->cur.geometry.x + off_x2, + obj->cur.geometry.y + off_y2, obj->cur.geometry.w, obj->cur.geometry.h); if (!obj->cur.map) { RECTS_CLIP_TO_RECT(x, y, w, h, - obj->cur.cache.clip.x + off_x, - obj->cur.cache.clip.y + off_y, + obj->cur.cache.clip.x + off_x2, + obj->cur.cache.clip.y + off_y2, obj->cur.cache.clip.w, obj->cur.cache.clip.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, - obj->cur.map->surface, off_x, off_y); + obj->cur.map->surface, off_x2, off_y2); } e->engine.func->context_free(e->engine.data.output, ctx); rendered = 1; @@ -780,9 +782,45 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, (e->engine.data.output, obj->cur.map->surface, 0, 0, obj->cur.map->surface_w, obj->cur.map->surface_h); } - obj->layer->evas->engine.func->image_map4_draw - (e->engine.data.output, e->engine.data.context, surface, - obj->cur.map->surface, pts, obj->cur.map->smooth, 0); + if ((obj->cur.map->surface) && (obj->smart.smart)) + { + if (obj->cur.clipper) + { + int x, y, w, h; + Evas_Object *tobj; + + obj->cur.cache.clip.dirty = 1; + tobj = obj->cur.map_parent; + obj->cur.map_parent = obj->cur.clipper->cur.map_parent; + evas_object_clip_recalc(obj); + obj->cur.map_parent = tobj; + x = obj->cur.cache.clip.x; + y = obj->cur.cache.clip.y; + w = obj->cur.cache.clip.w; + h = obj->cur.cache.clip.h; + e->engine.func->context_clip_set(e->engine.data.output, + e->engine.data.context, + x + off_x, y + off_y, w, h); + } + if ((obj->cur.cache.clip.r == 255) && + (obj->cur.cache.clip.g == 255) && + (obj->cur.cache.clip.b == 255) && + (obj->cur.cache.clip.a == 255)) + obj->layer->evas->engine.func->context_multiplier_unset + (e->engine.data.output, e->engine.data.context); + else + obj->layer->evas->engine.func->context_multiplier_set + (e->engine.data.output, e->engine.data.context, + obj->cur.cache.clip.r, obj->cur.cache.clip.g, + obj->cur.cache.clip.b, obj->cur.cache.clip.a); + obj->layer->evas->engine.func->context_render_op_set + (e->engine.data.output, e->engine.data.context, + obj->cur.render_op); + } + if (obj->cur.cache.clip.visible) + obj->layer->evas->engine.func->image_map4_draw + (e->engine.data.output, e->engine.data.context, surface, + obj->cur.map->surface, pts, obj->cur.map->smooth, 0); // FIXME: needs to cache these maps and // keep them only rendering updates // obj->layer->evas->engine.func->image_map_surface_free