From 4b5b0d479f8b3e5cbbe94fb3d07c5b3c513f5c83 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 15 Mar 2011 16:20:57 +0000 Subject: [PATCH] evas: this will fix some clipping issue with map. This patch should be backported if it work well. Need more tester. It doesn't fix a missing del detection in enki and elementary_test transit 4. SVN revision: 57765 --- legacy/evas/ChangeLog | 3 + legacy/evas/src/lib/canvas/evas_render.c | 92 +++++++++++++++++------- 2 files changed, 68 insertions(+), 27 deletions(-) diff --git a/legacy/evas/ChangeLog b/legacy/evas/ChangeLog index 14223b6293..1bb1990bf4 100644 --- a/legacy/evas/ChangeLog +++ b/legacy/evas/ChangeLog @@ -172,3 +172,6 @@ * Add "load from memory" API: evas_object_image_memfile_set() by popular demand. Can load an image format from a memory address. +2011-03-15 Cedric BAIL + + * Fix issues with clipping and map. diff --git a/legacy/evas/src/lib/canvas/evas_render.c b/legacy/evas/src/lib/canvas/evas_render.c index 618cf8e613..0a8efbf864 100644 --- a/legacy/evas/src/lib/canvas/evas_render.c +++ b/legacy/evas/src/lib/canvas/evas_render.c @@ -2,8 +2,8 @@ #include "evas_private.h" // debug rendering -//#define REND_DGB 1 -//#define STDOUT_DBG 1 +/* #define REND_DGB 1 */ +/* #define STDOUT_DBG 1 */ #ifdef REND_DGB static FILE *dbf = NULL; @@ -880,6 +880,22 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, obj->cur.geometry.y + off_y2, obj->cur.geometry.w, obj->cur.geometry.h); + + if (obj->cur.clipper) + { + if (_evas_render_has_map(obj)) + evas_object_clip_recalc(obj); + 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.w, + obj->cur.cache.clip.h); + RECTS_CLIP_TO_RECT(x, y, w, h, + obj->cur.clipper->cur.cache.clip.x + off_x, + obj->cur.clipper->cur.cache.clip.y + off_y, + obj->cur.clipper->cur.cache.clip.w, + obj->cur.clipper->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, @@ -981,7 +997,33 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, { if (!obj->cur.map) { + int x, y, w, h; + RDI(level); + + x = obj->cur.cache.clip.x + off_x; + y = obj->cur.cache.clip.y + off_y; + w = obj->cur.cache.clip.w; + h = obj->cur.cache.clip.h; + + if (obj->cur.clipper) + { + if (_evas_render_has_map(obj)) + evas_object_clip_recalc(obj); + + RD(" clipper: %i %i %ix%i\n", + obj->cur.clipper->cur.cache.clip.x + off_x, + obj->cur.clipper->cur.cache.clip.y + off_y, + obj->cur.clipper->cur.cache.clip.w, + obj->cur.clipper->cur.cache.clip.h); + + RECTS_CLIP_TO_RECT(x, y, w, h, + obj->cur.clipper->cur.cache.clip.x + off_x, + obj->cur.clipper->cur.cache.clip.y + off_y, + obj->cur.clipper->cur.cache.clip.w, + obj->cur.clipper->cur.cache.clip.h); + } + RD(" clip: %i %i %ix%i [%i %i %ix%i]\n", obj->cur.cache.clip.x + off_x, obj->cur.cache.clip.y + off_y, @@ -992,11 +1034,7 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, obj->cur.geometry.w, obj->cur.geometry.h); e->engine.func->context_clip_set(e->engine.data.output, - ctx, - obj->cur.cache.clip.x + off_x, - obj->cur.cache.clip.y + off_y, - obj->cur.cache.clip.w, - obj->cur.cache.clip.h); + ctx, x, y, w, h); } else { @@ -1019,6 +1057,26 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, } else { + if (obj->cur.clipper) + { + int x, y, w, h; + + if (_evas_render_has_map(obj)) + evas_object_clip_recalc(obj); + x = obj->cur.cache.clip.x; + y = obj->cur.cache.clip.y; + w = obj->cur.cache.clip.w; + h = obj->cur.cache.clip.h; + RECTS_CLIP_TO_RECT(x, y, w, h, + obj->cur.clipper->cur.cache.clip.x, + obj->cur.clipper->cur.cache.clip.y, + obj->cur.clipper->cur.cache.clip.w, + obj->cur.clipper->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); + } + RDI(level); RD(" draw normal obj\n"); obj->func->render(obj, e->engine.data.output, context, surface, @@ -1268,26 +1326,6 @@ evas_render_updates_internal(Evas *e, (eina_array_data_get(&e->temporary_objects, offset) == obj)) offset++; x = cx; y = cy; w = cw; h = ch; - if (obj->cur.clipper) - { - if (_evas_render_has_map(obj)) - { - evas_object_clip_recalc(obj); - } -/* hmmmm clip seems to kill eweather in elm-test - printf("clip: %4i %4i %4ix%4i to %4i %4i %4ix%4i\n", - x, y, w, h, - obj->cur.cache.clip.x + off_x, - obj->cur.cache.clip.y + off_y, - obj->cur.cache.clip.w, - obj->cur.cache.clip.h); - */ - 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.w, - obj->cur.cache.clip.h); - } if (((w > 0) && (h > 0)) || (obj->smart.smart)) { if (!obj->smart.smart)