aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/evas/src/lib/engines/common_8
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/evas/src/lib/engines/common_8')
-rw-r--r--libraries/evas/src/lib/engines/common_8/Makefile.am32
-rw-r--r--libraries/evas/src/lib/engines/common_8/Makefile.in696
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c100
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_font.c285
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c463
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c284
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_line.c426
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_main.c656
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_polygon.c230
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_rectangle.c125
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c447
-rw-r--r--libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c53
12 files changed, 3797 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/engines/common_8/Makefile.am b/libraries/evas/src/lib/engines/common_8/Makefile.am
new file mode 100644
index 0000000..58a1b1f
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/Makefile.am
@@ -0,0 +1,32 @@
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@EINA_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/libraries/evas/src/lib/engines/common_8/Makefile.in b/libraries/evas/src/lib/engines/common_8/Makefile.in
new file mode 100644
index 0000000..06c13de
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/Makefile.in
@@ -0,0 +1,696 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18VPATH = @srcdir@
19pkgdatadir = $(datadir)/@PACKAGE@
20pkgincludedir = $(includedir)/@PACKAGE@
21pkglibdir = $(libdir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37subdir = src/lib/engines/common_8
38DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
39ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
40am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
41 $(top_srcdir)/m4/efl_coverage.m4 \
42 $(top_srcdir)/m4/efl_doxygen.m4 \
43 $(top_srcdir)/m4/efl_fnmatch.m4 \
44 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
45 $(top_srcdir)/m4/evas_check_engine.m4 \
46 $(top_srcdir)/m4/evas_check_loader.m4 \
47 $(top_srcdir)/m4/evas_converter.m4 \
48 $(top_srcdir)/m4/evas_dither.m4 \
49 $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \
50 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
51 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
52 $(top_srcdir)/configure.ac
53am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
54 $(ACLOCAL_M4)
55mkinstalldirs = $(install_sh) -d
56CONFIG_HEADER = $(top_builddir)/config.h
57CONFIG_CLEAN_FILES =
58CONFIG_CLEAN_VPATH_FILES =
59LTLIBRARIES = $(noinst_LTLIBRARIES)
60libevas_engine_common_8_la_LIBADD =
61am_libevas_engine_common_8_la_OBJECTS = evas_soft8_dither_mask.lo \
62 evas_soft8_font.lo evas_soft8_image_unscaled.lo \
63 evas_soft8_main.lo evas_soft8_rectangle.lo evas_soft8_line.lo \
64 evas_soft8_polygon.lo evas_soft8_image_scaled_sampled.lo
65libevas_engine_common_8_la_OBJECTS = \
66 $(am_libevas_engine_common_8_la_OBJECTS)
67AM_V_lt = $(am__v_lt_$(V))
68am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
69am__v_lt_0 = --silent
70DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
71depcomp = $(SHELL) $(top_srcdir)/depcomp
72am__depfiles_maybe = depfiles
73am__mv = mv -f
74COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
75 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
76LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
77 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
78 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
79 $(AM_CFLAGS) $(CFLAGS)
80AM_V_CC = $(am__v_CC_$(V))
81am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
82am__v_CC_0 = @echo " CC " $@;
83AM_V_at = $(am__v_at_$(V))
84am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
85am__v_at_0 = @
86CCLD = $(CC)
87LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
88 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
89 $(AM_LDFLAGS) $(LDFLAGS) -o $@
90AM_V_CCLD = $(am__v_CCLD_$(V))
91am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
92am__v_CCLD_0 = @echo " CCLD " $@;
93AM_V_GEN = $(am__v_GEN_$(V))
94am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
95am__v_GEN_0 = @echo " GEN " $@;
96SOURCES = $(libevas_engine_common_8_la_SOURCES)
97DIST_SOURCES = $(libevas_engine_common_8_la_SOURCES)
98ETAGS = etags
99CTAGS = ctags
100DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
101ACLOCAL = @ACLOCAL@
102ALLOCA = @ALLOCA@
103AMTAR = @AMTAR@
104AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
105AR = @AR@
106AS = @AS@
107AUTOCONF = @AUTOCONF@
108AUTOHEADER = @AUTOHEADER@
109AUTOMAKE = @AUTOMAKE@
110AWK = @AWK@
111CC = @CC@
112CCDEPMODE = @CCDEPMODE@
113CFLAGS = @CFLAGS@
114CHECK_CFLAGS = @CHECK_CFLAGS@
115CHECK_LIBS = @CHECK_LIBS@
116CPP = @CPP@
117CPPFLAGS = @CPPFLAGS@
118CXX = @CXX@
119CXXCPP = @CXXCPP@
120CXXDEPMODE = @CXXDEPMODE@
121CXXFLAGS = @CXXFLAGS@
122CYGPATH_W = @CYGPATH_W@
123DEFS = @DEFS@
124DEPDIR = @DEPDIR@
125DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@
126DIRECTFB_LIBS = @DIRECTFB_LIBS@
127DLLTOOL = @DLLTOOL@
128DSYMUTIL = @DSYMUTIL@
129DUMPBIN = @DUMPBIN@
130ECHO_C = @ECHO_C@
131ECHO_N = @ECHO_N@
132ECHO_T = @ECHO_T@
133ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
134ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
135EDB_CFLAGS = @EDB_CFLAGS@
136EDB_LIBS = @EDB_LIBS@
137EDJE_CFLAGS = @EDJE_CFLAGS@
138EDJE_LIBS = @EDJE_LIBS@
139EET_CFLAGS = @EET_CFLAGS@
140EET_LIBS = @EET_LIBS@
141EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
142EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
143EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
144EGREP = @EGREP@
145EINA_CFLAGS = @EINA_CFLAGS@
146EINA_LIBS = @EINA_LIBS@
147EVAS_CFLAGS = @EVAS_CFLAGS@
148EVAS_LIBS = @EVAS_LIBS@
149EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@
150EVIL_CFLAGS = @EVIL_CFLAGS@
151EVIL_LIBS = @EVIL_LIBS@
152EXEEXT = @EXEEXT@
153FGREP = @FGREP@
154FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
155FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
156FREETYPE_CFLAGS = @FREETYPE_CFLAGS@
157FREETYPE_LIBS = @FREETYPE_LIBS@
158FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@
159FRIBIDI_LIBS = @FRIBIDI_LIBS@
160GL_EET_CFLAGS = @GL_EET_CFLAGS@
161GL_EET_LIBS = @GL_EET_LIBS@
162GREP = @GREP@
163HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@
164HARFBUZZ_LIBS = @HARFBUZZ_LIBS@
165INSTALL = @INSTALL@
166INSTALL_DATA = @INSTALL_DATA@
167INSTALL_PROGRAM = @INSTALL_PROGRAM@
168INSTALL_SCRIPT = @INSTALL_SCRIPT@
169INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
170LD = @LD@
171LDFLAGS = @LDFLAGS@
172LIBOBJS = @LIBOBJS@
173LIBS = @LIBS@
174LIBTOOL = @LIBTOOL@
175LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@
176LINEBREAK_LIBS = @LINEBREAK_LIBS@
177LIPO = @LIPO@
178LN_S = @LN_S@
179LTLIBOBJS = @LTLIBOBJS@
180MAKEINFO = @MAKEINFO@
181MKDIR_P = @MKDIR_P@
182MODULE_ARCH = @MODULE_ARCH@
183NM = @NM@
184NMEDIT = @NMEDIT@
185OBJC = @OBJC@
186OBJCDEPMODE = @OBJCDEPMODE@
187OBJCFLAGS = @OBJCFLAGS@
188OBJDUMP = @OBJDUMP@
189OBJEXT = @OBJEXT@
190OTOOL = @OTOOL@
191OTOOL64 = @OTOOL64@
192PACKAGE = @PACKAGE@
193PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
194PACKAGE_NAME = @PACKAGE_NAME@
195PACKAGE_STRING = @PACKAGE_STRING@
196PACKAGE_TARNAME = @PACKAGE_TARNAME@
197PACKAGE_URL = @PACKAGE_URL@
198PACKAGE_VERSION = @PACKAGE_VERSION@
199PATH_SEPARATOR = @PATH_SEPARATOR@
200PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
201PIXMAN_LIBS = @PIXMAN_LIBS@
202PKG_CONFIG = @PKG_CONFIG@
203PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
204PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
205PNG_CFLAGS = @PNG_CFLAGS@
206PNG_LIBS = @PNG_LIBS@
207RANLIB = @RANLIB@
208SDL_CFLAGS = @SDL_CFLAGS@
209SDL_LIBS = @SDL_LIBS@
210SED = @SED@
211SET_MAKE = @SET_MAKE@
212SHELL = @SHELL@
213SHM_OPEN_LINK = @SHM_OPEN_LINK@
214STRIP = @STRIP@
215SVG_CFLAGS = @SVG_CFLAGS@
216SVG_LIBS = @SVG_LIBS@
217VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
218VALGRIND_LIBS = @VALGRIND_LIBS@
219VERSION = @VERSION@
220VMAJ = @VMAJ@
221WIN32_CFLAGS = @WIN32_CFLAGS@
222WIN32_CPPFLAGS = @WIN32_CPPFLAGS@
223XCB_CFLAGS = @XCB_CFLAGS@
224XCB_GL_CFLAGS = @XCB_GL_CFLAGS@
225XCB_GL_LIBS = @XCB_GL_LIBS@
226XCB_LIBS = @XCB_LIBS@
227XEXT_CFLAGS = @XEXT_CFLAGS@
228XEXT_LIBS = @XEXT_LIBS@
229XMKMF = @XMKMF@
230X_CFLAGS = @X_CFLAGS@
231X_EXTRA_LIBS = @X_EXTRA_LIBS@
232X_LIBS = @X_LIBS@
233X_PRE_LIBS = @X_PRE_LIBS@
234abs_builddir = @abs_builddir@
235abs_srcdir = @abs_srcdir@
236abs_top_builddir = @abs_top_builddir@
237abs_top_srcdir = @abs_top_srcdir@
238ac_ct_CC = @ac_ct_CC@
239ac_ct_CXX = @ac_ct_CXX@
240ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
241ac_ct_OBJC = @ac_ct_OBJC@
242altivec_cflags = @altivec_cflags@
243am__include = @am__include@
244am__leading_dot = @am__leading_dot@
245am__quote = @am__quote@
246am__tar = @am__tar@
247am__untar = @am__untar@
248bindir = @bindir@
249build = @build@
250build_alias = @build_alias@
251build_cpu = @build_cpu@
252build_os = @build_os@
253build_vendor = @build_vendor@
254builddir = @builddir@
255datadir = @datadir@
256datarootdir = @datarootdir@
257dlopen_libs = @dlopen_libs@
258docdir = @docdir@
259dvidir = @dvidir@
260edje_cc = @edje_cc@
261efl_doxygen = @efl_doxygen@
262efl_have_doxygen = @efl_have_doxygen@
263evas_engine_buffer_cflags = @evas_engine_buffer_cflags@
264evas_engine_buffer_libs = @evas_engine_buffer_libs@
265evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@
266evas_engine_direct3d_libs = @evas_engine_direct3d_libs@
267evas_engine_directfb_cflags = @evas_engine_directfb_cflags@
268evas_engine_directfb_libs = @evas_engine_directfb_libs@
269evas_engine_fb_cflags = @evas_engine_fb_cflags@
270evas_engine_fb_libs = @evas_engine_fb_libs@
271evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@
272evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@
273evas_engine_gl_common_libs = @evas_engine_gl_common_libs@
274evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@
275evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@
276evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@
277evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@
278evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@
279evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@
280evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@
281evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@
282evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@
283evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@
284evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@
285evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@
286evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@
287evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@
288evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@
289evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@
290evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@
291evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@
292evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@
293evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@
294evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@
295evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@
296evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@
297evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@
298evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@
299evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@
300evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@
301evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@
302evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@
303evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@
304evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@
305evas_image_loader_edb_libs = @evas_image_loader_edb_libs@
306evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@
307evas_image_loader_eet_libs = @evas_image_loader_eet_libs@
308evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@
309evas_image_loader_generic_libs = @evas_image_loader_generic_libs@
310evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@
311evas_image_loader_gif_libs = @evas_image_loader_gif_libs@
312evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@
313evas_image_loader_ico_libs = @evas_image_loader_ico_libs@
314evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@
315evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@
316evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@
317evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@
318evas_image_loader_png_cflags = @evas_image_loader_png_cflags@
319evas_image_loader_png_libs = @evas_image_loader_png_libs@
320evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@
321evas_image_loader_psd_libs = @evas_image_loader_psd_libs@
322evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@
323evas_image_loader_svg_libs = @evas_image_loader_svg_libs@
324evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@
325evas_image_loader_tga_libs = @evas_image_loader_tga_libs@
326evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@
327evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@
328evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@
329evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@
330evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@
331evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@
332exec_prefix = @exec_prefix@
333have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@
334have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@
335have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@
336have_evas_engine_software_x11 = @have_evas_engine_software_x11@
337have_evas_engine_software_xcb = @have_evas_engine_software_xcb@
338have_evas_engine_software_xlib = @have_evas_engine_software_xlib@
339have_lcov = @have_lcov@
340host = @host@
341host_alias = @host_alias@
342host_cpu = @host_cpu@
343host_os = @host_os@
344host_vendor = @host_vendor@
345htmldir = @htmldir@
346includedir = @includedir@
347infodir = @infodir@
348install_sh = @install_sh@
349libdir = @libdir@
350libexecdir = @libexecdir@
351localedir = @localedir@
352localstatedir = @localstatedir@
353lt_ECHO = @lt_ECHO@
354lt_enable_auto_import = @lt_enable_auto_import@
355mandir = @mandir@
356mkdir_p = @mkdir_p@
357oldincludedir = @oldincludedir@
358pdfdir = @pdfdir@
359pkgconfig_requires_private = @pkgconfig_requires_private@
360prefix = @prefix@
361program_transform_name = @program_transform_name@
362psdir = @psdir@
363pthread_cflags = @pthread_cflags@
364pthread_libs = @pthread_libs@
365release_info = @release_info@
366requirement_evas = @requirement_evas@
367sbindir = @sbindir@
368sharedstatedir = @sharedstatedir@
369srcdir = @srcdir@
370sysconfdir = @sysconfdir@
371target_alias = @target_alias@
372top_build_prefix = @top_build_prefix@
373top_builddir = @top_builddir@
374top_srcdir = @top_srcdir@
375version_info = @version_info@
376MAINTAINERCLEANFILES = Makefile.in
377AM_CPPFLAGS = \
378-I. \
379-I$(top_srcdir)/src/lib \
380-I$(top_srcdir)/src/lib/include \
381@FREETYPE_CFLAGS@ \
382@PIXMAN_CFLAGS@ \
383@VALGRIND_CFLAGS@ \
384@EINA_CFLAGS@ \
385@EET_CFLAGS@ \
386@pthread_cflags@
387
388noinst_LTLIBRARIES = libevas_engine_common_8.la
389libevas_engine_common_8_la_SOURCES = \
390evas_soft8_dither_mask.c \
391evas_soft8_font.c \
392evas_soft8_image_unscaled.c \
393evas_soft8_main.c \
394evas_soft8_rectangle.c \
395evas_soft8_line.c \
396evas_soft8_polygon.c \
397evas_soft8_image_scaled_sampled.c
398
399libevas_engine_common_8_la_DEPENDENCIES = $(top_builddir)/config.h
400EXTRA_DIST = \
401evas_soft8_scanline_blend.c \
402evas_soft8_scanline_fill.c
403
404all: all-am
405
406.SUFFIXES:
407.SUFFIXES: .c .lo .o .obj
408$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
409 @for dep in $?; do \
410 case '$(am__configure_deps)' in \
411 *$$dep*) \
412 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
413 && { if test -f $@; then exit 0; else break; fi; }; \
414 exit 1;; \
415 esac; \
416 done; \
417 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/engines/common_8/Makefile'; \
418 $(am__cd) $(top_srcdir) && \
419 $(AUTOMAKE) --gnu src/lib/engines/common_8/Makefile
420.PRECIOUS: Makefile
421Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
422 @case '$?' in \
423 *config.status*) \
424 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
425 *) \
426 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
427 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
428 esac;
429
430$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
431 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
432
433$(top_srcdir)/configure: $(am__configure_deps)
434 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
435$(ACLOCAL_M4): $(am__aclocal_m4_deps)
436 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
437$(am__aclocal_m4_deps):
438
439clean-noinstLTLIBRARIES:
440 -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
441 @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
442 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
443 test "$$dir" != "$$p" || dir=.; \
444 echo "rm -f \"$${dir}/so_locations\""; \
445 rm -f "$${dir}/so_locations"; \
446 done
447libevas_engine_common_8.la: $(libevas_engine_common_8_la_OBJECTS) $(libevas_engine_common_8_la_DEPENDENCIES)
448 $(AM_V_CCLD)$(LINK) $(libevas_engine_common_8_la_OBJECTS) $(libevas_engine_common_8_la_LIBADD) $(LIBS)
449
450mostlyclean-compile:
451 -rm -f *.$(OBJEXT)
452
453distclean-compile:
454 -rm -f *.tab.c
455
456@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_dither_mask.Plo@am__quote@
457@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_font.Plo@am__quote@
458@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_image_scaled_sampled.Plo@am__quote@
459@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_image_unscaled.Plo@am__quote@
460@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_line.Plo@am__quote@
461@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_main.Plo@am__quote@
462@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_polygon.Plo@am__quote@
463@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_soft8_rectangle.Plo@am__quote@
464
465.c.o:
466@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
467@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
468@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
469@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
470@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
471@am__fastdepCC_FALSE@ $(COMPILE) -c $<
472
473.c.obj:
474@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
475@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
476@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
477@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
478@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
479@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
480
481.c.lo:
482@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
483@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
484@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
485@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
486@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
487@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
488
489mostlyclean-libtool:
490 -rm -f *.lo
491
492clean-libtool:
493 -rm -rf .libs _libs
494
495ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
496 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
497 unique=`for i in $$list; do \
498 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
499 done | \
500 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
501 END { if (nonempty) { for (i in files) print i; }; }'`; \
502 mkid -fID $$unique
503tags: TAGS
504
505TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
506 $(TAGS_FILES) $(LISP)
507 set x; \
508 here=`pwd`; \
509 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
510 unique=`for i in $$list; do \
511 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
512 done | \
513 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
514 END { if (nonempty) { for (i in files) print i; }; }'`; \
515 shift; \
516 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
517 test -n "$$unique" || unique=$$empty_fix; \
518 if test $$# -gt 0; then \
519 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
520 "$$@" $$unique; \
521 else \
522 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
523 $$unique; \
524 fi; \
525 fi
526ctags: CTAGS
527CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
528 $(TAGS_FILES) $(LISP)
529 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
530 unique=`for i in $$list; do \
531 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
532 done | \
533 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
534 END { if (nonempty) { for (i in files) print i; }; }'`; \
535 test -z "$(CTAGS_ARGS)$$unique" \
536 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
537 $$unique
538
539GTAGS:
540 here=`$(am__cd) $(top_builddir) && pwd` \
541 && $(am__cd) $(top_srcdir) \
542 && gtags -i $(GTAGS_ARGS) "$$here"
543
544distclean-tags:
545 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
546
547distdir: $(DISTFILES)
548 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
549 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
550 list='$(DISTFILES)'; \
551 dist_files=`for file in $$list; do echo $$file; done | \
552 sed -e "s|^$$srcdirstrip/||;t" \
553 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
554 case $$dist_files in \
555 */*) $(MKDIR_P) `echo "$$dist_files" | \
556 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
557 sort -u` ;; \
558 esac; \
559 for file in $$dist_files; do \
560 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
561 if test -d $$d/$$file; then \
562 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
563 if test -d "$(distdir)/$$file"; then \
564 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
565 fi; \
566 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
567 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
568 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
569 fi; \
570 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
571 else \
572 test -f "$(distdir)/$$file" \
573 || cp -p $$d/$$file "$(distdir)/$$file" \
574 || exit 1; \
575 fi; \
576 done
577check-am: all-am
578check: check-am
579all-am: Makefile $(LTLIBRARIES)
580installdirs:
581install: install-am
582install-exec: install-exec-am
583install-data: install-data-am
584uninstall: uninstall-am
585
586install-am: all-am
587 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
588
589installcheck: installcheck-am
590install-strip:
591 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
592 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
593 `test -z '$(STRIP)' || \
594 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
595mostlyclean-generic:
596
597clean-generic:
598
599distclean-generic:
600 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
601 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
602
603maintainer-clean-generic:
604 @echo "This command is intended for maintainers to use"
605 @echo "it deletes files that may require special tools to rebuild."
606 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
607clean: clean-am
608
609clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
610 mostlyclean-am
611
612distclean: distclean-am
613 -rm -rf ./$(DEPDIR)
614 -rm -f Makefile
615distclean-am: clean-am distclean-compile distclean-generic \
616 distclean-tags
617
618dvi: dvi-am
619
620dvi-am:
621
622html: html-am
623
624html-am:
625
626info: info-am
627
628info-am:
629
630install-data-am:
631
632install-dvi: install-dvi-am
633
634install-dvi-am:
635
636install-exec-am:
637
638install-html: install-html-am
639
640install-html-am:
641
642install-info: install-info-am
643
644install-info-am:
645
646install-man:
647
648install-pdf: install-pdf-am
649
650install-pdf-am:
651
652install-ps: install-ps-am
653
654install-ps-am:
655
656installcheck-am:
657
658maintainer-clean: maintainer-clean-am
659 -rm -rf ./$(DEPDIR)
660 -rm -f Makefile
661maintainer-clean-am: distclean-am maintainer-clean-generic
662
663mostlyclean: mostlyclean-am
664
665mostlyclean-am: mostlyclean-compile mostlyclean-generic \
666 mostlyclean-libtool
667
668pdf: pdf-am
669
670pdf-am:
671
672ps: ps-am
673
674ps-am:
675
676uninstall-am:
677
678.MAKE: install-am install-strip
679
680.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
681 clean-libtool clean-noinstLTLIBRARIES ctags distclean \
682 distclean-compile distclean-generic distclean-libtool \
683 distclean-tags distdir dvi dvi-am html html-am info info-am \
684 install install-am install-data install-data-am install-dvi \
685 install-dvi-am install-exec install-exec-am install-html \
686 install-html-am install-info install-info-am install-man \
687 install-pdf install-pdf-am install-ps install-ps-am \
688 install-strip installcheck installcheck-am installdirs \
689 maintainer-clean maintainer-clean-generic mostlyclean \
690 mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
691 pdf pdf-am ps ps-am tags uninstall uninstall-am
692
693
694# Tell versions [3.59,3.63) of GNU make to not export all variables.
695# Otherwise a system limit (for SysV at least) may be exceeded.
696.NOEXPORT:
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c
new file mode 100644
index 0000000..c1f3c14
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c
@@ -0,0 +1,100 @@
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/libraries/evas/src/lib/engines/common_8/evas_soft8_font.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_font.c
new file mode 100644
index 0000000..8f69b86
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_font.c
@@ -0,0 +1,285 @@
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/libraries/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c
new file mode 100644
index 0000000..7344263
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c
@@ -0,0 +1,463 @@
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/libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c
new file mode 100644
index 0000000..6f4e76b
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c
@@ -0,0 +1,284 @@
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/libraries/evas/src/lib/engines/common_8/evas_soft8_line.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_line.c
new file mode 100644
index 0000000..6ec2d22
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_line.c
@@ -0,0 +1,426 @@
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/libraries/evas/src/lib/engines/common_8/evas_soft8_main.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_main.c
new file mode 100644
index 0000000..cc4ce25
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_main.c
@@ -0,0 +1,656 @@
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 Eina_Rectangle sr, dr;
527 Cutout_Rects *rects;
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);
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 evas_common_draw_context_apply_clear_cutouts(rects);
580 dc->clip = clip_bkp;
581}
582
583EAPI Soft8_Image *
584evas_common_soft8_image_alpha_set(Soft8_Image * im, int have_alpha)
585{
586 Soft8_Image *new_im;
587
588 if (im->cache_entry.flags.alpha == have_alpha)
589 return im;
590
591 new_im = (Soft8_Image *) evas_cache_image_alone(&im->cache_entry);
592
593 new_im->cache_entry.flags.alpha = have_alpha;
594
595 if (im->cache_entry.w > 0 && im->cache_entry.h)
596 new_im =
597 (Soft8_Image *) evas_cache_image_size_set(&new_im->cache_entry,
598 im->cache_entry.w,
599 im->cache_entry.h);
600
601 return new_im;
602}
603
604/* Soft16_Image * */
605/* evas_common_soft16_image_size_set(Soft16_Image *old_im, unsigned int w, unsigned int h) */
606/* { */
607/* Soft16_Image *new_im; */
608/* DATA16 *dp, *sp; */
609/* int i, cw, ch, ew; */
610
611/* if ((old_im->cache_entry.w == w) && (old_im->cache_entry.h == h)) return old_im; */
612
613/* new_im = evas_common_soft16_image_new(w, h, -1, old_im->flags.have_alpha, NULL, 1); */
614
615/* if (old_im->cache_entry.w < new_im->cache_entry.w) */
616/* cw = old_im->cache_entry.w; */
617/* else */
618/* cw = new_im->cache_entry.w; */
619
620/* ew = new_im->cache_entry.w - cw; */
621
622/* if (old_im->cache_entry.h < new_im->cache_entry.h) */
623/* ch = old_im->cache_entry.h; */
624/* else */
625/* ch = new_im->cache_entry.h; */
626
627/* dp = new_im->pixels; */
628/* sp = old_im->pixels; */
629/* for (i = 0; i < ch; i++) */
630/* { */
631/* memcpy(dp, sp, cw * sizeof(DATA16)); */
632/* if (ew > 0) memset(dp, 0, ew * sizeof(DATA16)); */
633
634/* dp += new_im->stride; */
635/* sp += old_im->stride; */
636/* } */
637
638/* if (old_im->flags.have_alpha) */
639/* { */
640/* DATA8 *dp, *sp; */
641
642/* dp = new_im->alpha; */
643/* sp = old_im->alpha; */
644/* for (i = 0; i < ch; i++) */
645/* { */
646/* memcpy(dp, sp, cw * sizeof(DATA8)); */
647/* if (ew > 0) memset(dp, 0, ew * sizeof(DATA8)); */
648
649/* dp += new_im->stride; */
650/* sp += old_im->stride; */
651/* } */
652/* } */
653
654/* evas_cache_image_drop(&old_im->cache_entry); */
655/* return new_im; */
656/* } */
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_polygon.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_polygon.c
new file mode 100644
index 0000000..fb7027e
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_polygon.c
@@ -0,0 +1,230 @@
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/libraries/evas/src/lib/engines/common_8/evas_soft8_rectangle.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_rectangle.c
new file mode 100644
index 0000000..150f262
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_rectangle.c
@@ -0,0 +1,125 @@
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 Eina_Rectangle dr;
83 Cutout_Rects *rects;
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);
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 evas_common_draw_context_apply_clear_cutouts(rects);
124 dc->clip = c_bkp;
125}
diff --git a/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c
new file mode 100644
index 0000000..5fc62c2
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c
@@ -0,0 +1,447 @@
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/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c b/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c
new file mode 100644
index 0000000..f1f3b8f
--- /dev/null
+++ b/libraries/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c
@@ -0,0 +1,53 @@
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}