From c7e83f986a77f70ce9e40daf7ab4b6157cd9e470 Mon Sep 17 00:00:00 2001 From: raster Date: Wed, 27 Jan 2010 06:49:21 +0000 Subject: [PATCH] move fastpath where it should be git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@45623 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_render.c | 34 ++-------------------- src/modules/engines/software_generic/evas_engine.c | 31 ++++++++++++++++++-- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/src/lib/canvas/evas_render.c b/src/lib/canvas/evas_render.c index 67701b5..df643f5 100644 --- a/src/lib/canvas/evas_render.c +++ b/src/lib/canvas/evas_render.c @@ -727,37 +727,9 @@ evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface, RDI(level); RD(" draw map4\n"); - if ((pts[0].x == pts[3].x) && - (pts[1].x == pts[2].x) && - (pts[0].y == pts[1].y) && - (pts[3].y == pts[2].y) && - (pts[0].u == 0) && - (pts[0].v == 0) && - (pts[1].u == (obj->cur.map->surface_w << FP)) && - (pts[1].v == 0) && - (pts[2].u == (obj->cur.map->surface_w << FP)) && - (pts[2].v == (obj->cur.map->surface_h << FP)) && - (pts[3].u == 0) && - (pts[3].v == (obj->cur.map->surface_h << FP))) - { - int dx, dy, dw, dh; - - dx = pts[0].x >> FP; - dy = pts[0].y >> FP; - dw = (pts[2].x >> FP) - dx; - dh = (pts[2].y >> FP) - dy; - obj->layer->evas->engine.func->image_draw - (e->engine.data.output, e->engine.data.context, - surface, obj->cur.map->surface, - 0, 0, obj->cur.map->surface_w, obj->cur.map->surface_h, - dx, dy, dw, dh, obj->cur.map->smooth); - } - else - { - 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); - } + 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 diff --git a/src/modules/engines/software_generic/evas_engine.c b/src/modules/engines/software_generic/evas_engine.c index b664739..6ab158c 100644 --- a/src/modules/engines/software_generic/evas_engine.c +++ b/src/modules/engines/software_generic/evas_engine.c @@ -779,11 +779,38 @@ eng_image_draw(void *data __UNUSED__, void *context, void *surface, void *image, static void eng_image_map4_draw(void *data __UNUSED__, void *context, void *surface, void *image, RGBA_Map_Point *p, int smooth, int level) { - RGBA_Image *im; + RGBA_Image *im, *srf; + RGBA_Map_Point *pt = p; if (!image) return; im = image; - evas_common_map4_rgba(im, surface, context, p, smooth, level); + srf = surface; + if ((p[0].x == p[3].x) && + (p[1].x == p[2].x) && + (p[0].y == p[1].y) && + (p[3].y == p[2].y) && + (p[0].u == 0) && + (p[0].v == 0) && + (p[1].u == (im->cache_entry.w << FP)) && + (p[1].v == 0) && + (p[2].u == (im->cache_entry.w << FP)) && + (p[2].v == (im->cache_entry.h << FP)) && + (p[3].u == 0) && + (p[3].v == (im->cache_entry.h << FP))) + { + int dx, dy, dw, dh; + + dx = p[0].x >> FP; + dy = p[0].y >> FP; + dw = (p[2].x >> FP) - dx; + dh = (p[2].y >> FP) - dy; + eng_image_draw + (data, context, surface, image, + 0, 0, im->cache_entry.w, im->cache_entry.h, + dx, dy, dw, dh, smooth); + } + else + evas_common_map4_rgba(im, surface, context, p, smooth, level); evas_common_cpu_end_opt(); } -- 2.7.4