summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@profusion.mobi>2012-11-29 20:55:16 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-11-29 20:55:16 +0000
commitcae8fd7ed4f22df4c9cfcb44d14782c1f6223320 (patch)
treebb2e25a87ed9179f61aafadfe24ba9b4a3df5ea5 /src
parentcf1360416ed40f8c562b5647aa2dc7204b86d619 (diff)
evas/map: Refactor common code for map drawing
This patch refactors common code for map draws - so that it can be used by other engines and *threaded* X11. Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi> Patch by: Paulo Alcantara <pcacjr@profusion.mobi> SVN revision: 79855
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/common/evas_map_image.c50
-rw-r--r--src/lib/evas/common/evas_map_image.h8
2 files changed, 36 insertions, 22 deletions
diff --git a/src/lib/evas/common/evas_map_image.c b/src/lib/evas/common/evas_map_image.c
index 1f68f8a1dc..837257d9a0 100644
--- a/src/lib/evas/common/evas_map_image.c
+++ b/src/lib/evas/common/evas_map_image.c
@@ -646,14 +646,12 @@ evas_common_map_rgba_prepare(RGBA_Image *src, RGBA_Image *dst,
646#include "evas_map_image_internal.c" 646#include "evas_map_image_internal.c"
647 647
648EAPI void 648EAPI void
649evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst, 649evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
650 RGBA_Draw_Context *dc, 650 RGBA_Draw_Context *dc,
651 int npoints EINA_UNUSED, RGBA_Map_Point *p, 651 int npoints EINA_UNUSED, RGBA_Map_Point *p,
652 int smooth, int level) 652 int smooth, int level,
653 Evas_Common_Map_RGBA_Cb cb)
653{ 654{
654#ifdef BUILD_MMX
655 int mmx, sse, sse2;
656#endif
657 static Cutout_Rects *rects = NULL; 655 static Cutout_Rects *rects = NULL;
658 Cutout_Rect *r; 656 Cutout_Rect *r;
659 int c, cx, cy, cw, ch; 657 int c, cx, cy, cw, ch;
@@ -670,17 +668,10 @@ evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
670 } 668 }
671 evas_common_image_colorspace_normalize(src); 669 evas_common_image_colorspace_normalize(src);
672 if (!src->image.data) return; 670 if (!src->image.data) return;
673#ifdef BUILD_MMX 671
674 evas_common_cpu_can_do(&mmx, &sse, &sse2);
675#endif
676 if ((!dc->cutout.rects) && (!dc->clip.use)) 672 if ((!dc->cutout.rects) && (!dc->clip.use))
677 { 673 {
678#ifdef BUILD_MMX 674 cb(src, dst, dc, p, smooth, level);
679 if (mmx)
680 evas_common_map_rgba_internal_mmx(src, dst, dc, p, smooth, level);
681 else
682#endif
683 evas_common_map_rgba_internal(src, dst, dc, p, smooth, level);
684 return; 675 return;
685 } 676 }
686 /* save out clip info */ 677 /* save out clip info */
@@ -697,18 +688,33 @@ evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
697 { 688 {
698 r = rects->rects + i; 689 r = rects->rects + i;
699 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h); 690 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
700#ifdef BUILD_MMX 691 cb(src, dst, dc, p, smooth, level);
701 if (mmx)
702 evas_common_map_rgba_internal_mmx(src, dst, dc, p, smooth, level);
703 else
704#endif
705 evas_common_map_rgba_internal(src, dst, dc, p, smooth, level);
706 } 692 }
707 /* restore clip info */ 693 /* restore clip info */
708 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch; 694 dc->clip.use = c; dc->clip.x = cx; dc->clip.y = cy; dc->clip.w = cw; dc->clip.h = ch;
709} 695}
710 696
711EAPI void 697EAPI void
698evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
699 RGBA_Draw_Context *dc,
700 int npoints EINA_UNUSED, RGBA_Map_Point *p,
701 int smooth, int level)
702{
703 Evas_Common_Map_RGBA_Cb cb;
704#ifdef BUILD_MMX
705 int mmx, sse, sse2;
706
707 evas_common_cpu_can_do(&mmx, &sse, &sse2);
708 if (mmx)
709 cb = evas_common_map_rgba_internal_mmx;
710 else
711#endif
712 cb = evas_common_map_rgba_internal;
713
714 evas_common_map_rgba_cb(src, dst, dc, npoints, p, smooth, level, cb);
715}
716
717EAPI void
712evas_common_map_rgba_do(const Eina_Rectangle *clip, 718evas_common_map_rgba_do(const Eina_Rectangle *clip,
713 RGBA_Image *src, RGBA_Image *dst, 719 RGBA_Image *src, RGBA_Image *dst,
714 RGBA_Draw_Context *dc, 720 RGBA_Draw_Context *dc,
diff --git a/src/lib/evas/common/evas_map_image.h b/src/lib/evas/common/evas_map_image.h
index f9c7b971bd..6ea043ddab 100644
--- a/src/lib/evas/common/evas_map_image.h
+++ b/src/lib/evas/common/evas_map_image.h
@@ -1,6 +1,14 @@
1#ifndef _EVAS_MAP_H 1#ifndef _EVAS_MAP_H
2#define _EVAS_MAP_H 2#define _EVAS_MAP_H
3 3
4typedef void (*Evas_Common_Map_RGBA_Cb)(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Map_Point *p, int smooth, int level);
5
6EAPI void
7evas_common_map_rgba_cb(RGBA_Image *src, RGBA_Image *dst,
8 RGBA_Draw_Context *dc,
9 int npoints, RGBA_Map_Point *points,
10 int smooth, int level,
11 Evas_Common_Map_RGBA_Cb cb);
4EAPI void 12EAPI void
5evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst, 13evas_common_map_rgba(RGBA_Image *src, RGBA_Image *dst,
6 RGBA_Draw_Context *dc, 14 RGBA_Draw_Context *dc,