summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-10-16 02:49:01 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-10-16 02:49:01 +0000
commit7e3479e2f8bcded99b365bc1f43ef2c60e44d9b6 (patch)
treef98d3db90f896651c0a900dfbb117813fc37dd1c /legacy
parentbb90530f7b4240740ae54828bcaa269e909f80de (diff)
remove 8bpp engine too form evas.
SVN revision: 78026
Diffstat (limited to 'legacy')
-rw-r--r--legacy/evas/ChangeLog4
-rw-r--r--legacy/evas/Makefile.am5
-rw-r--r--legacy/evas/NEWS2
-rw-r--r--legacy/evas/README39
-rw-r--r--legacy/evas/configure.ac31
-rw-r--r--legacy/evas/evas-software-8-x11.pc.in3
-rw-r--r--legacy/evas/src/lib/Makefile.am14
-rw-r--r--legacy/evas/src/lib/engines/Makefile.am4
-rw-r--r--legacy/evas/src/lib/engines/common_8/Makefile.am32
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c100
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_font.c285
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c463
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c284
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_line.c426
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_main.c655
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_polygon.c230
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_rectangle.c124
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c447
-rw-r--r--legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c53
-rw-r--r--legacy/evas/src/modules/engines/Makefile.am6
-rw-r--r--legacy/evas/src/modules/engines/software_8/Makefile.am38
-rw-r--r--legacy/evas/src/modules/engines/software_8/evas_engine.c440
-rw-r--r--legacy/evas/src/modules/engines/software_8_x11/Evas_Engine_Software_8_X11.h38
-rw-r--r--legacy/evas/src/modules/engines/software_8_x11/Makefile.am49
-rw-r--r--legacy/evas/src/modules/engines/software_8_x11/evas_engine.c700
-rw-r--r--legacy/evas/src/modules/engines/software_8_x11/evas_engine.h65
-rw-r--r--legacy/evas/src/modules/engines/software_8_x11/evas_x_buffer.c243
27 files changed, 6 insertions, 4774 deletions
diff --git a/legacy/evas/ChangeLog b/legacy/evas/ChangeLog
index 2abc5c441d..021d919f83 100644
--- a/legacy/evas/ChangeLog
+++ b/legacy/evas/ChangeLog
@@ -1099,3 +1099,7 @@
1099 1099
1100 * Fix C code fallback line rendering path in software 1100 * Fix C code fallback line rendering path in software
1101 1101
11022012-10-17 Carsten Haitzler (The Rasterman)
1103
1104 * Like 16bpp engine, 8bpp engine goes the way of the dodo.
1105
diff --git a/legacy/evas/Makefile.am b/legacy/evas/Makefile.am
index ec7c7d94ee..2e2a18acc7 100644
--- a/legacy/evas/Makefile.am
+++ b/legacy/evas/Makefile.am
@@ -36,7 +36,6 @@ evas-opengl-x11.pc.in \
36evas-opengl-sdl.pc.in \ 36evas-opengl-sdl.pc.in \
37evas-software-buffer.pc.in \ 37evas-software-buffer.pc.in \
38evas-software-x11.pc.in \ 38evas-software-x11.pc.in \
39evas-software-8-x11.pc.in \
40evas-software-gdi.pc.in \ 39evas-software-gdi.pc.in \
41evas-software-ddraw.pc.in \ 40evas-software-ddraw.pc.in \
42evas-direct3d.pc.in \ 41evas-direct3d.pc.in \
@@ -64,10 +63,6 @@ if BUILD_ENGINE_SOFTWARE_X11
64pkgconfig_DATA += evas-software-x11.pc 63pkgconfig_DATA += evas-software-x11.pc
65endif 64endif
66 65
67if BUILD_ENGINE_SOFTWARE_8_X11
68pkgconfig_DATA += evas-software-8-x11.pc
69endif
70
71if BUILD_ENGINE_DIRECTFB 66if BUILD_ENGINE_DIRECTFB
72pkgconfig_DATA += evas-directfb.pc 67pkgconfig_DATA += evas-directfb.pc
73endif 68endif
diff --git a/legacy/evas/NEWS b/legacy/evas/NEWS
index f96abf3ef3..c102a3992c 100644
--- a/legacy/evas/NEWS
+++ b/legacy/evas/NEWS
@@ -29,6 +29,8 @@ Fixes:
29 29
30Removal: 30Removal:
31 * No more support s3c6410. 31 * No more support s3c6410.
32 * 16bpp engine removed.
33 * 8bpp engine removed.
32 34
33Evas 1.7.0 35Evas 1.7.0
34 36
diff --git a/legacy/evas/README b/legacy/evas/README
index 49fa34d820..a881811c0f 100644
--- a/legacy/evas/README
+++ b/legacy/evas/README
@@ -353,45 +353,6 @@ software-rendered with evas's default software rendering core.
353opengl (and opengl-es2.0) rendering engine that uses sdl as the front 353opengl (and opengl-es2.0) rendering engine that uses sdl as the front
354end interface. see --enable-gl-x11 etc. for information. 354end interface. see --enable-gl-x11 etc. for information.
355 355
356
357--enable-software-8-x11[=static]
358
3598bit only rendering core. intended for greyscale output on things like
360e-paper or simplistic greyscale LCD devices which have no color, such
361as ebook readers.
362
363if compiling with =static suffix, then must
364"./configure --enable-static-software-8" as well.
365
366
367--enable-software-16-x11[=static]
368
36916bit specific renderer. lower quality than the default. also limited
370in abilities (no support for smooth scale or transformations/map). in
371a state of disrepair. do not use unless your hardware is just 16bpp
372and very limited in CPU and memory.
373
374if compiling with =static suffix, then must
375"./configure --enable-static-software-16" as well.
376
377
378--enable-software-16-ddraw[=static]
379
38016bit renderer for direct-draw. same as software-16-x11 - don't use.
381in disrepair.
382
383if compiling with =static suffix, then must
384"./configure --enable-static-software-16" as well.
385
386
387--enable-software-16-wince[=static]
388
389same as software-16-ddraw but for windows-ce. in disrepair. don't use.
390
391if compiling with =static suffix, then must
392"./configure --enable-static-software-16" as well.
393
394
395------------------------------------------------------------------------------ 356------------------------------------------------------------------------------
396CPU: 357CPU:
397--enable-cpu-c 358--enable-cpu-c
diff --git a/legacy/evas/configure.ac b/legacy/evas/configure.ac
index 0732c48c07..2be005f633 100644
--- a/legacy/evas/configure.ac
+++ b/legacy/evas/configure.ac
@@ -98,7 +98,6 @@ want_evas_engine_software_xlib="no"
98want_evas_engine_software_xcb="no" 98want_evas_engine_software_xcb="no"
99want_evas_engine_software_gdi="no" 99want_evas_engine_software_gdi="no"
100want_evas_engine_software_ddraw="no" 100want_evas_engine_software_ddraw="no"
101want_evas_engine_software_8_x11="no"
102want_evas_engine_gl_xlib="no" 101want_evas_engine_gl_xlib="no"
103want_evas_engine_gl_xcb="no" 102want_evas_engine_gl_xcb="no"
104want_evas_engine_gl_sdl="no" 103want_evas_engine_gl_sdl="no"
@@ -140,8 +139,6 @@ case "$host_os" in
140 want_evas_engine_fb="auto" 139 want_evas_engine_fb="auto"
141 want_evas_engine_wayland_shm="auto" 140 want_evas_engine_wayland_shm="auto"
142 want_evas_engine_wayland_egl="auto" 141 want_evas_engine_wayland_egl="auto"
143### no - not ready/usable/complete
144# want_evas_engine_software_8_x11="auto"
145 ;; 142 ;;
146esac 143esac
147 144
@@ -619,7 +616,6 @@ EVAS_CHECK_ENGINE([gl-sdl], [${want_evas_engine_gl_sdl}], [no], [OpenGL SDL])
619EVAS_CHECK_ENGINE([gl-cocoa], [${want_evas_engine_gl_cocoa}], [no], [OpenGL Cocoa]) 616EVAS_CHECK_ENGINE([gl-cocoa], [${want_evas_engine_gl_cocoa}], [no], [OpenGL Cocoa])
620EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [no], [Framebuffer]) 617EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [no], [Framebuffer])
621EVAS_CHECK_ENGINE([directfb], [${want_evas_engine_directfb}], [no], [DirectFB]) 618EVAS_CHECK_ENGINE([directfb], [${want_evas_engine_directfb}], [no], [DirectFB])
622EVAS_CHECK_ENGINE([software-8-x11], [${want_evas_engine_software_8_x11}], [no], [Software X11 8 bits grayscale])
623EVAS_CHECK_ENGINE([wayland-shm], [${want_evas_engine_wayland_shm}], [no], [Wayland Shm]) 619EVAS_CHECK_ENGINE([wayland-shm], [${want_evas_engine_wayland_shm}], [no], [Wayland Shm])
624EVAS_CHECK_ENGINE([wayland-egl], [${want_evas_engine_wayland_egl}], [no], [Wayland Egl]) 620EVAS_CHECK_ENGINE([wayland-egl], [${want_evas_engine_wayland_egl}], [no], [Wayland Egl])
625 621
@@ -815,28 +811,6 @@ if test "x$gl_flavor_gles" = "xyes"; then
815 [#include <SDL/SDL_video.h>]) 811 [#include <SDL/SDL_video.h>])
816fi 812fi
817 813
818# if software 8 x11 is enabled - build software_8 (the generic 8bit
819# engine).
820have_evas_engine_software_8="no"
821if test "x$have_evas_engine_software_8_x11" = "xyes" -o "x$have_evas_engine_software_8_x11" = "xstatic"; then
822 have_evas_engine_software_8="yes"
823fi
824AM_CONDITIONAL(BUILD_ENGINE_SOFTWARE_8, test "x$have_evas_engine_software_8" = "xyes")
825
826# if software 8 need to be build as part of libevas.so
827have_static_software_8="no"
828AC_ARG_ENABLE([static-software-8],
829 [AC_HELP_STRING([--enable-static-software-8], [Build software 8 engine as part of libevas])],
830 [have_static_software_8=${enableval}]
831)
832AC_MSG_CHECKING([Whether to build software 8 engine as part of libevas])
833AC_MSG_RESULT([${have_static_software_8}])
834
835AM_CONDITIONAL(EVAS_STATIC_BUILD_SOFTWARE_8, test "x${have_static_software_8}" = "xyes")
836if test "x${have_static_software_8}" = "xyes"; then
837 AC_DEFINE(EVAS_STATIC_BUILD_SOFTWARE_8, [1], [Build software 8 engine as part of libevas])
838fi
839
840##################################################################### 814#####################################################################
841## Font Loaders 815## Font Loaders
842 816
@@ -1348,7 +1322,6 @@ evas-opengl-sdl.pc
1348evas-opengl-cocoa.pc 1322evas-opengl-cocoa.pc
1349evas-software-buffer.pc 1323evas-software-buffer.pc
1350evas-software-x11.pc 1324evas-software-x11.pc
1351evas-software-8-x11.pc
1352evas-software-gdi.pc 1325evas-software-gdi.pc
1353evas-software-ddraw.pc 1326evas-software-ddraw.pc
1354evas-direct3d.pc 1327evas-direct3d.pc
@@ -1389,7 +1362,6 @@ src/lib/engines/common/evas_op_copy/Makefile
1389src/lib/engines/common/evas_op_mask/Makefile 1362src/lib/engines/common/evas_op_mask/Makefile
1390src/lib/engines/common/evas_op_mul/Makefile 1363src/lib/engines/common/evas_op_mul/Makefile
1391src/lib/engines/common/evas_op_sub/Makefile 1364src/lib/engines/common/evas_op_sub/Makefile
1392src/lib/engines/common_8/Makefile
1393src/modules/Makefile 1365src/modules/Makefile
1394src/modules/engines/Makefile 1366src/modules/engines/Makefile
1395src/modules/engines/software_generic/Makefile 1367src/modules/engines/software_generic/Makefile
@@ -1405,8 +1377,6 @@ src/modules/engines/gl_x11/Makefile
1405src/modules/engines/gl_sdl/Makefile 1377src/modules/engines/gl_sdl/Makefile
1406src/modules/engines/gl_cocoa/Makefile 1378src/modules/engines/gl_cocoa/Makefile
1407src/modules/engines/psl1ght/Makefile 1379src/modules/engines/psl1ght/Makefile
1408src/modules/engines/software_8/Makefile
1409src/modules/engines/software_8_x11/Makefile
1410src/modules/engines/wayland_shm/Makefile 1380src/modules/engines/wayland_shm/Makefile
1411src/modules/engines/wayland_egl/Makefile 1381src/modules/engines/wayland_egl/Makefile
1412src/modules/loaders/Makefile 1382src/modules/loaders/Makefile
@@ -1473,7 +1443,6 @@ echo " OpenGL Cocoa...............: $have_evas_engine_gl_cocoa"
1473echo " Software Framebuffer.......: $have_evas_engine_fb" 1443echo " Software Framebuffer.......: $have_evas_engine_fb"
1474echo " DirectFB...................: $have_evas_engine_directfb" 1444echo " DirectFB...................: $have_evas_engine_directfb"
1475echo " PSL1GHT....................: $have_evas_engine_psl1ght" 1445echo " PSL1GHT....................: $have_evas_engine_psl1ght"
1476echo " Software 8bit grayscale....: $have_evas_engine_software_8"
1477echo " Wayland Shm................: $have_evas_engine_wayland_shm" 1446echo " Wayland Shm................: $have_evas_engine_wayland_shm"
1478echo " Wayland Egl................: $have_evas_engine_wayland_egl" 1447echo " Wayland Egl................: $have_evas_engine_wayland_egl"
1479echo 1448echo
diff --git a/legacy/evas/evas-software-8-x11.pc.in b/legacy/evas/evas-software-8-x11.pc.in
deleted file mode 100644
index 1a0e46db08..0000000000
--- a/legacy/evas/evas-software-8-x11.pc.in
+++ /dev/null
@@ -1,3 +0,0 @@
1Name: evas-software-8-x11
2Description: Evas software X11 8bpp grayscale engine
3Version: @VERSION@
diff --git a/legacy/evas/src/lib/Makefile.am b/legacy/evas/src/lib/Makefile.am
index 59f1942579..4b3c69a834 100644
--- a/legacy/evas/src/lib/Makefile.am
+++ b/legacy/evas/src/lib/Makefile.am
@@ -48,15 +48,6 @@ SUBDIRS += ../modules/engines/psl1ght/
48EVAS_STATIC_MODULE += ../modules/engines/psl1ght/libevas_engine_psl1ght.la 48EVAS_STATIC_MODULE += ../modules/engines/psl1ght/libevas_engine_psl1ght.la
49EVAS_STATIC_LIBADD += @evas_engine_psl1ght_libs@ 49EVAS_STATIC_LIBADD += @evas_engine_psl1ght_libs@
50endif 50endif
51if EVAS_STATIC_BUILD_SOFTWARE_8
52SUBDIRS += ../modules/engines/software_8/
53EVAS_STATIC_MODULE += ../modules/engines/software_8/libevas_engine_software_8.la
54endif
55if EVAS_STATIC_BUILD_SOFTWARE_8_X11
56SUBDIRS += ../modules/engines/software_8_x11/
57EVAS_STATIC_MODULE += ../modules/engines/software_8_x11/libevas_engine_software_8_x11.la
58EVAS_STATIC_LIBADD += @evas_engine_software_8_x11_libs@
59endif
60if EVAS_STATIC_BUILD_SOFTWARE_DDRAW 51if EVAS_STATIC_BUILD_SOFTWARE_DDRAW
61SUBDIRS += ../modules/engines/software_ddraw/ 52SUBDIRS += ../modules/engines/software_ddraw/
62EVAS_STATIC_MODULE += ../modules/engines/software_ddraw/libevas_engine_software_ddraw.la 53EVAS_STATIC_MODULE += ../modules/engines/software_ddraw/libevas_engine_software_ddraw.la
@@ -214,11 +205,6 @@ libevas_la_DEPENDENCIES += \
214cache2/libevas_cache2.la 205cache2/libevas_cache2.la
215endif 206endif
216 207
217if BUILD_ENGINE_SOFTWARE_8
218libevas_la_LIBADD += engines/common_8/libevas_engine_common_8.la
219libevas_la_DEPENDENCIES += engines/common_8/libevas_engine_common_8.la
220endif
221
222libevas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ 208libevas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
223 209
224### Evas_GL we are still using it in our code, so just don't install it. 210### Evas_GL we are still using it in our code, so just don't install it.
diff --git a/legacy/evas/src/lib/engines/Makefile.am b/legacy/evas/src/lib/engines/Makefile.am
index 7a5dde6804..704aa5acbc 100644
--- a/legacy/evas/src/lib/engines/Makefile.am
+++ b/legacy/evas/src/lib/engines/Makefile.am
@@ -1,7 +1,3 @@
1MAINTAINERCLEANFILES = Makefile.in 1MAINTAINERCLEANFILES = Makefile.in
2 2
3SUBDIRS = common 3SUBDIRS = common
4
5if BUILD_ENGINE_SOFTWARE_8
6SUBDIRS += common_8
7endif
diff --git a/legacy/evas/src/lib/engines/common_8/Makefile.am b/legacy/evas/src/lib/engines/common_8/Makefile.am
deleted file mode 100644
index 95a48ae642..0000000000
--- a/legacy/evas/src/lib/engines/common_8/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8@FREETYPE_CFLAGS@ \
9@PIXMAN_CFLAGS@ \
10@VALGRIND_CFLAGS@ \
11@EVAS_GENERAL_CFLAGS@ \
12@EET_CFLAGS@ \
13@pthread_cflags@
14
15noinst_LTLIBRARIES = libevas_engine_common_8.la
16
17libevas_engine_common_8_la_SOURCES = \
18evas_soft8_dither_mask.c \
19evas_soft8_font.c \
20evas_soft8_image_unscaled.c \
21evas_soft8_main.c \
22evas_soft8_rectangle.c \
23evas_soft8_line.c \
24evas_soft8_polygon.c \
25evas_soft8_image_scaled_sampled.c
26
27
28libevas_engine_common_8_la_DEPENDENCIES = $(top_builddir)/config.h
29
30EXTRA_DIST = \
31evas_soft8_scanline_blend.c \
32evas_soft8_scanline_fill.c
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c
deleted file mode 100644
index c1f3c14c67..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c
+++ /dev/null
@@ -1,100 +0,0 @@
1#include "evas_common_soft8.h"
2
3EFL_ALWAYS_INLINE void
4_soft8_convert_from_rgba_pt(const DATA32 * src, DATA8 * dst, DATA8 * alpha)
5{
6 if (A_VAL(src) == 0)
7 {
8 *dst = 0;
9 *alpha = 0;
10 }
11 else
12 {
13 *dst = GRY_8_FROM_RGB(src);
14 *alpha = A_VAL(src);
15 }
16}
17
18static inline void
19_soft8_convert_from_rgba_scanline(const DATA32 * src, DATA8 * dst,
20 DATA8 * alpha, const int w)
21{
22 int x, m;
23
24 m = (w & ~7);
25 x = 0;
26 pld(src, 0);
27
28 while (x < m)
29 {
30 pld(src, 32);
31 UNROLL8(
32 {
33 _soft8_convert_from_rgba_pt(src, dst, alpha);
34 src++; dst++; alpha++; x++;}
35 );
36 }
37
38 for (; x < w; x++, src++, dst++, alpha++)
39 _soft8_convert_from_rgba_pt(src, dst, alpha);
40}
41
42void
43evas_common_soft8_image_convert_from_rgba(Soft8_Image * im, const DATA32 * src)
44{
45 const DATA32 *sp;
46 DATA8 *dp;
47 DATA8 *ap;
48 unsigned int y;
49
50 sp = src;
51 dp = im->pixels;
52 ap = im->alpha;
53
54 for (y = 0; y < im->cache_entry.h;
55 y++, sp += im->cache_entry.w, dp += im->stride, ap += im->stride)
56 _soft8_convert_from_rgba_scanline(sp, dp, ap, im->cache_entry.w);
57}
58
59EFL_ALWAYS_INLINE void
60_soft8_convert_from_rgb_pt(const DATA32 * src, DATA8 * dst)
61{
62 *dst = GRY_8_FROM_RGB(src);
63}
64
65static inline void
66_soft8_convert_from_rgb_scanline(const DATA32 * src, DATA8 * dst, const int w)
67{
68 int x, m;
69
70 m = (w & ~7);
71 x = 0;
72 pld(src, 0);
73
74 while (x < m)
75 {
76 pld(src, 32);
77 UNROLL8(
78 {
79 _soft8_convert_from_rgb_pt(src, dst); src++; dst++; x++;}
80 );
81 }
82
83 for (; x < w; x++, src++, dst++)
84 _soft8_convert_from_rgb_pt(src, dst);
85}
86
87void
88evas_common_soft8_image_convert_from_rgb(Soft8_Image * im, const DATA32 * src)
89{
90 const DATA32 *sp;
91 DATA8 *dp;
92 unsigned int y;
93
94 sp = src;
95 dp = im->pixels;
96
97 for (y = 0; y < im->cache_entry.h;
98 y++, sp += im->cache_entry.w, dp += im->stride)
99 _soft8_convert_from_rgb_scanline(sp, dp, im->cache_entry.w);
100}
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_font.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_font.c
deleted file mode 100644
index 8f69b86e07..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_font.c
+++ /dev/null
@@ -1,285 +0,0 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_blend.c"
3
4EFL_ALWAYS_INLINE void
5_glyph_pt_mask_solid_solid(DATA8 * dst, const DATA8 gry8, const DATA8 * mask)
6{
7 DATA8 alpha = *mask;
8
9 if (alpha == 0xff)
10 *dst = gry8;
11 else if (alpha > 0)
12 {
13 *dst = GRY_8_BLEND_UNMUL(gry8, *dst, alpha);
14 }
15}
16
17static void
18_glyph_scanline_mask_solid_solid(DATA8 * dst,
19 int size, const DATA8 gry8, const DATA8 * mask)
20{
21 DATA8 *start, *end;
22
23 start = dst;
24 pld(start, 0);
25 pld(mask, 0);
26 end = start + (size & ~3);
27
28 while (start < end)
29 {
30 pld(start, 8);
31 pld(mask, 4);
32 UNROLL4(
33 {
34 _glyph_pt_mask_solid_solid(start, gry8, mask);
35 start++; mask++;}
36 );
37 }
38
39 end = start + (size & 3);
40 for (; start < end; start++, mask++)
41 _glyph_pt_mask_solid_solid(start, gry8, mask);
42}
43
44EFL_ALWAYS_INLINE void
45_glyph_pt_mask_transp_solid(DATA8 * dst,
46 DATA8 gry8, DATA8 alpha, const DATA8 * mask)
47{
48 int rel_alpha;
49
50 rel_alpha = *mask;
51 alpha = (alpha * rel_alpha) >> 8;
52 if (alpha == 0)
53 return;
54
55 alpha++;
56
57 *dst = GRY_8_BLEND((gry8 * rel_alpha) >> 8, *dst, alpha);
58}
59
60static void
61_glyph_scanline_mask_transp_solid(DATA8 * dst,
62 int size,
63 const DATA8 gry8,
64 const DATA8 rel_alpha, const DATA8 * mask)
65{
66 DATA8 *start, *end;
67
68 start = dst;
69 pld(start, 0);
70 pld(mask, 0);
71 end = start + (size & ~3);
72
73 while (start < end)
74 {
75 pld(start, 8);
76 pld(mask, 4);
77 UNROLL4(
78 {
79 _glyph_pt_mask_transp_solid(start, gry8, rel_alpha, mask);
80 start++; mask++;}
81 );
82 }
83
84 end = start + (size & 3);
85 for (; start < end; start++, mask++)
86 _glyph_pt_mask_transp_solid(start, gry8, rel_alpha, mask);
87}
88
89static inline void
90_calc_ext(const Soft8_Image * dst, const RGBA_Draw_Context * dc,
91 Eina_Rectangle * ext)
92{
93 EINA_RECTANGLE_SET(ext, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
94
95 if (dc->clip.use)
96 {
97 int v;
98
99 EINA_RECTANGLE_SET(ext, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
100 if (ext->x < 0)
101 {
102 ext->w += ext->x;
103 ext->x = 0;
104 }
105 if (ext->y < 0)
106 {
107 ext->h += ext->y;
108 ext->y = 0;
109 }
110
111 v = dst->cache_entry.w - ext->x;
112 if (ext->w > v)
113 ext->w = v;
114
115 v = dst->cache_entry.h - ext->y;
116 if (ext->h > v)
117 ext->h = v;
118 }
119}
120
121static inline void
122_glyph_scanline(Soft8_Image * dst, const DATA8 * p_mask,
123 const Eina_Rectangle ext, int dx, int dy, int max_x, int max_y,
124 int w, DATA8 alpha, const DATA8 gry8)
125{
126 int size, in_x, in_w;
127 DATA8 *p_pixels;
128
129 if ((dx >= max_x) || (dy < ext.y) || (dy >= max_y))
130 return;
131
132 in_x = 0;
133 in_w = 0;
134
135 if (dx + w > max_x)
136 in_w += (dx + w) - max_x;
137
138 if (dx < ext.x)
139 {
140 in_w += ext.x - dx;
141 in_x = ext.x - dx;
142 dx = ext.x;
143 }
144
145 size = w - in_w;
146 p_pixels = dst->pixels + (dy * dst->stride) + dx;
147 p_mask += in_x;
148
149 if (size > 1)
150 {
151 if (alpha == 0xff)
152 _glyph_scanline_mask_solid_solid(p_pixels, size, gry8, p_mask);
153 else if (alpha != 0)
154 _glyph_scanline_mask_transp_solid
155 (p_pixels, size, gry8, alpha, p_mask);
156 }
157 else if (size == 1)
158 {
159 if (alpha == 0xff)
160 _glyph_pt_mask_solid_solid(p_pixels, gry8, p_mask);
161 else if (alpha != 0)
162 _glyph_pt_mask_transp_solid(p_pixels, gry8, alpha, p_mask);
163 }
164}
165
166static void
167_soft8_font_glyph_draw_grayscale(Soft8_Image * dst,
168 RGBA_Draw_Context * dc __UNUSED__,
169 RGBA_Font_Glyph * fg __UNUSED__, int x, int y,
170 DATA8 alpha, DATA8 gry8,
171 const Eina_Rectangle ext, int bw, int bh,
172 int bpitch, const DATA8 * bitmap)
173{
174 int i, max_x, max_y;
175
176 max_x = ext.x + ext.w;
177 max_y = ext.y + ext.h;
178
179 for (i = 0; i < bh; i++, bitmap += bpitch)
180 _glyph_scanline(dst, bitmap, ext, x, y + i, max_x, max_y, bw,
181 alpha, gry8);
182}
183
184static inline void
185_glyph_create_mask_line(DATA8 * mask, const DATA8 * bitmap, int w)
186{
187 const DATA8 bitrepl[2] = { 0x0, 0xff };
188 int i;
189
190 for (i = 0; i < w; i += 8, bitmap++)
191 {
192 int j, size;
193 DATA32 bits;
194
195 if (i + 8 < w)
196 size = 8;
197 else
198 size = w - i;
199
200 bits = *bitmap;
201
202 for (j = size - 1; j >= 0; j--, mask++)
203 *mask = bitrepl[(bits >> j) & 0x1];
204 }
205}
206
207static void
208_soft8_font_glyph_draw_mono(Soft8_Image * dst,
209 RGBA_Draw_Context * dc __UNUSED__,
210 RGBA_Font_Glyph * fg __UNUSED__, int x, int y,
211 DATA8 alpha, DATA8 gry8, const Eina_Rectangle ext,
212 int bw, int bh, int bpitch, const DATA8 * bitmap)
213{
214 DATA8 *mask;
215 int i, max_x, max_y;
216
217 max_x = ext.x + ext.w;
218 max_y = ext.y + ext.h;
219
220 mask = alloca(bpitch);
221 for (i = 0; i < bh; i++, bitmap += bpitch)
222 {
223 _glyph_create_mask_line(mask, bitmap, bw);
224 _glyph_scanline(dst, mask, ext, x, y + i, max_x, max_y, bw,
225 alpha, gry8);
226 }
227}
228
229void
230evas_common_soft8_font_glyph_draw(void *data, void *dest __UNUSED__, void *context,
231 RGBA_Font_Glyph * fg, int x, int y)
232{
233 Soft8_Image *dst;
234 RGBA_Draw_Context *dc;
235 const DATA8 *bitmap;
236 DATA8 alpha; // r, g, b
237 DATA8 gry8;
238 Eina_Rectangle ext;
239 int bpitch, bw, bh;
240
241 dst = data;
242 dc = context;
243
244 alpha = A_VAL(&dc->col.col);
245 if (alpha == 0)
246 return;
247
248 gry8 = GRY_8_FROM_RGB(&dc->col.col);
249
250 /*
251 * if (r > alpha) r = alpha;
252 * if (g > alpha) g = alpha;
253 * if (b > alpha) b = alpha;
254 *
255 * gry8 = GRY_8_FROM_COMPONENTS(r, g, b);
256 */
257
258 bitmap = fg->glyph_out->bitmap.buffer;
259 bh = fg->glyph_out->bitmap.rows;
260 bw = fg->glyph_out->bitmap.width;
261 bpitch = fg->glyph_out->bitmap.pitch;
262 if (bpitch < bw)
263 bpitch = bw;
264
265 _calc_ext(dst, dc, &ext);
266
267 if ((fg->glyph_out->bitmap.num_grays == 256) &&
268 (fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays))
269 _soft8_font_glyph_draw_grayscale(dst, dc, fg, x, y, alpha, gry8,
270 ext, bw, bh, bpitch, bitmap);
271 else
272 _soft8_font_glyph_draw_mono(dst, dc, fg, x, y, alpha, gry8,
273 ext, bw, bh, bpitch, bitmap);
274}
275
276void *
277evas_common_soft8_font_glyph_new(void *data __UNUSED__, RGBA_Font_Glyph * fg __UNUSED__)
278{
279 return (void *)1; /* core requires != NULL to work */
280}
281
282void
283evas_common_soft8_font_glyph_free(void *ext_dat __UNUSED__)
284{
285}
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c
deleted file mode 100644
index 73442637cc..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c
+++ /dev/null
@@ -1,463 +0,0 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_blend.c"
3
4static void
5_soft8_image_draw_scaled_solid_solid(Soft8_Image * src,
6 Soft8_Image * dst,
7 RGBA_Draw_Context * dc __UNUSED__,
8 int dst_offset, int w, int h,
9 int *offset_x, int *offset_y)
10{
11 DATA8 *dst_itr;
12 int y, w_align;
13
14 w_align = w & ~7;
15
16 dst_itr = dst->pixels + dst_offset;
17 for (y = 0; y < h; y++, dst_itr += dst->stride)
18 {
19 DATA8 *d, *s;
20 int x;
21
22 s = src->pixels + offset_y[y];
23 pld(s, 0);
24 pld(offset_x, 0);
25
26 d = dst_itr;
27 x = 0;
28 while (x < w_align)
29 {
30 pld(s, 32);
31 pld(offset_x + x, 32);
32
33 UNROLL8(
34 {
35 _soft8_pt_blend_solid_solid(d, s[offset_x[x]]); x++; d++;}
36 );
37 }
38
39 for (; x < w; x++, d++)
40 _soft8_pt_blend_solid_solid(d, s[offset_x[x]]);
41 }
42}
43static void
44_soft8_image_draw_scaled_transp_solid(Soft8_Image * src,
45 Soft8_Image * dst,
46 RGBA_Draw_Context * dc __UNUSED__,
47 int dst_offset, int w, int h,
48 int *offset_x, int *offset_y)
49{
50 DATA8 *dst_itr;
51 int y, w_align;
52
53 w_align = w & ~7;
54
55 dst_itr = dst->pixels + dst_offset;
56 for (y = 0; y < h; y++, dst_itr += dst->stride)
57 {
58 DATA8 *d, *s;
59 DATA8 *a;
60 int x;
61
62 s = src->pixels + offset_y[y];
63 a = src->alpha + offset_y[y];
64 pld(s, 0);
65 pld(a, 0);
66 pld(offset_x, 0);
67
68 d = dst_itr;
69 x = 0;
70 while (x < w_align)
71 {
72 pld(s, 32);
73 pld(a, 8);
74 pld(offset_x + x, 32);
75
76 UNROLL8(
77 {
78 int off_x = offset_x[x];
79 _soft8_pt_blend_transp_solid(d, s[off_x], a[off_x]);
80 x++; d++;});
81 }
82
83 for (; x < w; x++, d++)
84 _soft8_pt_blend_transp_solid(d, s[offset_x[x]], a[offset_x[x]]);
85 }
86}
87
88static inline void
89_soft8_image_draw_scaled_no_mul(Soft8_Image * src, Soft8_Image * dst,
90 RGBA_Draw_Context * dc,
91 int dst_offset, int w, int h,
92 int *offset_x, int *offset_y)
93{
94 if ((src->cache_entry.flags.alpha && src->alpha) &&
95 (!dst->cache_entry.flags.alpha))
96 _soft8_image_draw_scaled_transp_solid
97 (src, dst, dc, dst_offset, w, h, offset_x, offset_y);
98 else if (!dst->cache_entry.flags.alpha)
99 _soft8_image_draw_scaled_solid_solid
100 (src, dst, dc, dst_offset, w, h, offset_x, offset_y);
101 else
102 ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
103 "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
104 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
105}
106
107static void
108_soft8_image_draw_scaled_solid_solid_mul_alpha(Soft8_Image * src,
109 Soft8_Image * dst,
110 RGBA_Draw_Context *
111 dc __UNUSED__, int dst_offset,
112 int w, int h, int *offset_x,
113 int *offset_y, DATA8 alpha)
114{
115 DATA8 *dst_itr;
116 int y, w_align;
117
118 w_align = w & ~7;
119
120 dst_itr = dst->pixels + dst_offset;
121 for (y = 0; y < h; y++, dst_itr += dst->stride)
122 {
123 DATA8 *d, *s;
124 int x;
125
126 s = src->pixels + offset_y[y];
127 pld(s, 0);
128 pld(offset_x, 0);
129
130 d = dst_itr;
131 x = 0;
132 while (x < w_align)
133 {
134 pld(s, 32);
135 pld(offset_x + x, 32);
136
137 UNROLL8(
138 {
139 _soft8_pt_blend_solid_solid_mul_alpha
140 (d, s[offset_x[x]], alpha); x++; d++;}
141 );
142 }
143
144 for (; x < w; x++, d++)
145 _soft8_pt_blend_solid_solid_mul_alpha(d, s[offset_x[x]], alpha);
146 }
147}
148
149static void
150_soft8_image_draw_scaled_transp_solid_mul_alpha(Soft8_Image * src,
151 Soft8_Image * dst,
152 RGBA_Draw_Context *
153 dc __UNUSED__, int dst_offset,
154 int w, int h, int *offset_x,
155 int *offset_y, DATA8 alpha)
156{
157 DATA8 *dst_itr;
158 int y, w_align;
159
160 w_align = w & ~7;
161
162 dst_itr = dst->pixels + dst_offset;
163 for (y = 0; y < h; y++, dst_itr += dst->stride)
164 {
165 DATA8 *d, *s;
166 DATA8 *a;
167 int x;
168
169 s = src->pixels + offset_y[y];
170 a = src->alpha + offset_y[y];
171 pld(s, 0);
172 pld(a, 0);
173 pld(offset_x, 0);
174
175 d = dst_itr;
176 x = 0;
177 while (x < w_align)
178 {
179 pld(s, 32);
180 pld(a, 8);
181 pld(offset_x + x, 32);
182
183 UNROLL8(
184 {
185 int off_x = offset_x[x];
186 _soft8_pt_blend_transp_solid_mul_alpha
187 (d, s[off_x], a[off_x], alpha); x++; d++;});
188 }
189
190 for (; x < w; x++, d++)
191 _soft8_pt_blend_transp_solid_mul_alpha
192 (d, s[offset_x[x]], a[offset_x[x]], alpha);
193 }
194}
195
196static inline void
197_soft8_image_draw_scaled_mul_alpha(Soft8_Image * src, Soft8_Image * dst,
198 RGBA_Draw_Context * dc,
199 int dst_offset, int w, int h,
200 int *offset_x, int *offset_y, DATA8 a)
201{
202 if ((src->cache_entry.flags.alpha && src->alpha) &&
203 (!dst->cache_entry.flags.alpha))
204 _soft8_image_draw_scaled_transp_solid_mul_alpha
205 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
206 else if (!dst->cache_entry.flags.alpha)
207 _soft8_image_draw_scaled_solid_solid_mul_alpha
208 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
209 else
210 ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
211 "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
212 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha,
213 A_VAL(&dc->mul.col));
214}
215
216static void
217_soft8_image_draw_scaled_solid_solid_mul_color(Soft8_Image * src,
218 Soft8_Image * dst,
219 RGBA_Draw_Context *
220 dc __UNUSED__, int dst_offset,
221 int w, int h, int *offset_x,
222 int *offset_y, DATA8 r, DATA8 g,
223 DATA8 b, DATA8 alpha)
224{
225 DATA8 *dst_itr;
226 int y, w_align;
227
228 w_align = w & ~7;
229
230 dst_itr = dst->pixels + dst_offset;
231
232 if (alpha == 0xff)
233 for (y = 0; y < h; y++, dst_itr += dst->stride)
234 {
235 DATA8 *d, *s;
236 int x;
237
238 s = src->pixels + offset_y[y];
239 pld(s, 0);
240 pld(offset_x, 0);
241
242 d = dst_itr;
243 x = 0;
244 while (x < w_align)
245 {
246 pld(s, 32);
247 pld(offset_x + x, 32);
248
249 UNROLL8(
250 {
251 _soft8_pt_blend_solid_solid_mul_color_solid
252 (d, s[offset_x[x]], r, g, b); x++; d++;}
253 );
254 }
255
256 for (; x < w; x++, d++)
257 _soft8_pt_blend_solid_solid_mul_color_solid
258 (d, s[offset_x[x]], r, g, b);
259 }
260 else
261 for (y = 0; y < h; y++, dst_itr += dst->stride)
262 {
263 DATA8 *d, *s;
264 int x;
265
266 s = src->pixels + offset_y[y];
267 pld(s, 0);
268 pld(offset_x, 0);
269
270 d = dst_itr;
271 x = 0;
272 while (x < w_align)
273 {
274 pld(s, 32);
275 pld(offset_x + x, 32);
276
277 UNROLL8(
278 {
279 _soft8_pt_blend_solid_solid_mul_color_transp
280 (d, s[offset_x[x]], alpha, r, g, b); x++; d++;}
281 );
282 }
283
284 for (; x < w; x++, d++)
285 _soft8_pt_blend_solid_solid_mul_color_transp
286 (d, s[offset_x[x]], alpha, r, g, b);
287 }
288}
289
290static void
291_soft8_image_draw_scaled_transp_solid_mul_color(Soft8_Image * src,
292 Soft8_Image * dst,
293 RGBA_Draw_Context *
294 dc __UNUSED__, int dst_offset,
295 int w, int h, int *offset_x,
296 int *offset_y, DATA8 r, DATA8 g,
297 DATA8 b, DATA8 alpha)
298{
299 DATA8 *dst_itr;
300 int y, w_align;
301
302 w_align = w & ~7;
303
304 dst_itr = dst->pixels + dst_offset;
305
306 if (alpha == 0xff)
307 for (y = 0; y < h; y++, dst_itr += dst->stride)
308 {
309 DATA8 *d, *s;
310 DATA8 *a;
311 int x;
312
313 s = src->pixels + offset_y[y];
314 a = src->alpha + offset_y[y];
315 pld(s, 0);
316 pld(a, 0);
317 pld(offset_x, 0);
318
319 d = dst_itr;
320 x = 0;
321 while (x < w_align)
322 {
323 pld(s, 32);
324 pld(a, 8);
325 pld(offset_x + x, 32);
326
327 UNROLL8(
328 {
329 int off_x = offset_x[x];
330 _soft8_pt_blend_transp_solid_mul_color_solid
331 (d, s[off_x], a[off_x], r, g, b); x++; d++;});
332 }
333
334 for (; x < w; x++, d++)
335 _soft8_pt_blend_transp_solid_mul_color_solid
336 (d, s[offset_x[x]], a[offset_x[x]], r, g, b);
337 }
338 else
339 for (y = 0; y < h; y++, dst_itr += dst->stride)
340 {
341 DATA8 *d, *s;
342 DATA8 *a;
343 int x;
344
345 s = src->pixels + offset_y[y];
346 a = src->alpha + offset_y[y];
347 pld(s, 0);
348 pld(a, 0);
349 pld(offset_x, 0);
350
351 d = dst_itr;
352 x = 0;
353 while (x < w_align)
354 {
355 pld(s, 32);
356 pld(a, 8);
357 pld(offset_x + x, 32);
358
359 UNROLL8(
360 {
361 int off_x = offset_x[x];
362 _soft8_pt_blend_transp_solid_mul_color_transp
363 (d, s[off_x], a[off_x], alpha, r, g, b); x++; d++;});
364 }
365
366 for (; x < w; x++, d++)
367 _soft8_pt_blend_transp_solid_mul_color_transp
368 (d, s[offset_x[x]], a[offset_x[x]], alpha, r, g, b);
369 }
370}
371
372static inline void
373_soft8_image_draw_scaled_mul_color(Soft8_Image * src, Soft8_Image * dst,
374 RGBA_Draw_Context * dc,
375 int dst_offset, int w, int h,
376 int *offset_x, int *offset_y,
377 DATA8 r, DATA8 g, DATA8 b, DATA8 a)
378{
379 if ((src->cache_entry.flags.alpha && src->alpha) &&
380 (!dst->cache_entry.flags.alpha))
381 _soft8_image_draw_scaled_transp_solid_mul_color
382 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
383 else if (!dst->cache_entry.flags.alpha)
384 _soft8_image_draw_scaled_solid_solid_mul_color
385 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
386 else
387 ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
388 "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
389 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha,
390 dc->mul.col);
391}
392
393static inline void
394_soft8_image_draw_scaled_mul(Soft8_Image * src, Soft8_Image * dst,
395 RGBA_Draw_Context * dc,
396 int dst_offset, int w, int h,
397 int *offset_x, int *offset_y, DATA8 r, DATA8 g,
398 DATA8 b, DATA8 a)
399{
400 if ((a == r) && (a == g) && (a == b))
401 _soft8_image_draw_scaled_mul_alpha
402 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
403 else
404 _soft8_image_draw_scaled_mul_color
405 (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
406}
407
408void
409evas_common_soft8_image_draw_scaled_sampled(Soft8_Image * src, Soft8_Image * dst,
410 RGBA_Draw_Context * dc,
411 const Eina_Rectangle sr,
412 const Eina_Rectangle dr,
413 const Eina_Rectangle cr)
414{
415 int x, y, dst_offset, *offset_x, *offset_y;
416 DATA8 mul_gry8;
417 DATA8 r, g, b, a;
418
419 if (!dc->mul.use)
420 {
421 r = g = b = a = 0xff;
422 mul_gry8 = 0xff;
423 }
424 else
425 {
426 a = A_VAL(&dc->mul.col);
427 if (a == 0)
428 return;
429
430 r = R_VAL(&dc->mul.col);
431 g = G_VAL(&dc->mul.col);
432 b = B_VAL(&dc->mul.col);
433
434 if (r > a)
435 r = a;
436 if (g > a)
437 g = a;
438 if (b > a)
439 b = a;
440
441 mul_gry8 = GRY_8_FROM_COMPONENTS(r, g, b);
442 }
443
444 /* pre-calculated scale tables */
445 offset_x = alloca(cr.w * sizeof(*offset_x));
446 for (x = 0; x < cr.w; x++)
447 offset_x[x] = (((x + cr.x - dr.x) * sr.w) / dr.w) + sr.x;
448
449 offset_y = alloca(cr.h * sizeof(*offset_y));
450 for (y = 0; y < cr.h; y++)
451 offset_y[y] = (((((y + cr.y - dr.y) * sr.h) / dr.h) + sr.y)
452 * src->stride);
453
454 dst_offset = cr.x + (cr.y * dst->stride);
455
456 if (mul_gry8 == 0xff)
457 _soft8_image_draw_scaled_no_mul
458 (src, dst, dc, dst_offset, cr.w, cr.h, offset_x, offset_y);
459 else
460 _soft8_image_draw_scaled_mul
461 (src, dst, dc, dst_offset, cr.w, cr.h, offset_x, offset_y, r, g, b,
462 a);
463}
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c
deleted file mode 100644
index 6f4e76b568..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c
+++ /dev/null
@@ -1,284 +0,0 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_blend.c"
3
4static void
5_soft8_image_draw_unscaled_solid_solid(Soft8_Image * src, Soft8_Image * dst,
6 RGBA_Draw_Context * dc __UNUSED__,
7 int src_offset, int dst_offset,
8 int w, int h)
9{
10 DATA8 *src_itr, *dst_itr;
11 int y;
12
13 src_itr = src->pixels + src_offset;
14 dst_itr = dst->pixels + dst_offset;
15
16 for (y = 0; y < h; y++)
17 {
18 _soft8_scanline_blend_solid_solid(src_itr, dst_itr, w);
19 src_itr += src->stride;
20 dst_itr += dst->stride;
21 }
22}
23
24static void
25_soft8_image_draw_unscaled_transp_solid(Soft8_Image * src, Soft8_Image * dst,
26 RGBA_Draw_Context * dc __UNUSED__,
27 int src_offset, int dst_offset,
28 int w, int h)
29{
30 DATA8 *src_itr, *dst_itr;
31 DATA8 *alpha_itr;
32 int y;
33
34 src_itr = src->pixels + src_offset;
35 alpha_itr = src->alpha + src_offset;
36 dst_itr = dst->pixels + dst_offset;
37
38 for (y = 0; y < h; y++)
39 {
40 _soft8_scanline_blend_transp_solid(src_itr, alpha_itr, dst_itr, w);
41 src_itr += src->stride;
42 alpha_itr += src->stride;
43 dst_itr += dst->stride;
44 }
45}
46
47static inline void
48_soft8_image_draw_unscaled_no_mul(Soft8_Image * src, Soft8_Image * dst,
49 RGBA_Draw_Context * dc,
50 int src_offset, int dst_offset,
51 int width, int height)
52{
53 if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
54 _soft8_image_draw_unscaled_transp_solid(src, dst, dc,
55 src_offset, dst_offset,
56 width, height);
57 else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
58 _soft8_image_draw_unscaled_solid_solid(src, dst, dc,
59 src_offset, dst_offset,
60 width, height);
61 else
62 ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
63 "dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
64 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
65}
66
67static void
68_soft8_image_draw_unscaled_solid_solid_mul_alpha(Soft8_Image * src,
69 Soft8_Image * dst,
70 RGBA_Draw_Context *
71 dc __UNUSED__, int src_offset,
72 int dst_offset, int w, int h,
73 DATA8 a)
74{
75 DATA8 *src_itr, *dst_itr;
76 int y;
77
78 src_itr = src->pixels + src_offset;
79 dst_itr = dst->pixels + dst_offset;
80
81 for (y = 0; y < h; y++)
82 {
83 _soft8_scanline_blend_solid_solid_mul_alpha(src_itr, dst_itr, w, a);
84 src_itr += src->stride;
85 dst_itr += dst->stride;
86 }
87}
88
89static void
90_soft8_image_draw_unscaled_transp_solid_mul_alpha(Soft8_Image * src,
91 Soft8_Image * dst,
92 RGBA_Draw_Context *
93 dc __UNUSED__, int src_offset,
94 int dst_offset, int w, int h,
95 DATA8 a)
96{
97 DATA8 *src_itr, *dst_itr;
98 DATA8 *alpha_itr;
99 int y;
100
101 src_itr = src->pixels + src_offset;
102 alpha_itr = src->alpha + src_offset;
103 dst_itr = dst->pixels + dst_offset;
104
105 for (y = 0; y < h; y++)
106 {
107 _soft8_scanline_blend_transp_solid_mul_alpha(src_itr, alpha_itr,
108 dst_itr, w, a);
109 src_itr += src->stride;
110 alpha_itr += src->stride;
111 dst_itr += dst->stride;
112 }
113}
114
115static inline void
116_soft8_image_draw_unscaled_mul_alpha(Soft8_Image * src, Soft8_Image * dst,
117 RGBA_Draw_Context * dc,
118 int src_offset, int dst_offset,
119 int width, int height, DATA8 a)
120{
121 if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
122 _soft8_image_draw_unscaled_transp_solid_mul_alpha
123 (src, dst, dc, src_offset, dst_offset, width, height, a);
124 else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
125 _soft8_image_draw_unscaled_solid_solid_mul_alpha
126 (src, dst, dc, src_offset, dst_offset, width, height, a);
127 else
128 ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
129 "dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
130 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
131}
132
133static void
134_soft8_image_draw_unscaled_solid_solid_mul_color(Soft8_Image * src,
135 Soft8_Image * dst,
136 RGBA_Draw_Context *
137 dc __UNUSED__, int src_offset,
138 int dst_offset, int w, int h,
139 DATA8 r, DATA8 g, DATA8 b,
140 DATA8 a)
141{
142 DATA8 *src_itr, *dst_itr;
143 int y;
144
145 src_itr = src->pixels + src_offset;
146 dst_itr = dst->pixels + dst_offset;
147
148 if (a == 0xff)
149 for (y = 0; y < h; y++)
150 {
151 _soft8_scanline_blend_solid_solid_mul_color_solid
152 (src_itr, dst_itr, w, r, g, b);
153 src_itr += src->stride;
154 dst_itr += dst->stride;
155 }
156 else
157 for (y = 0; y < h; y++)
158 {
159 _soft8_scanline_blend_solid_solid_mul_color_transp
160 (src_itr, dst_itr, w, a, r, g, b);
161 src_itr += src->stride;
162 dst_itr += dst->stride;
163 }
164}
165
166static void
167_soft8_image_draw_unscaled_transp_solid_mul_color(Soft8_Image * src,
168 Soft8_Image * dst,
169 RGBA_Draw_Context *
170 dc __UNUSED__, int src_offset,
171 int dst_offset, int w, int h,
172 DATA8 r, DATA8 g, DATA8 b,
173 DATA8 a)
174{
175 DATA8 *src_itr, *dst_itr;
176 DATA8 *alpha_itr;
177 int y;
178
179 src_itr = src->pixels + src_offset;
180 alpha_itr = src->alpha + src_offset;
181 dst_itr = dst->pixels + dst_offset;
182
183 if (a == 0xff)
184 for (y = 0; y < h; y++)
185 {
186 _soft8_scanline_blend_transp_solid_mul_color_solid
187 (src_itr, alpha_itr, dst_itr, w, r, g, b);
188 src_itr += src->stride;
189 alpha_itr += src->stride;
190 dst_itr += dst->stride;
191 }
192 else
193 for (y = 0; y < h; y++)
194 {
195 _soft8_scanline_blend_transp_solid_mul_color_transp
196 (src_itr, alpha_itr, dst_itr, w, a, r, g, b);
197 src_itr += src->stride;
198 alpha_itr += src->stride;
199 dst_itr += dst->stride;
200 }
201}
202
203static inline void
204_soft8_image_draw_unscaled_mul_color(Soft8_Image * src, Soft8_Image * dst,
205 RGBA_Draw_Context * dc,
206 int src_offset, int dst_offset,
207 int width, int height,
208 DATA8 r, DATA8 g, DATA8 b, DATA8 a)
209{
210 if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
211 _soft8_image_draw_unscaled_transp_solid_mul_color
212 (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
213 else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
214 _soft8_image_draw_unscaled_solid_solid_mul_color
215 (src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
216 else
217 ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
218 "dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
219 src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, dc->mul.col);
220}
221
222static inline void
223_soft8_image_draw_unscaled_mul(Soft8_Image * src, Soft8_Image * dst,
224 RGBA_Draw_Context * dc,
225 int src_offset, int dst_offset,
226 int width, int height, DATA8 r, DATA8 g,
227 DATA8 b, DATA8 a)
228{
229 if ((a == r) && (a == g) && (a == b))
230 _soft8_image_draw_unscaled_mul_alpha(src, dst, dc, src_offset,
231 dst_offset, width, height, a);
232 else
233 _soft8_image_draw_unscaled_mul_color(src, dst, dc, src_offset,
234 dst_offset, width, height,
235 r, g, b, a);
236}
237
238void
239evas_common_soft8_image_draw_unscaled(Soft8_Image * src, Soft8_Image * dst,
240 RGBA_Draw_Context * dc,
241 const Eina_Rectangle sr,
242 const Eina_Rectangle dr, const Eina_Rectangle cr)
243{
244 int src_offset_rows, src_offset, dst_offset;
245 DATA8 mul_gry8;
246 DATA8 r, g, b, a;
247
248 if (!dc->mul.use)
249 {
250 r = g = b = a = 0xff;
251 mul_gry8 = 0xff;
252 }
253 else
254 {
255 a = A_VAL(&dc->mul.col);
256 if (a == 0)
257 return;
258
259 r = R_VAL(&dc->mul.col);
260 g = G_VAL(&dc->mul.col);
261 b = B_VAL(&dc->mul.col);
262
263 if (r > a)
264 r = a;
265 if (g > a)
266 g = a;
267 if (b > a)
268 b = a;
269
270 mul_gry8 = GRY_8_FROM_COMPONENTS(r, g, b);
271 }
272
273 src_offset_rows = (cr.y - dr.y) + sr.y;
274 src_offset = (src_offset_rows * src->stride) + (cr.x - dr.x) + sr.x;
275
276 dst_offset = cr.x + (cr.y * dst->stride);
277
278 if (mul_gry8 == 0xff)
279 _soft8_image_draw_unscaled_no_mul(src, dst, dc, src_offset, dst_offset,
280 cr.w, cr.h);
281 else
282 _soft8_image_draw_unscaled_mul(src, dst, dc, src_offset, dst_offset,
283 cr.w, cr.h, r, g, b, a);
284}
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_line.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_line.c
deleted file mode 100644
index 6ec2d220a5..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_line.c
+++ /dev/null
@@ -1,426 +0,0 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_fill.c"
3
4/*
5 * All functions except by evas_common_soft8_line_draw() expect x0 <= x1.
6 */
7
8static inline int
9_in_range(int value, int min, int max)
10{
11 return min <= value && value <= max;
12}
13
14static inline int
15_is_xy_inside_clip(int x, int y, const struct RGBA_Draw_Context_clip clip)
16{
17 if (!clip.use)
18 return 1;
19
20 if (!_in_range(x, clip.x, clip.x + clip.w - 1))
21 return 0;
22
23 if (!_in_range(y, clip.y, clip.y + clip.h - 1))
24 return 0;
25
26 return 1;
27}
28
29static inline int
30_is_x_inside_clip(int x, const struct RGBA_Draw_Context_clip clip)
31{
32 if (!clip.use)
33 return 1;
34
35 return _in_range(x, clip.x, clip.x + clip.w - 1);
36}
37
38static inline int
39_is_y_inside_clip(int y, const struct RGBA_Draw_Context_clip clip)
40{
41 if (!clip.use)
42 return 1;
43
44 return _in_range(y, clip.y, clip.y + clip.h - 1);
45}
46
47static inline int
48_is_xy_inside_rect(int x, int y, int w, int h)
49{
50 return _in_range(x, 0, w - 1) && _in_range(y, 0, h - 1);
51}
52
53static inline int
54_is_empty_clip(const struct RGBA_Draw_Context_clip clip)
55{
56 return clip.w < 1 || clip.h < 1;
57}
58
59static void
60_soft8_line_point(Soft8_Image * dst, RGBA_Draw_Context * dc, int x, int y)
61{
62 DATA8 gry8, *dst_itr;
63 DATA8 alpha;
64
65 if (!_is_xy_inside_rect(x, y, dst->cache_entry.w, dst->cache_entry.h))
66 return;
67
68 if (!_is_xy_inside_clip(x, y, dc->clip))
69 return;
70
71 dst_itr = dst->pixels + (dst->stride * y) + x;
72 alpha = A_VAL(&dc->col.col);
73 gry8 = GRY_8_FROM_RGB(&dc->col.col);
74
75 if (alpha == 0xff)
76 _soft8_pt_fill_solid_solid(dst_itr, gry8);
77 else if (alpha > 0)
78 {
79 alpha++;
80 _soft8_pt_fill_transp_solid(dst_itr, gry8, alpha);
81 }
82}
83
84static void
85_soft8_line_horiz(Soft8_Image * dst, RGBA_Draw_Context * dc, int x0, int x1,
86 int y)
87{
88 DATA8 gry8, *dst_itr;
89 DATA8 alpha;
90 int w;
91
92 if (!_is_y_inside_clip(y, dc->clip))
93 return;
94
95 if (x0 < dc->clip.x)
96 x0 = dc->clip.x;
97
98 if (x1 >= dc->clip.x + dc->clip.w)
99 x1 = dc->clip.x + dc->clip.w - 1;
100
101 w = x1 - x0;
102 if (w < 1)
103 return;
104
105 dst_itr = dst->pixels + (dst->stride * y) + x0;
106 alpha = A_VAL(&dc->col.col);
107 gry8 = GRY_8_FROM_RGB(&dc->col.col);
108
109 if (alpha == 0xff)
110 _soft8_scanline_fill_solid_solid(dst_itr, w, gry8);
111 else if (alpha > 0)
112 {
113 alpha++;
114 _soft8_scanline_fill_transp_solid(dst_itr, w, gry8, alpha);
115 }
116}
117
118static void
119_soft8_line_vert(Soft8_Image * dst, RGBA_Draw_Context * dc, int x, int y0,
120 int y1)
121{
122 DATA8 gry8, *dst_itr;
123 DATA8 alpha;
124 int h;
125
126 if (!_is_x_inside_clip(x, dc->clip))
127 return;
128
129 if (y1 < y0)
130 {
131 int t;
132 t = y0;
133 y0 = y1;
134 y1 = t;
135 }
136
137 if (y0 < dc->clip.y)
138 y0 = dc->clip.y;
139
140 if (y1 >= dc->clip.y + dc->clip.h)
141 y1 = dc->clip.y + dc->clip.h - 1;
142
143 h = y1 - y0;
144 if (h < 1)
145 return;
146
147 dst_itr = dst->pixels + (dst->stride * y0) + x;
148 alpha = A_VAL(&dc->col.col);
149 gry8 = GRY_8_FROM_RGB(&dc->col.col);
150
151 if (alpha == 0xff)
152 {
153 for (; h > 0; h--, dst_itr += dst->stride)
154 _soft8_pt_fill_solid_solid(dst_itr, gry8);
155 }
156 else if (alpha > 0)
157 {
158 alpha++;
159
160 for (; h > 0; h--, dst_itr += dst->stride)
161 _soft8_pt_fill_transp_solid(dst_itr, gry8, alpha);
162 }
163}
164
165static inline void
166_soft8_line_45deg_adjust_boundaries(const struct RGBA_Draw_Context_clip clip,
167 int *p_x0, int *p_y0, int *p_x1, int *p_y1)
168{
169 int diff, dy, x0, y0, x1, y1;
170
171 x0 = *p_x0;
172 y0 = *p_y0;
173 x1 = *p_x1;
174 y1 = *p_y1;
175
176 dy = y1 - y0;
177
178 diff = clip.x - x0;
179 if (diff > 0)
180 {
181 x0 = clip.x;
182 y0 += (dy > 0) ? diff : -diff;
183 }
184
185 diff = x1 - (clip.x + clip.w);
186 if (diff > 0)
187 {
188 x1 = clip.x + clip.w;
189 y1 += (dy > 0) ? -diff : diff;
190 }
191
192 if (dy > 0)
193 {
194 diff = clip.y - y0;
195 if (diff > 0)
196 {
197 y0 = clip.y;
198 x0 += diff;
199 }
200
201 diff = y1 - (clip.y + clip.h);
202 if (diff > 0)
203 {
204 y1 = clip.y + clip.h;
205 x1 -= diff;
206 }
207 }
208 else
209 {
210 diff = clip.y - y1;
211 if (diff > 0)
212 {
213 y1 = clip.y;
214 x1 -= diff;
215 }
216
217 diff = y0 - (clip.y + clip.h - 1);
218 if (diff > 0)
219 {
220 y0 = clip.y + clip.h - 1;
221 x0 += diff;
222 }
223 }
224
225 *p_x0 = x0;
226 *p_y0 = y0;
227 *p_x1 = x1;
228 *p_y1 = y1;
229}
230
231static void
232_soft8_line_45deg(Soft8_Image * dst, RGBA_Draw_Context * dc, int x0, int y0,
233 int x1, int y1)
234{
235 int dy, step_dst_itr, len;
236 DATA8 alpha;
237 DATA8 *dst_itr, gry8;
238
239 alpha = A_VAL(&dc->col.col);
240 if (alpha < 1)
241 return;
242
243 gry8 = GRY_8_FROM_RGB(&dc->col.col);
244
245 dy = y1 - y0;
246 step_dst_itr = 1 + ((dy > 0) ? dst->stride : -dst->stride);
247
248 _soft8_line_45deg_adjust_boundaries(dc->clip, &x0, &y0, &x1, &y1);
249
250 len = (dy > 0) ? (y1 - y0) : (y0 - y1);
251 if (len < 1)
252 return;
253
254 dst_itr = dst->pixels + dst->stride * y0 + x0;
255 if (alpha == 0xff)
256 {
257 for (; len > 0; len--, dst_itr += step_dst_itr)
258 _soft8_pt_fill_solid_solid(dst_itr, gry8);
259 }
260 else
261 {
262 alpha++;
263 for (; len > 0; len--, dst_itr += step_dst_itr)
264 _soft8_pt_fill_transp_solid(dst_itr, gry8, alpha);
265 }
266}
267
268EFL_ALWAYS_INLINE void
269_soft8_line_aliased_pt(DATA8 * dst_itr, DATA8 gry8, DATA8 alpha)
270{
271 if (alpha == 32)
272 _soft8_pt_fill_solid_solid(dst_itr, gry8);
273 else
274 _soft8_pt_fill_transp_solid(dst_itr, gry8, alpha);
275}
276
277static void
278_soft8_line_aliased(Soft8_Image * dst, RGBA_Draw_Context * dc, int x0, int y0,
279 int x1, int y1)
280{
281 int dx, dy, step_y, step_dst_itr;
282 DATA8 gry8;
283 DATA8 alpha;
284
285 alpha = A_VAL(&dc->col.col);
286 if (alpha == 0)
287 return;
288 alpha++;
289
290 gry8 = GRY_8_FROM_RGB(&dc->col.col);
291
292 dx = x1 - x0;
293 dy = y1 - y0;
294
295 if (dy >= 0)
296 {
297 step_y = 1;
298 step_dst_itr = dst->stride;
299 }
300 else
301 {
302 dy = -dy;
303 step_y = -1;
304 step_dst_itr = -dst->stride;
305 }
306
307 if (dx > dy)
308 {
309 DATA8 *dst_itr;
310 int e, x, y;
311
312 e = -(dx / 2);
313 y = y0;
314 dst_itr = dst->pixels + dst->stride * y0 + x0;
315 for (x = x0; x <= x1; x++, dst_itr++)
316 {
317 if (_is_xy_inside_clip(x, y, dc->clip))
318 _soft8_line_aliased_pt(dst_itr, gry8, alpha);
319
320 e += dy;
321 if (e >= 0)
322 {
323 dst_itr += step_dst_itr;
324 y += step_y;
325 e -= dx;
326 }
327 }
328 }
329 else
330 {
331 DATA8 *dst_itr;
332 int e, x, y;
333
334 e = -(dy / 2);
335 x = x0;
336 dst_itr = dst->pixels + dst->stride * y0 + x0;
337 for (y = y0; y != y1; y += step_y, dst_itr += step_dst_itr)
338 {
339 if (_is_xy_inside_clip(x, y, dc->clip))
340 _soft8_line_aliased_pt(dst_itr, gry8, alpha);
341
342 e += dx;
343 if (e >= 0)
344 {
345 dst_itr++;
346 x++;
347 e -= dy;
348 }
349 }
350 }
351}
352
353void
354evas_common_soft8_line_draw(Soft8_Image * dst, RGBA_Draw_Context * dc, int x0, int y0,
355 int x1, int y1)
356{
357 struct RGBA_Draw_Context_clip c_bkp, c_tmp;
358 int dx, dy;
359 int x, y, w, h;
360
361 c_tmp.use = 1;
362 c_tmp.x = 0;
363 c_tmp.y = 0;
364 c_tmp.w = dst->cache_entry.w;
365 c_tmp.h = dst->cache_entry.h;
366
367 /* save out clip info */
368 c_bkp = dc->clip;
369 if (c_bkp.use)
370 {
371 RECTS_CLIP_TO_RECT(c_tmp.x, c_tmp.y, c_tmp.w, c_tmp.h,
372 c_bkp.x, c_bkp.y, c_bkp.w, c_bkp.h);
373 if (_is_empty_clip(c_tmp))
374 return;
375 }
376
377 x = MIN(x0, x1);
378 y = MIN(y0, y1);
379 w = MAX(x0, x1) - x + 1;
380 h = MAX(y0, y1) - y + 1;
381
382 RECTS_CLIP_TO_RECT(c_tmp.x, c_tmp.y, c_tmp.w, c_tmp.h, x, y, w, h);
383 if (_is_empty_clip(c_tmp))
384 return;
385
386 /* Check if the line doesn't cross the clip area */
387 if (x0 < c_tmp.x && x1 < c_tmp.x)
388 return;
389 if (x0 >= c_tmp.x + c_tmp.w && x1 >= c_tmp.x + c_tmp.w)
390 return;
391 if (y0 < c_tmp.y && y1 < c_tmp.y)
392 return;
393 if (y0 >= c_tmp.y + c_tmp.h && y1 >= c_tmp.y + c_tmp.h)
394 return;
395
396 dc->clip = c_tmp;
397 dx = x1 - x0;
398 dy = y1 - y0;
399
400 if (dx < 0)
401 {
402 int t;
403
404 t = x0;
405 x0 = x1;
406 x1 = t;
407
408 t = y0;
409 y0 = y1;
410 y1 = t;
411 }
412
413 if (dx == 0 && dy == 0)
414 _soft8_line_point(dst, dc, x0, y0);
415 else if (dx == 0)
416 _soft8_line_vert(dst, dc, x0, y0, y1);
417 else if (dy == 0)
418 _soft8_line_horiz(dst, dc, x0, x1, y0);
419 else if (dy == dx || dy == -dx)
420 _soft8_line_45deg(dst, dc, x0, y0, x1, y1);
421 else
422 _soft8_line_aliased(dst, dc, x0, y0, x1, y1);
423
424 /* restore clip info */
425 dc->clip = c_bkp;
426}
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_main.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_main.c
deleted file mode 100644
index 02282b8d7c..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_main.c
+++ /dev/null
@@ -1,655 +0,0 @@
1#include "evas_common_soft8.h"
2
3static Evas_Cache_Image *eci = NULL;
4static int reference = 0;
5
6static Image_Entry *_evas_common_soft8_image_new(void);
7static void _evas_common_soft8_image_delete(Image_Entry * ie);
8
9static int _evas_common_soft8_image_surface_alloc(Image_Entry * ie, unsigned int w, unsigned int h);
10static void _evas_common_soft8_image_surface_delete(Image_Entry * ie);
11static DATA32 *_evas_common_soft8_image_surface_pixels(Image_Entry * ie);
12
13static int _evas_common_load_soft8_image_from_file(Image_Entry * ie);
14static void _evas_common_soft8_image_unload(Image_Entry * ie);
15
16static void _evas_common_soft8_image_dirty_region(Image_Entry * im, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
17static int _evas_common_soft8_image_dirty(Image_Entry * ie_dst,
18 const Image_Entry * ie_src);
19
20static int _evas_common_soft8_image_ram_usage(Image_Entry * ie);
21
22static int _evas_common_soft8_image_size_set(Image_Entry * ie_dst,
23 const Image_Entry * ie_im, unsigned int w, unsigned int h);
24static int _evas_common_soft8_image_from_copied_data(Image_Entry * ie_dst, unsigned int w, unsigned int h, DATA32 * image_data, int alpha, int cspace);
25static int _evas_common_soft8_image_from_data(Image_Entry * ie_dst, unsigned int w, unsigned int h, DATA32 * image_data, int alpha, int cspace);
26static int _evas_common_soft8_image_colorspace_set(Image_Entry * ie_dst,
27 int cspace);
28
29static int _evas_common_load_soft8_image_data_from_file(Image_Entry * ie);
30
31/*
32static void
33_evas_common_soft8_image_debug(const char* context, Image_Entry *eim)
34{
35 DBG("[8] %p = [%s] {%s,%s} %i [%i|%i]", eim, context, eim->file, eim->key, eim->references, eim->w, eim->h);
36}
37*/
38
39static const Evas_Cache_Image_Func _evas_common_soft8_image_func = {
40 _evas_common_soft8_image_new,
41 _evas_common_soft8_image_delete,
42 _evas_common_soft8_image_surface_alloc,
43 _evas_common_soft8_image_surface_delete,
44 _evas_common_soft8_image_surface_pixels,
45 _evas_common_load_soft8_image_from_file,
46 _evas_common_soft8_image_unload,
47 _evas_common_soft8_image_dirty_region,
48 _evas_common_soft8_image_dirty,
49 _evas_common_soft8_image_size_set,
50 _evas_common_soft8_image_from_copied_data,
51 _evas_common_soft8_image_from_data,
52 _evas_common_soft8_image_colorspace_set,
53 _evas_common_load_soft8_image_data_from_file,
54 _evas_common_soft8_image_ram_usage,
55/* _evas_common_soft8_image_debug */
56 NULL
57};
58
59EAPI void
60evas_common_soft8_image_init(void)
61{
62 if (!eci)
63 eci = evas_cache_image_init(&_evas_common_soft8_image_func);
64 reference++;
65}
66
67EAPI void
68evas_common_soft8_image_shutdown(void)
69{
70 if (--reference == 0)
71 {
72// DISABLE for now - something wrong with cache shutdown freeing things
73// still in use - rage_thumb segv's now.
74//
75// actually - i think i see it. cache ref goes to 0 (and thus gets freed)
76// because in eng_setup() when a buffer changes size it is FIRST freed
77// THEN allocated again - thus brignhjing ref to 0 then back to 1 immediately
78// where it should stay at 1. - see evas_engine.c in the buffer enigne for
79// example. eng_output_free() is called BEFORE _output_setup(). although this
80// is only a SIGNE of the problem. we can patch this up with either freeing
81// after the setup (so we just pt a ref of 2 then back to 1), or just
82// evas_common_image_init() at the start and evas_common_image_shutdown()
83// after it all. really ref 0 should only be reached when no more canvases
84// with no more objects exist anywhere.
85
86// ENABLE IT AGAIN, hope it is fixed. Gustavo @ January 22nd, 2009.
87 //evas_cache_image_shutdown(eci);
88 //eci = NULL;
89 }
90}
91
92EAPI Evas_Cache_Image *
93evas_common_soft8_image_cache_get(void)
94{
95 return eci;
96}
97
98static Image_Entry *
99_evas_common_soft8_image_new(void)
100{
101 Soft8_Image *im;
102
103 im = calloc(1, sizeof(Soft8_Image));
104 if (!im)
105 return NULL;
106
107 im->stride = -1;
108
109 return (Image_Entry *) im;
110}
111
112static void
113_evas_common_soft8_image_delete(Image_Entry * ie)
114{
115 memset(ie, 0xFF, sizeof(Soft8_Image));
116 free(ie);
117}
118
119static int
120_evas_common_soft8_image_surface_alloc(Image_Entry * ie, unsigned int w, unsigned int h)
121{
122 Soft8_Image *im = (Soft8_Image *) ie;
123
124 if (im->stride < 0)
125 im->stride = _calc_stride(w);
126
127 im->pixels =
128 realloc(im->pixels, IMG_BYTE_SIZE(im->stride, h, ie->flags.alpha));
129 if (!im->pixels)
130 return -1;
131
132 if (ie->flags.alpha)
133 {
134 im->alpha = (DATA8 *) (im->pixels + (im->stride * h));
135 im->flags.free_alpha = 0;
136 }
137 im->flags.free_pixels = 1;
138
139 return 0;
140}
141
142static void
143_evas_common_soft8_image_surface_delete(Image_Entry * ie)
144{
145 Soft8_Image *im = (Soft8_Image *) ie;
146
147 if (im->flags.free_pixels)
148 free(im->pixels);
149 im->pixels = NULL;
150 im->flags.free_pixels = 0;
151
152 if (im->flags.free_alpha)
153 free(im->alpha);
154 im->alpha = NULL;
155 im->flags.free_alpha = 0;
156}
157
158static DATA32 *
159_evas_common_soft8_image_surface_pixels(Image_Entry * ie __UNUSED__)
160{
161 abort();
162
163 return NULL;
164}
165
166static int
167_evas_common_load_soft8_image_from_file(Image_Entry * ie)
168{
169 Soft8_Image *sim = (Soft8_Image *) ie;
170 RGBA_Image *im;
171 int error = 0;
172
173 im = (RGBA_Image *) evas_cache_image_request(evas_common_image_cache_get(),
174 sim->cache_entry.file,
175 sim->cache_entry.key,
176 &sim->cache_entry.load_opts,
177 &error);
178 sim->source = im;
179 if (!sim->source)
180 return -1;
181
182 sim->cache_entry.w = sim->source->cache_entry.w;
183 sim->cache_entry.h = sim->source->cache_entry.h;
184 ie->flags.alpha = im->cache_entry.flags.alpha;
185 if (sim->stride < 0)
186 sim->stride = _calc_stride(sim->cache_entry.w);
187
188 return 0;
189}
190
191static void
192_evas_common_soft8_image_unload(Image_Entry * ie __UNUSED__)
193{
194}
195
196static void
197_evas_common_soft8_image_dirty_region(Image_Entry * im __UNUSED__,
198 unsigned int x __UNUSED__,
199 unsigned int y __UNUSED__,
200 unsigned int w __UNUSED__,
201 unsigned int h __UNUSED__)
202{
203}
204
205static int
206_evas_common_soft8_image_dirty(Image_Entry * ie_dst, const Image_Entry * ie_src)
207{
208 Soft8_Image *dst = (Soft8_Image *) ie_dst;
209 Soft8_Image *src = (Soft8_Image *) ie_src;
210
211 evas_cache_image_load_data(&src->cache_entry);
212 evas_cache_image_surface_alloc(&dst->cache_entry,
213 src->cache_entry.w, src->cache_entry.h);
214
215/* evas_common_blit_rectangle(src, dst, 0, 0, src->cache_entry.w, src->cache_entry.h, 0, 0); */
216
217 return 0;
218}
219
220static int
221_evas_common_soft8_image_ram_usage(Image_Entry * ie)
222{
223 Soft8_Image *im = (Soft8_Image *) ie;
224
225 if (im->pixels && im->flags.free_pixels)
226 return IMG_BYTE_SIZE(im->stride, im->cache_entry.h, ie->flags.alpha);
227 return 0;
228}
229
230static int
231_evas_common_soft8_image_size_set(Image_Entry * ie_dst,
232 const Image_Entry * ie_im,
233 unsigned int w __UNUSED__,
234 unsigned int h __UNUSED__)
235{
236 Soft8_Image *dst = (Soft8_Image *) ie_dst;
237 Soft8_Image *im = (Soft8_Image *) ie_im;
238
239 dst->flags = im->flags;
240
241 return 0;
242}
243
244static int
245_evas_common_soft8_image_from_data(Image_Entry * ie_dst,
246 unsigned int w, unsigned int h,
247 DATA32 * image_data, int alpha,
248 int cspace __UNUSED__)
249{
250 Soft8_Image *im = (Soft8_Image *) ie_dst;
251
252 /* FIXME: handle colorspace */
253 ie_dst->w = w;
254 ie_dst->h = h;
255 ie_dst->flags.alpha = alpha;
256
257 im->flags.free_pixels = 0;
258 im->flags.free_alpha = 0;
259 if (im->stride < 0)
260 im->stride = _calc_stride(w);
261
262 /* FIXME: That's bad, the application must be aware of the engine internal. */
263 im->pixels = (DATA8 *) image_data;
264 if (ie_dst->flags.alpha)
265 im->alpha = (DATA8 *) (im->pixels + (im->stride * h));
266
267 return 0;
268}
269
270static int
271_evas_common_soft8_image_from_copied_data(Image_Entry * ie_dst,
272 unsigned int w __UNUSED__,
273 unsigned int h,
274 DATA32 * image_data,
275 int alpha __UNUSED__,
276 int cspace __UNUSED__)
277{
278 Soft8_Image *im = (Soft8_Image *) ie_dst;
279
280 /* FIXME: handle colorspace */
281 if (image_data)
282 memcpy(im->pixels, image_data,
283 IMG_BYTE_SIZE(im->stride, h, ie_dst->flags.alpha));
284 else
285 memset(im->pixels, 0, IMG_BYTE_SIZE(im->stride, h, ie_dst->flags.alpha));
286
287 return 0;
288}
289
290static int
291_evas_common_soft8_image_colorspace_set(Image_Entry * ie_dst __UNUSED__,
292 int cspace __UNUSED__)
293{
294 /* FIXME: handle colorspace */
295 return 0;
296}
297
298static int
299_evas_common_load_soft8_image_data_from_file(Image_Entry * ie)
300{
301 Soft8_Image *im = (Soft8_Image *) ie;
302
303 if (im->pixels)
304 return 0;
305 if (!im->source)
306 return -1;
307
308 evas_cache_image_load_data(&im->source->cache_entry);
309 if (im->source->image.data)
310 {
311 DATA32 *sp;
312
313 evas_cache_image_surface_alloc(&im->cache_entry,
314 im->source->cache_entry.w,
315 im->source->cache_entry.h);
316
317 sp = im->source->image.data;
318 if (im->alpha)
319 evas_common_soft8_image_convert_from_rgba(im, sp);
320 else
321 evas_common_soft8_image_convert_from_rgb(im, sp);
322 }
323 evas_cache_image_drop(&im->source->cache_entry);
324 im->source = NULL;
325
326 return 0;
327}
328
329/* Soft16_Image * */
330/* evas_common_soft16_image_new(int w, unsigned int h, unsigned int stride, int have_alpha, DATA16 *pixels, */
331/* int copy) */
332/* { */
333/* Soft16_Image *im; */
334
335/* if (stride < 0) stride = _calc_stride(w); */
336
337/* im = evas_common_soft16_image_alloc(w, h, stride, have_alpha, copy); */
338/* if (!im) return NULL; */
339
340/* if (pixels) */
341/* { */
342/* if (copy) */
343/* memcpy(im->pixels, pixels, IMG_BYTE_SIZE(stride, h, have_alpha)); */
344/* else */
345/* { */
346/* im->pixels = pixels; */
347/* if (have_alpha) im->alpha = (DATA8 *)(im->pixels + (stride * h)); */
348/* } */
349/* } */
350/* return im; */
351/* } */
352
353static inline void
354_get_clip(const RGBA_Draw_Context * dc, const Soft8_Image * im,
355 Eina_Rectangle * clip)
356{
357 if (dc->clip.use)
358 {
359 EINA_RECTANGLE_SET(clip, dc->clip.x, dc->clip.y, dc->clip.w,
360 dc->clip.h);
361 if (clip->x < 0)
362 {
363 clip->w += clip->x;
364 clip->x = 0;
365 }
366 if (clip->y < 0)
367 {
368 clip->h += clip->y;
369 clip->y = 0;
370 }
371 if ((clip->x + clip->w) > (int)im->cache_entry.w)
372 clip->w = im->cache_entry.w - clip->x;
373 if ((clip->y + clip->h) > (int)im->cache_entry.h)
374 clip->h = im->cache_entry.h - clip->y;
375 }
376 else
377 {
378 EINA_RECTANGLE_SET(clip, 0, 0, im->cache_entry.w, im->cache_entry.h);
379 }
380}
381
382static inline int
383_is_empty_rectangle(const Eina_Rectangle * r)
384{
385 return (r->w < 1) || (r->h < 1);
386}
387
388static inline void
389_shrink(int *s_pos, int *s_size, int pos, int size)
390{
391 int d;
392
393 d = (*s_pos) - pos;
394 if (d < 0)
395 {
396 (*s_size) += d;
397 (*s_pos) = pos;
398 }
399
400 d = size + pos - (*s_pos);
401 if ((*s_size) > d)
402 (*s_size) = d;
403}
404
405static int
406_soft8_adjust_areas(Eina_Rectangle * src,
407 int src_max_x, int src_max_y, Eina_Rectangle * dst,
408 int dst_max_x, int dst_max_y, Eina_Rectangle * dst_clip)
409{
410 if (_is_empty_rectangle(src) ||
411 _is_empty_rectangle(dst) || _is_empty_rectangle(dst_clip))
412 return 0;
413
414 /* shrink clip */
415 _shrink(&dst_clip->x, &dst_clip->w, dst->x, dst->w);
416 _shrink(&dst_clip->y, &dst_clip->h, dst->y, dst->h);
417 if (_is_empty_rectangle(dst_clip))
418 return 0;
419
420 /* sanitise x */
421 if (src->x < 0)
422 {
423 dst->x -= (src->x * dst->w) / src->w;
424 dst->w += (src->x * dst->w) / src->w;
425 src->w += src->x;
426 src->x = 0;
427 }
428 if (src->x >= src_max_x)
429 return 0;
430 if ((src->x + src->w) > src_max_x)
431 {
432 dst->w = (dst->w * (src_max_x - src->x)) / (src->w);
433 src->w = src_max_x - src->x;
434 }
435 if (dst->w <= 0)
436 return 0;
437 if (src->w <= 0)
438 return 0;
439 if (dst_clip->x < 0)
440 {
441 dst_clip->w += dst_clip->x;
442 dst_clip->x = 0;
443 }
444 if (dst_clip->w <= 0)
445 return 0;
446 if (dst_clip->x >= dst_max_x)
447 return 0;
448
449 _shrink(&dst_clip->x, &dst_clip->w, 0, dst_max_x);
450 if (dst_clip->w <= 0)
451 return 0;
452
453 /* sanitise y */
454 if (src->y < 0)
455 {
456 dst->y -= (src->y * dst->h) / src->h;
457 dst->h += (src->y * dst->h) / src->h;
458 src->h += src->y;
459 src->y = 0;
460 }
461 if (src->y >= src_max_y)
462 return 0;
463 if ((src->y + src->h) > src_max_y)
464 {
465 dst->h = (dst->h * (src_max_y - src->y)) / (src->h);
466 src->h = src_max_y - src->y;
467 }
468 if (dst->h <= 0)
469 return 0;
470 if (src->h <= 0)
471 return 0;
472 if (dst_clip->y < 0)
473 {
474 dst_clip->h += dst_clip->y;
475 dst_clip->y = 0;
476 }
477 if (dst_clip->h <= 0)
478 return 0;
479 if (dst_clip->y >= dst_max_y)
480 return 0;
481
482 _shrink(&dst_clip->y, &dst_clip->h, 0, dst_max_y);
483 if (dst_clip->h <= 0)
484 return 0;
485
486 return 1;
487}
488
489static void
490_soft8_image_draw_sampled_int(Soft8_Image * src, Soft8_Image * dst,
491 RGBA_Draw_Context * dc,
492 Eina_Rectangle sr, Eina_Rectangle dr)
493{
494 Eina_Rectangle cr;
495
496 if (!
497 (RECTS_INTERSECT
498 (dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
499 return;
500 if (!
501 (RECTS_INTERSECT
502 (sr.x, sr.y, sr.w, sr.h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
503 return;
504
505 _get_clip(dc, dst, &cr);
506 if (!_soft8_adjust_areas
507 (&sr, src->cache_entry.w, src->cache_entry.h, &dr, dst->cache_entry.w,
508 dst->cache_entry.h, &cr))
509 return;
510
511 if ((dr.w == sr.w) && (dr.h == sr.h))
512 evas_common_soft8_image_draw_unscaled(src, dst, dc, sr, dr, cr);
513 else
514 evas_common_soft8_image_draw_scaled_sampled(src, dst, dc, sr, dr, cr);
515}
516
517EAPI void
518evas_common_soft8_image_draw(Soft8_Image * src, Soft8_Image * dst,
519 RGBA_Draw_Context * dc,
520 int src_region_x, int src_region_y,
521 int src_region_w, int src_region_h,
522 int dst_region_x, int dst_region_y,
523 int dst_region_w, int dst_region_h,
524 int smooth __UNUSED__)
525{
526 static Cutout_Rects *rects = NULL;
527 Eina_Rectangle sr, dr;
528 Cutout_Rect *r;
529 struct RGBA_Draw_Context_clip clip_bkp;
530 int i;
531
532 /* handle cutouts here! */
533 EINA_RECTANGLE_SET(&dr, dst_region_x, dst_region_y, dst_region_w,
534 dst_region_h);
535
536 if (_is_empty_rectangle(&dr))
537 return;
538 if (!
539 (RECTS_INTERSECT
540 (dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
541 return;
542
543 EINA_RECTANGLE_SET(&sr, src_region_x, src_region_y, src_region_w,
544 src_region_h);
545
546 if (_is_empty_rectangle(&sr))
547 return;
548 if (!
549 (RECTS_INTERSECT
550 (sr.x, sr.y, sr.w, sr.h, 0, 0, src->cache_entry.w, src->cache_entry.h)))
551 return;
552
553 /* no cutouts - cut right to the chase */
554 if (!dc->cutout.rects)
555 {
556 _soft8_image_draw_sampled_int(src, dst, dc, sr, dr);
557 return;
558 }
559
560 /* save out clip info */
561 clip_bkp = dc->clip;
562 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w,
563 dst->cache_entry.h);
564 evas_common_draw_context_clip_clip(dc, dst_region_x, dst_region_y,
565 dst_region_w, dst_region_h);
566 /* our clip is 0 size.. abort */
567 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
568 {
569 dc->clip = clip_bkp;
570 return;
571 }
572 rects = evas_common_draw_context_apply_cutouts(dc, rects);
573 for (i = 0; i < rects->active; i++)
574 {
575 r = rects->rects + i;
576 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
577 _soft8_image_draw_sampled_int(src, dst, dc, sr, dr);
578 }
579 dc->clip = clip_bkp;
580}
581
582EAPI Soft8_Image *
583evas_common_soft8_image_alpha_set(Soft8_Image * im, int have_alpha)
584{
585 Soft8_Image *new_im;
586
587 if (im->cache_entry.flags.alpha == have_alpha)
588 return im;
589
590 new_im = (Soft8_Image *) evas_cache_image_alone(&im->cache_entry);
591
592 new_im->cache_entry.flags.alpha = have_alpha;
593
594 if (im->cache_entry.w > 0 && im->cache_entry.h)
595 new_im =
596 (Soft8_Image *) evas_cache_image_size_set(&new_im->cache_entry,
597 im->cache_entry.w,
598 im->cache_entry.h);
599
600 return new_im;
601}
602
603/* Soft16_Image * */
604/* evas_common_soft16_image_size_set(Soft16_Image *old_im, unsigned int w, unsigned int h) */
605/* { */
606/* Soft16_Image *new_im; */
607/* DATA16 *dp, *sp; */
608/* int i, cw, ch, ew; */
609
610/* if ((old_im->cache_entry.w == w) && (old_im->cache_entry.h == h)) return old_im; */
611
612/* new_im = evas_common_soft16_image_new(w, h, -1, old_im->flags.have_alpha, NULL, 1); */
613
614/* if (old_im->cache_entry.w < new_im->cache_entry.w) */
615/* cw = old_im->cache_entry.w; */
616/* else */
617/* cw = new_im->cache_entry.w; */
618
619/* ew = new_im->cache_entry.w - cw; */
620
621/* if (old_im->cache_entry.h < new_im->cache_entry.h) */
622/* ch = old_im->cache_entry.h; */
623/* else */
624/* ch = new_im->cache_entry.h; */
625
626/* dp = new_im->pixels; */
627/* sp = old_im->pixels; */
628/* for (i = 0; i < ch; i++) */
629/* { */
630/* memcpy(dp, sp, cw * sizeof(DATA16)); */
631/* if (ew > 0) memset(dp, 0, ew * sizeof(DATA16)); */
632
633/* dp += new_im->stride; */
634/* sp += old_im->stride; */
635/* } */
636
637/* if (old_im->flags.have_alpha) */
638/* { */
639/* DATA8 *dp, *sp; */
640
641/* dp = new_im->alpha; */
642/* sp = old_im->alpha; */
643/* for (i = 0; i < ch; i++) */
644/* { */
645/* memcpy(dp, sp, cw * sizeof(DATA8)); */
646/* if (ew > 0) memset(dp, 0, ew * sizeof(DATA8)); */
647
648/* dp += new_im->stride; */
649/* sp += old_im->stride; */
650/* } */
651/* } */
652
653/* evas_cache_image_drop(&old_im->cache_entry); */
654/* return new_im; */
655/* } */
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_polygon.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_polygon.c
deleted file mode 100644
index fb7027ea3d..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_polygon.c
+++ /dev/null
@@ -1,230 +0,0 @@
1#include <evas_common_soft8.h>
2#include "evas_soft8_scanline_fill.c"
3#include <math.h>
4
5typedef struct _RGBA_Edge RGBA_Edge;
6typedef struct _RGBA_Vertex RGBA_Vertex;
7
8struct _RGBA_Edge {
9 float x, dx;
10 int i;
11};
12
13struct _RGBA_Vertex {
14 float x, y;
15 int i;
16};
17
18#define POLY_EDGE_DEL(_i) \
19{ \
20 int _j; \
21 \
22 for (_j = 0; (_j < num_active_edges) && (edges[_j].i != _i); _j++); \
23 if (_j < num_active_edges) \
24 { \
25 num_active_edges--; \
26 memmove(&(edges[_j]), &(edges[_j + 1]), \
27 (num_active_edges - _j) * sizeof(RGBA_Edge)); \
28 } \
29}
30
31#define POLY_EDGE_ADD(_i, _y) \
32{ \
33 int _j; \
34 float _dx; \
35 RGBA_Vertex *_p, *_q; \
36 if (_i < (n - 1)) _j = _i + 1; \
37 else _j = 0; \
38 if (point[_i].y < point[_j].y) \
39 { \
40 _p = &(point[_i]); \
41 _q = &(point[_j]); \
42 } \
43 else \
44 { \
45 _p = &(point[_j]); \
46 _q = &(point[_i]); \
47 } \
48 edges[num_active_edges].dx = _dx = (_q->x - _p->x) / (_q->y - _p->y); \
49 edges[num_active_edges].x = (_dx * ((float)_y + 0.5 - _p->y)) + _p->x; \
50 edges[num_active_edges].i = _i; \
51 num_active_edges++; \
52}
53
54static int
55polygon_point_sorter(const void *a, const void *b)
56{
57 RGBA_Vertex *p, *q;
58
59 p = (RGBA_Vertex *) a;
60 q = (RGBA_Vertex *) b;
61 if (p->y <= q->y)
62 return -1;
63 return 1;
64}
65
66static int
67polygon_edge_sorter(const void *a, const void *b)
68{
69 RGBA_Edge *p, *q;
70
71 p = (RGBA_Edge *) a;
72 q = (RGBA_Edge *) b;
73 if (p->x <= q->x)
74 return -1;
75 return 1;
76}
77
78void
79evas_common_soft8_polygon_draw(Soft8_Image * dst, RGBA_Draw_Context * dc,
80 RGBA_Polygon_Point * points, int x, int y)
81{
82 RGBA_Polygon_Point *pt;
83 RGBA_Vertex *point;
84 RGBA_Edge *edges;
85 int num_active_edges;
86 int n;
87 int i, j, k;
88 int y0, y1, yi;
89 int ext_x, ext_y, ext_w, ext_h;
90 int *sorted_index;
91 DATA8 alpha;
92 DATA8 gry8;
93
94 alpha = A_VAL(&dc->col.col);
95 if (alpha == 0)
96 return;
97 alpha++;
98
99 gry8 = GRY_8_FROM_RGB(&dc->col.col);
100
101 ext_x = 0;
102 ext_y = 0;
103 ext_w = dst->cache_entry.w;
104 ext_h = dst->cache_entry.h;
105 if (dc->clip.use)
106 RECTS_CLIP_TO_RECT(ext_x, ext_y, ext_w, ext_h,
107 dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
108
109 if ((ext_w <= 0) || (ext_h <= 0))
110 return;
111
112 n = 0;
113 EINA_INLIST_FOREACH(points, pt) n++;
114
115 if (n < 3)
116 return;
117
118 edges = malloc(sizeof(RGBA_Edge) * n);
119 if (!edges)
120 return;
121
122 point = malloc(sizeof(RGBA_Vertex) * n);
123 if (!point)
124 {
125 free(edges);
126 return;
127 }
128
129 sorted_index = malloc(sizeof(int) * n);
130 if (!sorted_index)
131 {
132 free(edges);
133 free(point);
134 return;
135 }
136
137 k = 0;
138 EINA_INLIST_FOREACH(points, pt)
139 {
140 point[k].x = pt->x + x;
141 point[k].y = pt->y + y;
142 point[k].i = k;
143 k++;
144 }
145 qsort(point, n, sizeof(RGBA_Vertex), polygon_point_sorter);
146
147 for (k = 0; k < n; k++)
148 sorted_index[k] = point[k].i;
149
150 k = 0;
151 EINA_INLIST_FOREACH(points, pt)
152 {
153 point[k].x = pt->x + x;
154 point[k].y = pt->y + y;
155 point[k].i = k;
156 k++;
157 }
158
159 y0 = MAX(ext_y, ceil(point[sorted_index[0]].y - 0.5));
160 y1 = MIN(ext_y + ext_h - 1, floor(point[sorted_index[n - 1]].y - 0.5));
161
162 k = 0;
163 num_active_edges = 0;
164
165 for (yi = y0; yi <= y1; yi++)
166 {
167 for (; (k < n) && (point[sorted_index[k]].y <= ((float)yi + 0.5)); k++)
168 {
169 i = sorted_index[k];
170
171 if (i > 0)
172 j = i - 1;
173 else
174 j = n - 1;
175 if (point[j].y <= ((float)yi - 0.5))
176 {
177 POLY_EDGE_DEL(j)}
178 else if (point[j].y > ((float)yi + 0.5))
179 {
180 POLY_EDGE_ADD(j, yi)}
181 if (i < (n - 1))
182 j = i + 1;
183 else
184 j = 0;
185 if (point[j].y <= ((float)yi - 0.5))
186 {
187 POLY_EDGE_DEL(i)}
188 else if (point[j].y > ((float)yi + 0.5))
189 {
190 POLY_EDGE_ADD(i, yi)}
191 }
192
193 qsort(edges, num_active_edges, sizeof(RGBA_Edge), polygon_edge_sorter);
194
195 for (j = 0; j < num_active_edges; j += 2)
196 {
197 int x0, x1;
198
199 x0 = ceil(edges[j].x - 0.5);
200 if (j < (num_active_edges - 1))
201 x1 = floor(edges[j + 1].x - 0.5);
202 else
203 x1 = x0;
204 if ((x1 >= ext_x) && (x0 < (ext_x + ext_w)) && (x0 <= x1))
205 {
206 DATA8 *dst_itr;
207 int w;
208
209 if (x0 < ext_x)
210 x0 = ext_x;
211 if (x1 >= (ext_x + ext_w))
212 x1 = ext_x + ext_w - 1;
213
214 w = (x1 - x0) + 1;
215 dst_itr = dst->pixels + (yi * dst->stride) + x0;
216
217 if (alpha == 0xff)
218 _soft8_scanline_fill_solid_solid(dst_itr, w, gry8);
219 else
220 _soft8_scanline_fill_transp_solid(dst_itr, w, gry8, alpha);
221 }
222 edges[j].x += edges[j].dx;
223 edges[j + 1].x += edges[j + 1].dx;
224 }
225 }
226
227 free(edges);
228 free(point);
229 free(sorted_index);
230}
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_rectangle.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_rectangle.c
deleted file mode 100644
index 98a053bb81..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_rectangle.c
+++ /dev/null
@@ -1,124 +0,0 @@
1#include "evas_common_soft8.h"
2#include "evas_soft8_scanline_fill.c"
3
4static inline int
5_is_empty_rectangle(const Eina_Rectangle * r)
6{
7 return (r->w < 1) || (r->h < 1);
8}
9
10static inline void
11_soft8_rectangle_draw_solid_solid(Soft8_Image * dst, int offset, int w, int h,
12 DATA8 gry8)
13{
14 DATA8 *dst_itr;
15 int i;
16
17 dst_itr = dst->pixels + offset;
18
19 for (i = 0; i < h; i++, dst_itr += dst->stride)
20 _soft8_scanline_fill_solid_solid(dst_itr, w, gry8);
21}
22
23static inline void
24_soft8_rectangle_draw_transp_solid(Soft8_Image * dst, int offset, int w, int h,
25 DATA8 gry8, DATA8 alpha)
26{
27 DATA8 *dst_itr;
28 int i;
29
30 dst_itr = dst->pixels + offset;
31 alpha++;
32
33 for (i = 0; i < h; i++, dst_itr += dst->stride)
34 _soft8_scanline_fill_transp_solid(dst_itr, w, gry8, alpha);
35}
36
37static void
38_soft8_rectangle_draw_int(Soft8_Image * dst, RGBA_Draw_Context * dc,
39 Eina_Rectangle dr)
40{
41 int dst_offset;
42
43 if (_is_empty_rectangle(&dr))
44 return;
45 RECTS_CLIP_TO_RECT(dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w,
46 dst->cache_entry.h);
47 if (_is_empty_rectangle(&dr))
48 return;
49
50 if (dc->clip.use)
51 RECTS_CLIP_TO_RECT(dr.x, dr.y, dr.w, dr.h, dc->clip.x,
52 dc->clip.y, dc->clip.w, dc->clip.h);
53 if (_is_empty_rectangle(&dr))
54 return;
55 if (A_VAL(&dc->col.col) == 0)
56 return;
57
58 dst_offset = dr.x + (dr.y * dst->stride);
59
60 if (!dst->cache_entry.flags.alpha)
61 {
62 DATA8 gry8;
63 DATA8 alpha;
64
65 alpha = A_VAL(&dc->col.col);
66 gry8 = GRY_8_FROM_RGB(&dc->col.col);
67
68 if (alpha == 0xff)
69 _soft8_rectangle_draw_solid_solid(dst, dst_offset, dr.w, dr.h, gry8);
70 else if (alpha > 0)
71 _soft8_rectangle_draw_transp_solid
72 (dst, dst_offset, dr.w, dr.h, gry8, alpha);
73 }
74 else
75 ERR("Unsupported feature: drawing rectangle to non-opaque destination.");
76}
77
78void
79evas_common_soft8_rectangle_draw(Soft8_Image * dst, RGBA_Draw_Context * dc,
80 int x, int y, int w, int h)
81{
82 static Cutout_Rects *rects = NULL;
83 Eina_Rectangle dr;
84 Cutout_Rect *r;
85 struct RGBA_Draw_Context_clip c_bkp;
86 int i;
87
88 /* handle cutouts here! */
89 EINA_RECTANGLE_SET(&dr, x, y, w, h);
90
91 if (_is_empty_rectangle(&dr))
92 return;
93 if (!
94 (RECTS_INTERSECT
95 (dr.x, dr.y, dr.w, dr.h, 0, 0, dst->cache_entry.w, dst->cache_entry.h)))
96 return;
97
98 /* no cutouts - cut right to the chase */
99 if (!dc->cutout.rects)
100 {
101 _soft8_rectangle_draw_int(dst, dc, dr);
102 return;
103 }
104
105 c_bkp = dc->clip;
106
107 evas_common_draw_context_clip_clip(dc, 0, 0, dst->cache_entry.w,
108 dst->cache_entry.h);
109 evas_common_draw_context_clip_clip(dc, x, y, w, h);
110 /* our clip is 0 size.. abort */
111 if ((dc->clip.w <= 0) || (dc->clip.h <= 0))
112 {
113 dc->clip = c_bkp;
114 return;
115 }
116 rects = evas_common_draw_context_apply_cutouts(dc, rects);
117 for (i = 0; i < rects->active; ++i)
118 {
119 r = rects->rects + i;
120 evas_common_draw_context_set_clip(dc, r->x, r->y, r->w, r->h);
121 _soft8_rectangle_draw_int(dst, dc, dr);
122 }
123 dc->clip = c_bkp;
124}
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c
deleted file mode 100644
index 5fc62c2600..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c
+++ /dev/null
@@ -1,447 +0,0 @@
1/** NOTE: This file is meant to be included by users **/
2
3/** NOTE2: r, g, b parameters are 16bits, so you can pass 0 to 256 inclusive.
4 ** this is due our division by 256 when multiplying the color.
5 **/
6
7/*****************************************************************************
8 * Scanline processing
9 *
10 * _soft8_scanline_<description>_<src>_<dst>[_<modifier>]()
11 *
12 ****************************************************************************/
13
14EFL_ALWAYS_INLINE void
15_soft8_pt_blend_transp_solid(DATA8 * p_dst, DATA8 src, DATA8 alpha)
16{
17 if (alpha == 0xff)
18 *p_dst = src;
19 else if (alpha != 0)
20 {
21 *p_dst = GRY_8_BLEND(src, *p_dst, alpha);
22 }
23}
24
25/***********************************************************************
26 * Regular blend operations
27 */
28static void
29_soft8_scanline_blend_transp_solid(DATA8 * src, DATA8 * alpha, DATA8 * dst,
30 int size)
31{
32 DATA8 *start, *end;
33
34 start = dst;
35 end = start + (size & ~7);
36
37 pld(alpha, 0);
38 pld(src, 0);
39
40 /* work on 8 pixels per time, do data preload */
41 while (start < end)
42 {
43 DATA8 alpha1, alpha2;
44
45 alpha1 = alpha[0];
46 alpha += 8;
47
48 /* empirical tests show these give the best performance */
49 pld(alpha, 8);
50 pld(src, 32);
51
52 src += 8;
53 start += 8;
54
55 alpha2 = alpha[-7];
56 _soft8_pt_blend_transp_solid(start - 8, src[-8], alpha1);
57
58 alpha1 = alpha[-6];
59 _soft8_pt_blend_transp_solid(start - 7, src[-7], alpha2);
60
61 alpha2 = alpha[-5];
62 _soft8_pt_blend_transp_solid(start - 6, src[-6], alpha1);
63
64 alpha1 = alpha[-4];
65 _soft8_pt_blend_transp_solid(start - 5, src[-5], alpha2);
66
67 alpha2 = alpha[-3];
68 _soft8_pt_blend_transp_solid(start - 4, src[-4], alpha1);
69
70 alpha1 = alpha[-2];
71 _soft8_pt_blend_transp_solid(start - 3, src[-3], alpha2);
72
73 alpha2 = alpha[-1];
74 _soft8_pt_blend_transp_solid(start - 2, src[-2], alpha1);
75
76 _soft8_pt_blend_transp_solid(start - 1, src[-1], alpha2);
77 }
78
79 /* remaining pixels (up to 7) */
80 end = start + (size & 7);
81 for (; start < end; start++, src++, alpha++)
82 _soft8_pt_blend_transp_solid(start, *src, *alpha);
83}
84
85EFL_ALWAYS_INLINE void
86_soft8_pt_blend_solid_solid(DATA8 * p_dst, DATA8 src)
87{
88 *p_dst = src;
89}
90
91static inline void
92_soft8_scanline_blend_solid_solid(DATA8 * src, DATA8 * dst, int size)
93{
94 memcpy(dst, src, size * sizeof(DATA8));
95}
96
97/***********************************************************************
98 * Blend operations taking an extra alpha (fade in, out)
99 */
100
101static inline void
102_soft8_pt_blend_transp_solid_mul_alpha(DATA8 * p_dst, DATA8 src, DATA8 alpha,
103 DATA8 rel_alpha)
104{
105 alpha = alpha * rel_alpha;
106 if (alpha == 0)
107 return;
108
109 alpha++;
110 *p_dst = GRY_8_BLEND((src * rel_alpha) & 0xff, *p_dst, alpha);
111}
112
113static void
114_soft8_scanline_blend_transp_solid_mul_alpha(DATA8 * src, DATA8 * alpha,
115 DATA8 * dst, int size,
116 const DATA8 rel_alpha)
117{
118 DATA8 *start, *end;
119
120 start = dst;
121 end = start + (size & ~7);
122
123 pld(alpha, 0);
124 pld(src, 0);
125
126 while (start < end)
127 {
128 DATA8 alpha1, alpha2;
129
130 alpha1 = alpha[0];
131 alpha += 8;
132
133 pld(alpha, 8);
134 pld(src, 32);
135
136 src += 8;
137 start += 8;
138
139 alpha2 = alpha[-7];
140 _soft8_pt_blend_transp_solid_mul_alpha
141 (start - 8, src[-8], alpha1, rel_alpha);
142
143 alpha1 = alpha[-6];
144 _soft8_pt_blend_transp_solid_mul_alpha
145 (start - 7, src[-7], alpha2, rel_alpha);
146
147 alpha2 = alpha[-5];
148 _soft8_pt_blend_transp_solid_mul_alpha
149 (start - 6, src[-6], alpha1, rel_alpha);
150
151 alpha1 = alpha[-4];
152 _soft8_pt_blend_transp_solid_mul_alpha
153 (start - 5, src[-5], alpha2, rel_alpha);
154
155 alpha2 = alpha[-3];
156 _soft8_pt_blend_transp_solid_mul_alpha
157 (start - 4, src[-4], alpha1, rel_alpha);
158
159 alpha1 = alpha[-2];
160 _soft8_pt_blend_transp_solid_mul_alpha
161 (start - 3, src[-3], alpha2, rel_alpha);
162
163 alpha2 = alpha[-1];
164 _soft8_pt_blend_transp_solid_mul_alpha
165 (start - 2, src[-2], alpha1, rel_alpha);
166
167 _soft8_pt_blend_transp_solid_mul_alpha
168 (start - 1, src[-1], alpha2, rel_alpha);
169 }
170
171 end = start + (size & 7);
172 for (; start < end; start++, src++, alpha++)
173 _soft8_pt_blend_transp_solid_mul_alpha(start, *src, *alpha, rel_alpha);
174}
175
176EFL_ALWAYS_INLINE void
177_soft8_pt_blend_solid_solid_mul_alpha(DATA8 * p_dst, DATA8 src, DATA8 rel_alpha)
178{
179 *p_dst = GRY_8_BLEND_UNMUL(src, *p_dst, rel_alpha);
180}
181
182static void
183_soft8_scanline_blend_solid_solid_mul_alpha(DATA8 * src, DATA8 * dst, int size,
184 DATA8 rel_alpha)
185{
186 DATA8 *start, *end;
187
188 start = dst;
189 end = start + (size & ~7);
190
191 pld(src, 0);
192
193 while (start < end)
194 {
195 pld(src, 32);
196 UNROLL8(
197 {
198 _soft8_pt_blend_solid_solid_mul_alpha(start, *src, rel_alpha);
199 start++; src++;}
200 );
201 }
202
203 end = start + (size & 7);
204 for (; start < end; start++, src++)
205 _soft8_pt_blend_solid_solid_mul_alpha(start, *src, rel_alpha);
206}
207
208/***********************************************************************
209 * Blend operations with extra alpha and multiply color
210 */
211
212EFL_ALWAYS_INLINE void
213_soft8_pt_blend_transp_solid_mul_color_transp(DATA8 * p_dst, DATA8 src,
214 DATA8 alpha, DATA8 rel_alpha,
215 DATA8 r, DATA8 g, DATA8 b)
216{
217 alpha = alpha * rel_alpha;
218 if (alpha == 0)
219 return;
220
221 alpha++;
222
223 DATA8 gry8 = (src * GRY_8_FROM_COMPONENTS(r, g, b)) >> 8;
224 *p_dst = GRY_8_BLEND(gry8, *p_dst, alpha);
225}
226
227static void
228_soft8_scanline_blend_transp_solid_mul_color_transp(DATA8 * src, DATA8 * alpha,
229 DATA8 * dst, int size,
230 DATA8 rel_alpha, DATA8 r,
231 DATA8 g, DATA8 b)
232{
233 DATA8 *start, *end;
234
235 start = dst;
236 end = start + (size & ~7);
237
238 pld(alpha, 0);
239 pld(src, 0);
240
241 while (start < end)
242 {
243 DATA8 alpha1, alpha2;
244
245 alpha1 = alpha[0];
246 alpha += 8;
247
248 pld(src, 32);
249 pld(start, 32);
250
251 src += 8;
252 start += 8;
253
254 alpha2 = alpha[-7];
255 _soft8_pt_blend_transp_solid_mul_color_transp
256 (start - 8, src[-8], alpha1, rel_alpha, r, g, b);
257
258 alpha1 = alpha[-6];
259 _soft8_pt_blend_transp_solid_mul_color_transp
260 (start - 7, src[-7], alpha2, rel_alpha, r, g, b);
261
262 alpha2 = alpha[-5];
263 _soft8_pt_blend_transp_solid_mul_color_transp
264 (start - 6, src[-6], alpha1, rel_alpha, r, g, b);
265
266 alpha1 = alpha[-4];
267 _soft8_pt_blend_transp_solid_mul_color_transp
268 (start - 5, src[-5], alpha2, rel_alpha, r, g, b);
269
270 alpha2 = alpha[-3];
271 _soft8_pt_blend_transp_solid_mul_color_transp
272 (start - 4, src[-4], alpha1, rel_alpha, r, g, b);
273
274 alpha1 = alpha[-2];
275 _soft8_pt_blend_transp_solid_mul_color_transp
276 (start - 3, src[-3], alpha2, rel_alpha, r, g, b);
277
278 alpha2 = alpha[-1];
279 _soft8_pt_blend_transp_solid_mul_color_transp
280 (start - 2, src[-2], alpha1, rel_alpha, r, g, b);
281
282 _soft8_pt_blend_transp_solid_mul_color_transp
283 (start - 1, src[-1], alpha2, rel_alpha, r, g, b);
284 }
285
286 end = start + (size & 7);
287 for (; start < end; start++, src++, alpha++)
288 _soft8_pt_blend_transp_solid_mul_color_transp
289 (start, *src, *alpha, rel_alpha, r, g, b);
290}
291
292EFL_ALWAYS_INLINE void
293_soft8_pt_blend_solid_solid_mul_color_transp(DATA8 * p_dst, DATA8 src,
294 DATA8 rel_alpha, DATA8 r, DATA8 g,
295 DATA8 b)
296{
297 DATA8 gry8 = (src * GRY_8_FROM_COMPONENTS(r, g, b)) >> 8;
298 *p_dst = GRY_8_BLEND(gry8, *p_dst, rel_alpha);
299}
300
301static void
302_soft8_scanline_blend_solid_solid_mul_color_transp(DATA8 * src, DATA8 * dst,
303 int size, DATA8 rel_alpha,
304 DATA8 r, DATA8 g, DATA8 b)
305{
306 DATA8 *start, *end;
307
308 start = dst;
309 end = start + (size & ~7);
310
311 pld(src, 0);
312
313 while (start < end)
314 {
315 pld(src, 32);
316 UNROLL8(
317 {
318 _soft8_pt_blend_solid_solid_mul_color_transp
319 (start, *src, rel_alpha, r, g, b); start++; src++;}
320 );
321 }
322
323 end = start + (size & 7);
324 for (; start < end; start++, src++)
325 _soft8_pt_blend_solid_solid_mul_color_transp
326 (start, *src, rel_alpha, r, g, b);
327}
328
329/***********************************************************************
330 * Blend operations with extra multiply color
331 */
332EFL_ALWAYS_INLINE void
333_soft8_pt_blend_transp_solid_mul_color_solid(DATA8 * p_dst, DATA8 src,
334 DATA8 alpha, DATA8 r, DATA8 g,
335 DATA8 b)
336{
337 if (alpha == 0)
338 return;
339
340 DATA8 gry8 = (src * GRY_8_FROM_COMPONENTS(r, g, b)) >> 8;
341
342 if (alpha == 0xff)
343 *p_dst = gry8;
344 else
345 {
346 *p_dst = GRY_8_BLEND(gry8, *p_dst, alpha);
347 }
348}
349
350static void
351_soft8_scanline_blend_transp_solid_mul_color_solid(DATA8 * src, DATA8 * alpha,
352 DATA8 * dst, int size,
353 DATA8 r, DATA8 g, DATA8 b)
354{
355 DATA8 *start, *end;
356
357 start = dst;
358 end = start + (size & ~7);
359
360 pld(alpha, 0);
361 pld(src, 0);
362
363 while (start < end)
364 {
365 DATA8 alpha1, alpha2;
366
367 alpha1 = alpha[0];
368 alpha += 8;
369
370 pld(alpha, 8);
371 pld(src, 32);
372
373 src += 8;
374 start += 8;
375
376 alpha2 = alpha[-7];
377 _soft8_pt_blend_transp_solid_mul_color_solid
378 (start - 8, src[-8], alpha1, r, g, b);
379
380 alpha1 = alpha[-6];
381 _soft8_pt_blend_transp_solid_mul_color_solid
382 (start - 7, src[-7], alpha2, r, g, b);
383
384 alpha2 = alpha[-5];
385 _soft8_pt_blend_transp_solid_mul_color_solid
386 (start - 6, src[-6], alpha1, r, g, b);
387
388 alpha1 = alpha[-4];
389 _soft8_pt_blend_transp_solid_mul_color_solid
390 (start - 5, src[-5], alpha2, r, g, b);
391
392 alpha2 = alpha[-3];
393 _soft8_pt_blend_transp_solid_mul_color_solid
394 (start - 4, src[-4], alpha1, r, g, b);
395
396 alpha1 = alpha[-2];
397 _soft8_pt_blend_transp_solid_mul_color_solid
398 (start - 3, src[-3], alpha2, r, g, b);
399
400 alpha2 = alpha[-1];
401 _soft8_pt_blend_transp_solid_mul_color_solid
402 (start - 2, src[-2], alpha1, r, g, b);
403
404 _soft8_pt_blend_transp_solid_mul_color_solid
405 (start - 1, src[-1], alpha2, r, g, b);
406 }
407
408 end = start + (size & 7);
409 for (; start < end; start++, src++, alpha++)
410 _soft8_pt_blend_transp_solid_mul_color_solid
411 (start, *src, *alpha, r, g, b);
412}
413
414EFL_ALWAYS_INLINE void
415_soft8_pt_blend_solid_solid_mul_color_solid(DATA8 * p_dst, DATA8 src, DATA8 r,
416 DATA8 g, DATA8 b)
417{
418 *p_dst = (src * GRY_8_FROM_COMPONENTS(r, g, b)) >> 8;
419}
420
421static void
422_soft8_scanline_blend_solid_solid_mul_color_solid(DATA8 * src, DATA8 * dst,
423 int size, DATA8 r, DATA8 g,
424 DATA8 b)
425{
426 DATA8 *start, *end;
427
428 start = dst;
429 end = start + (size & ~7);
430
431 pld(src, 0);
432
433 while (start < end)
434 {
435 pld(src, 32);
436 UNROLL8(
437 {
438 _soft8_pt_blend_solid_solid_mul_color_solid(start, *src, r, g,
439 b); start++;
440 src++;}
441 );
442 }
443
444 end = start + (size & 7);
445 for (; start < end; start++, src++)
446 _soft8_pt_blend_solid_solid_mul_color_solid(start, *src, r, g, b);
447}
diff --git a/legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c b/legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c
deleted file mode 100644
index f1f3b8f629..0000000000
--- a/legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/** NOTE: This file is meant to be included by users **/
2
3/*****************************************************************************
4 * Point processing
5 *
6 * _soft8_pt_<description>_<src>_<dst>[_<modifier>]()
7 *
8 * Scanline processing
9 *
10 * _soft8_scanline_<description>_<src>_<dst>[_<modifier>]()
11 *
12 ****************************************************************************/
13EFL_ALWAYS_INLINE void
14_soft8_pt_fill_solid_solid(DATA8 * dst, DATA8 gry8)
15{
16 *dst = gry8;
17}
18
19EFL_ALWAYS_INLINE void
20_soft8_scanline_fill_solid_solid(DATA8 * dst, int size, DATA8 gry8)
21{
22 memset(dst, gry8, size);
23}
24
25EFL_ALWAYS_INLINE void
26_soft8_pt_fill_transp_solid(DATA8 * dst, DATA8 gry8, DATA8 alpha)
27{
28 *dst = GRY_8_BLEND(gry8, *dst, alpha);
29}
30
31static void
32_soft8_scanline_fill_transp_solid(DATA8 * dst, int size, DATA8 gry8,
33 DATA8 alpha)
34{
35 DATA8 *start, *end;
36
37 start = dst;
38 pld(start, 0);
39 end = start + (size & ~7);
40
41 while (start < end)
42 {
43 pld(start, 32);
44 UNROLL8(
45 {
46 _soft8_pt_fill_transp_solid(start, gry8, alpha); start++;}
47 );
48 }
49
50 end = start + (size & 7);
51 for (; start < end; start++)
52 _soft8_pt_fill_transp_solid(start, gry8, alpha);
53}
diff --git a/legacy/evas/src/modules/engines/Makefile.am b/legacy/evas/src/modules/engines/Makefile.am
index b6498f1b0a..9ae3168d5b 100644
--- a/legacy/evas/src/modules/engines/Makefile.am
+++ b/legacy/evas/src/modules/engines/Makefile.am
@@ -35,12 +35,6 @@ if !EVAS_STATIC_BUILD_GL_COCOA
35SUBDIRS += gl_cocoa 35SUBDIRS += gl_cocoa
36endif 36endif
37 37
38if !EVAS_STATIC_BUILD_SOFTWARE_8
39SUBDIRS += software_8
40endif
41if !EVAS_STATIC_BUILD_SOFTWARE_8_X11
42SUBDIRS += software_8_x11
43endif
44if !EVAS_STATIC_BUILD_SOFTWARE_DDRAW 38if !EVAS_STATIC_BUILD_SOFTWARE_DDRAW
45SUBDIRS += software_ddraw 39SUBDIRS += software_ddraw
46endif 40endif
diff --git a/legacy/evas/src/modules/engines/software_8/Makefile.am b/legacy/evas/src/modules/engines/software_8/Makefile.am
deleted file mode 100644
index d69505e743..0000000000
--- a/legacy/evas/src/modules/engines/software_8/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
1
2MAINTAINERCLEANFILES = Makefile.in
3
4AM_CPPFLAGS = \
5-I. \
6-I$(top_srcdir)/src/lib \
7-I$(top_srcdir)/src/lib/include \
8-I$(top_srcdir)/src/modules/engines \
9@FREETYPE_CFLAGS@ \
10@PIXMAN_CFLAGS@ \
11@FRIBIDI_CFLAGS@ \
12@EVAS_GENERAL_CFLAGS@
13
14if BUILD_ENGINE_SOFTWARE_8
15
16SOFTWARE_8_SOURCES = evas_engine.c
17
18
19if !EVAS_STATIC_BUILD_SOFTWARE_8_X11
20
21pkgdir = $(libdir)/evas/modules/engines/software_8/$(MODULE_ARCH)
22pkg_LTLIBRARIES = module.la
23module_la_SOURCES = $(SOFTWARE_8_SOURCES)
24module_la_LIBADD = @EVAS_GENERAL_LIBS@ $(top_builddir)/src/lib/libevas.la
25module_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -module -avoid-version
26module_la_LIBTOOLFLAGS = --tag=disable-static
27
28else
29
30noinst_LTLIBRARIES = libevas_engine_software_8.la
31
32libevas_engine_software_8_la_SOURCES = $(SOFTWARE_8_SOURCES)
33
34endif
35endif
36
37EXTRA_DIST = \
38evas_engine.c
diff --git a/legacy/evas/src/modules/engines/software_8/evas_engine.c b/legacy/evas/src/modules/engines/software_8/evas_engine.c
deleted file mode 100644
index 367dd5c5cb..0000000000
--- a/legacy/evas/src/modules/engines/software_8/evas_engine.c
+++ /dev/null
@@ -1,440 +0,0 @@
1#include "evas_common.h"
2#include "evas_common_soft8.h"
3
4/*
5 *****
6 **
7 ** ENGINE ROUTINES
8 **
9 *****
10 */
11int _evas_soft8_log_dom = -1;
12
13static Evas_Func func, pfunc;
14
15#ifdef ERR
16#undef ERR
17#endif
18#define ERR(...) EINA_LOG_DOM_ERR( _evas_soft8_log_dom, __VA_ARGS__)
19
20#ifdef DBG