remove 8bpp engine too form evas.

SVN revision: 78026
devs/devilhorns/wayland_egl
Carsten Haitzler 10 years ago
parent bb90530f7b
commit 7e3479e2f8
  1. 4
      legacy/evas/ChangeLog
  2. 5
      legacy/evas/Makefile.am
  3. 2
      legacy/evas/NEWS
  4. 39
      legacy/evas/README
  5. 31
      legacy/evas/configure.ac
  6. 3
      legacy/evas/evas-software-8-x11.pc.in
  7. 14
      legacy/evas/src/lib/Makefile.am
  8. 4
      legacy/evas/src/lib/engines/Makefile.am
  9. 32
      legacy/evas/src/lib/engines/common_8/Makefile.am
  10. 100
      legacy/evas/src/lib/engines/common_8/evas_soft8_dither_mask.c
  11. 285
      legacy/evas/src/lib/engines/common_8/evas_soft8_font.c
  12. 463
      legacy/evas/src/lib/engines/common_8/evas_soft8_image_scaled_sampled.c
  13. 284
      legacy/evas/src/lib/engines/common_8/evas_soft8_image_unscaled.c
  14. 426
      legacy/evas/src/lib/engines/common_8/evas_soft8_line.c
  15. 655
      legacy/evas/src/lib/engines/common_8/evas_soft8_main.c
  16. 230
      legacy/evas/src/lib/engines/common_8/evas_soft8_polygon.c
  17. 124
      legacy/evas/src/lib/engines/common_8/evas_soft8_rectangle.c
  18. 447
      legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_blend.c
  19. 53
      legacy/evas/src/lib/engines/common_8/evas_soft8_scanline_fill.c
  20. 6
      legacy/evas/src/modules/engines/Makefile.am
  21. 38
      legacy/evas/src/modules/engines/software_8/Makefile.am
  22. 440
      legacy/evas/src/modules/engines/software_8/evas_engine.c
  23. 38
      legacy/evas/src/modules/engines/software_8_x11/Evas_Engine_Software_8_X11.h
  24. 49
      legacy/evas/src/modules/engines/software_8_x11/Makefile.am
  25. 700
      legacy/evas/src/modules/engines/software_8_x11/evas_engine.c
  26. 65
      legacy/evas/src/modules/engines/software_8_x11/evas_engine.h
  27. 243
      legacy/evas/src/modules/engines/software_8_x11/evas_x_buffer.c

@ -1099,3 +1099,7 @@
* Fix C code fallback line rendering path in software
2012-10-17 Carsten Haitzler (The Rasterman)
* Like 16bpp engine, 8bpp engine goes the way of the dodo.

@ -36,7 +36,6 @@ evas-opengl-x11.pc.in \
evas-opengl-sdl.pc.in \
evas-software-buffer.pc.in \
evas-software-x11.pc.in \
evas-software-8-x11.pc.in \
evas-software-gdi.pc.in \
evas-software-ddraw.pc.in \
evas-direct3d.pc.in \
@ -64,10 +63,6 @@ if BUILD_ENGINE_SOFTWARE_X11
pkgconfig_DATA += evas-software-x11.pc
endif
if BUILD_ENGINE_SOFTWARE_8_X11
pkgconfig_DATA += evas-software-8-x11.pc
endif
if BUILD_ENGINE_DIRECTFB
pkgconfig_DATA += evas-directfb.pc
endif

@ -29,6 +29,8 @@ Fixes:
Removal:
* No more support s3c6410.
* 16bpp engine removed.
* 8bpp engine removed.
Evas 1.7.0

@ -353,45 +353,6 @@ software-rendered with evas's default software rendering core.
opengl (and opengl-es2.0) rendering engine that uses sdl as the front
end interface. see --enable-gl-x11 etc. for information.
--enable-software-8-x11[=static]
8bit only rendering core. intended for greyscale output on things like
e-paper or simplistic greyscale LCD devices which have no color, such
as ebook readers.
if compiling with =static suffix, then must
"./configure --enable-static-software-8" as well.
--enable-software-16-x11[=static]
16bit specific renderer. lower quality than the default. also limited
in abilities (no support for smooth scale or transformations/map). in
a state of disrepair. do not use unless your hardware is just 16bpp
and very limited in CPU and memory.
if compiling with =static suffix, then must
"./configure --enable-static-software-16" as well.
--enable-software-16-ddraw[=static]
16bit renderer for direct-draw. same as software-16-x11 - don't use.
in disrepair.
if compiling with =static suffix, then must
"./configure --enable-static-software-16" as well.
--enable-software-16-wince[=static]
same as software-16-ddraw but for windows-ce. in disrepair. don't use.
if compiling with =static suffix, then must
"./configure --enable-static-software-16" as well.
------------------------------------------------------------------------------
CPU:
--enable-cpu-c

@ -98,7 +98,6 @@ want_evas_engine_software_xlib="no"
want_evas_engine_software_xcb="no"
want_evas_engine_software_gdi="no"
want_evas_engine_software_ddraw="no"
want_evas_engine_software_8_x11="no"
want_evas_engine_gl_xlib="no"
want_evas_engine_gl_xcb="no"
want_evas_engine_gl_sdl="no"
@ -140,8 +139,6 @@ case "$host_os" in
want_evas_engine_fb="auto"
want_evas_engine_wayland_shm="auto"
want_evas_engine_wayland_egl="auto"
### no - not ready/usable/complete
# want_evas_engine_software_8_x11="auto"
;;
esac
@ -619,7 +616,6 @@ EVAS_CHECK_ENGINE([gl-sdl], [${want_evas_engine_gl_sdl}], [no], [OpenGL SDL])
EVAS_CHECK_ENGINE([gl-cocoa], [${want_evas_engine_gl_cocoa}], [no], [OpenGL Cocoa])
EVAS_CHECK_ENGINE([fb], [${want_evas_engine_fb}], [no], [Framebuffer])
EVAS_CHECK_ENGINE([directfb], [${want_evas_engine_directfb}], [no], [DirectFB])
EVAS_CHECK_ENGINE([software-8-x11], [${want_evas_engine_software_8_x11}], [no], [Software X11 8 bits grayscale])
EVAS_CHECK_ENGINE([wayland-shm], [${want_evas_engine_wayland_shm}], [no], [Wayland Shm])
EVAS_CHECK_ENGINE([wayland-egl], [${want_evas_engine_wayland_egl}], [no], [Wayland Egl])
@ -815,28 +811,6 @@ if test "x$gl_flavor_gles" = "xyes"; then
[#include <SDL/SDL_video.h>])
fi
# if software 8 x11 is enabled - build software_8 (the generic 8bit
# engine).
have_evas_engine_software_8="no"
if test "x$have_evas_engine_software_8_x11" = "xyes" -o "x$have_evas_engine_software_8_x11" = "xstatic"; then
have_evas_engine_software_8="yes"
fi
AM_CONDITIONAL(BUILD_ENGINE_SOFTWARE_8, test "x$have_evas_engine_software_8" = "xyes")
# if software 8 need to be build as part of libevas.so
have_static_software_8="no"
AC_ARG_ENABLE([static-software-8],
[AC_HELP_STRING([--enable-static-software-8], [Build software 8 engine as part of libevas])],
[have_static_software_8=${enableval}]
)
AC_MSG_CHECKING([Whether to build software 8 engine as part of libevas])
AC_MSG_RESULT([${have_static_software_8}])
AM_CONDITIONAL(EVAS_STATIC_BUILD_SOFTWARE_8, test "x${have_static_software_8}" = "xyes")
if test "x${have_static_software_8}" = "xyes"; then
AC_DEFINE(EVAS_STATIC_BUILD_SOFTWARE_8, [1], [Build software 8 engine as part of libevas])
fi
#####################################################################
## Font Loaders
@ -1348,7 +1322,6 @@ evas-opengl-sdl.pc
evas-opengl-cocoa.pc
evas-software-buffer.pc
evas-software-x11.pc
evas-software-8-x11.pc
evas-software-gdi.pc
evas-software-ddraw.pc
evas-direct3d.pc
@ -1389,7 +1362,6 @@ src/lib/engines/common/evas_op_copy/Makefile
src/lib/engines/common/evas_op_mask/Makefile
src/lib/engines/common/evas_op_mul/Makefile
src/lib/engines/common/evas_op_sub/Makefile
src/lib/engines/common_8/Makefile
src/modules/Makefile
src/modules/engines/Makefile
src/modules/engines/software_generic/Makefile
@ -1405,8 +1377,6 @@ src/modules/engines/gl_x11/Makefile
src/modules/engines/gl_sdl/Makefile
src/modules/engines/gl_cocoa/Makefile
src/modules/engines/psl1ght/Makefile
src/modules/engines/software_8/Makefile
src/modules/engines/software_8_x11/Makefile
src/modules/engines/wayland_shm/Makefile
src/modules/engines/wayland_egl/Makefile
src/modules/loaders/Makefile
@ -1473,7 +1443,6 @@ echo " OpenGL Cocoa...............: $have_evas_engine_gl_cocoa"
echo " Software Framebuffer.......: $have_evas_engine_fb"
echo " DirectFB...................: $have_evas_engine_directfb"
echo " PSL1GHT....................: $have_evas_engine_psl1ght"
echo " Software 8bit grayscale....: $have_evas_engine_software_8"
echo " Wayland Shm................: $have_evas_engine_wayland_shm"
echo " Wayland Egl................: $have_evas_engine_wayland_egl"
echo

@ -1,3 +0,0 @@
Name: evas-software-8-x11
Description: Evas software X11 8bpp grayscale engine
Version: @VERSION@

@ -48,15 +48,6 @@ SUBDIRS += ../modules/engines/psl1ght/
EVAS_STATIC_MODULE += ../modules/engines/psl1ght/libevas_engine_psl1ght.la
EVAS_STATIC_LIBADD += @evas_engine_psl1ght_libs@
endif
if EVAS_STATIC_BUILD_SOFTWARE_8
SUBDIRS += ../modules/engines/software_8/
EVAS_STATIC_MODULE += ../modules/engines/software_8/libevas_engine_software_8.la
endif
if EVAS_STATIC_BUILD_SOFTWARE_8_X11
SUBDIRS += ../modules/engines/software_8_x11/
EVAS_STATIC_MODULE += ../modules/engines/software_8_x11/libevas_engine_software_8_x11.la
EVAS_STATIC_LIBADD += @evas_engine_software_8_x11_libs@
endif
if EVAS_STATIC_BUILD_SOFTWARE_DDRAW
SUBDIRS += ../modules/engines/software_ddraw/
EVAS_STATIC_MODULE += ../modules/engines/software_ddraw/libevas_engine_software_ddraw.la
@ -214,11 +205,6 @@ libevas_la_DEPENDENCIES += \
cache2/libevas_cache2.la
endif
if BUILD_ENGINE_SOFTWARE_8
libevas_la_LIBADD += engines/common_8/libevas_engine_common_8.la
libevas_la_DEPENDENCIES += engines/common_8/libevas_engine_common_8.la
endif
libevas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
### Evas_GL we are still using it in our code, so just don't install it.

@ -1,7 +1,3 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = common
if BUILD_ENGINE_SOFTWARE_8
SUBDIRS += common_8
endif

@ -1,32 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/lib \
-I$(top_srcdir)/src/lib/include \
@FREETYPE_CFLAGS@ \
@PIXMAN_CFLAGS@ \
@VALGRIND_CFLAGS@ \
@EVAS_GENERAL_CFLAGS@ \
@EET_CFLAGS@ \
@pthread_cflags@
noinst_LTLIBRARIES = libevas_engine_common_8.la
libevas_engine_common_8_la_SOURCES = \
evas_soft8_dither_mask.c \
evas_soft8_font.c \
evas_soft8_image_unscaled.c \
evas_soft8_main.c \
evas_soft8_rectangle.c \
evas_soft8_line.c \
evas_soft8_polygon.c \
evas_soft8_image_scaled_sampled.c
libevas_engine_common_8_la_DEPENDENCIES = $(top_builddir)/config.h
EXTRA_DIST = \
evas_soft8_scanline_blend.c \
evas_soft8_scanline_fill.c

@ -1,100 +0,0 @@
#include "evas_common_soft8.h"
EFL_ALWAYS_INLINE void
_soft8_convert_from_rgba_pt(const DATA32 * src, DATA8 * dst, DATA8 * alpha)
{
if (A_VAL(src) == 0)
{
*dst = 0;
*alpha = 0;
}
else
{
*dst = GRY_8_FROM_RGB(src);
*alpha = A_VAL(src);
}
}
static inline void
_soft8_convert_from_rgba_scanline(const DATA32 * src, DATA8 * dst,
DATA8 * alpha, const int w)
{
int x, m;
m = (w & ~7);
x = 0;
pld(src, 0);
while (x < m)
{
pld(src, 32);
UNROLL8(
{
_soft8_convert_from_rgba_pt(src, dst, alpha);
src++; dst++; alpha++; x++;}
);
}
for (; x < w; x++, src++, dst++, alpha++)
_soft8_convert_from_rgba_pt(src, dst, alpha);
}
void
evas_common_soft8_image_convert_from_rgba(Soft8_Image * im, const DATA32 * src)
{
const DATA32 *sp;
DATA8 *dp;
DATA8 *ap;
unsigned int y;
sp = src;
dp = im->pixels;
ap = im->alpha;
for (y = 0; y < im->cache_entry.h;
y++, sp += im->cache_entry.w, dp += im->stride, ap += im->stride)
_soft8_convert_from_rgba_scanline(sp, dp, ap, im->cache_entry.w);
}
EFL_ALWAYS_INLINE void
_soft8_convert_from_rgb_pt(const DATA32 * src, DATA8 * dst)
{
*dst = GRY_8_FROM_RGB(src);
}
static inline void
_soft8_convert_from_rgb_scanline(const DATA32 * src, DATA8 * dst, const int w)
{
int x, m;
m = (w & ~7);
x = 0;
pld(src, 0);
while (x < m)
{
pld(src, 32);
UNROLL8(
{
_soft8_convert_from_rgb_pt(src, dst); src++; dst++; x++;}
);
}
for (; x < w; x++, src++, dst++)
_soft8_convert_from_rgb_pt(src, dst);
}
void
evas_common_soft8_image_convert_from_rgb(Soft8_Image * im, const DATA32 * src)
{
const DATA32 *sp;
DATA8 *dp;
unsigned int y;
sp = src;
dp = im->pixels;
for (y = 0; y < im->cache_entry.h;
y++, sp += im->cache_entry.w, dp += im->stride)
_soft8_convert_from_rgb_scanline(sp, dp, im->cache_entry.w);
}

@ -1,285 +0,0 @@
#include "evas_common_soft8.h"
#include "evas_soft8_scanline_blend.c"
EFL_ALWAYS_INLINE void
_glyph_pt_mask_solid_solid(DATA8 * dst, const DATA8 gry8, const DATA8 * mask)
{
DATA8 alpha = *mask;
if (alpha == 0xff)
*dst = gry8;
else if (alpha > 0)
{
*dst = GRY_8_BLEND_UNMUL(gry8, *dst, alpha);
}
}
static void
_glyph_scanline_mask_solid_solid(DATA8 * dst,
int size, const DATA8 gry8, const DATA8 * mask)
{
DATA8 *start, *end;
start = dst;
pld(start, 0);
pld(mask, 0);
end = start + (size & ~3);
while (start < end)
{
pld(start, 8);
pld(mask, 4);
UNROLL4(
{
_glyph_pt_mask_solid_solid(start, gry8, mask);
start++; mask++;}
);
}
end = start + (size & 3);
for (; start < end; start++, mask++)
_glyph_pt_mask_solid_solid(start, gry8, mask);
}
EFL_ALWAYS_INLINE void
_glyph_pt_mask_transp_solid(DATA8 * dst,
DATA8 gry8, DATA8 alpha, const DATA8 * mask)
{
int rel_alpha;
rel_alpha = *mask;
alpha = (alpha * rel_alpha) >> 8;
if (alpha == 0)
return;
alpha++;
*dst = GRY_8_BLEND((gry8 * rel_alpha) >> 8, *dst, alpha);
}
static void
_glyph_scanline_mask_transp_solid(DATA8 * dst,
int size,
const DATA8 gry8,
const DATA8 rel_alpha, const DATA8 * mask)
{
DATA8 *start, *end;
start = dst;
pld(start, 0);
pld(mask, 0);
end = start + (size & ~3);
while (start < end)
{
pld(start, 8);
pld(mask, 4);
UNROLL4(
{
_glyph_pt_mask_transp_solid(start, gry8, rel_alpha, mask);
start++; mask++;}
);
}
end = start + (size & 3);
for (; start < end; start++, mask++)
_glyph_pt_mask_transp_solid(start, gry8, rel_alpha, mask);
}
static inline void
_calc_ext(const Soft8_Image * dst, const RGBA_Draw_Context * dc,
Eina_Rectangle * ext)
{
EINA_RECTANGLE_SET(ext, 0, 0, dst->cache_entry.w, dst->cache_entry.h);
if (dc->clip.use)
{
int v;
EINA_RECTANGLE_SET(ext, dc->clip.x, dc->clip.y, dc->clip.w, dc->clip.h);
if (ext->x < 0)
{
ext->w += ext->x;
ext->x = 0;
}
if (ext->y < 0)
{
ext->h += ext->y;
ext->y = 0;
}
v = dst->cache_entry.w - ext->x;
if (ext->w > v)
ext->w = v;
v = dst->cache_entry.h - ext->y;
if (ext->h > v)
ext->h = v;
}
}
static inline void
_glyph_scanline(Soft8_Image * dst, const DATA8 * p_mask,
const Eina_Rectangle ext, int dx, int dy, int max_x, int max_y,
int w, DATA8 alpha, const DATA8 gry8)
{
int size, in_x, in_w;
DATA8 *p_pixels;
if ((dx >= max_x) || (dy < ext.y) || (dy >= max_y))
return;
in_x = 0;
in_w = 0;
if (dx + w > max_x)
in_w += (dx + w) - max_x;
if (dx < ext.x)
{
in_w += ext.x - dx;
in_x = ext.x - dx;
dx = ext.x;
}
size = w - in_w;
p_pixels = dst->pixels + (dy * dst->stride) + dx;
p_mask += in_x;
if (size > 1)
{
if (alpha == 0xff)
_glyph_scanline_mask_solid_solid(p_pixels, size, gry8, p_mask);
else if (alpha != 0)
_glyph_scanline_mask_transp_solid
(p_pixels, size, gry8, alpha, p_mask);
}
else if (size == 1)
{
if (alpha == 0xff)
_glyph_pt_mask_solid_solid(p_pixels, gry8, p_mask);
else if (alpha != 0)
_glyph_pt_mask_transp_solid(p_pixels, gry8, alpha, p_mask);
}
}
static void
_soft8_font_glyph_draw_grayscale(Soft8_Image * dst,
RGBA_Draw_Context * dc __UNUSED__,
RGBA_Font_Glyph * fg __UNUSED__, int x, int y,
DATA8 alpha, DATA8 gry8,
const Eina_Rectangle ext, int bw, int bh,
int bpitch, const DATA8 * bitmap)
{
int i, max_x, max_y;
max_x = ext.x + ext.w;
max_y = ext.y + ext.h;
for (i = 0; i < bh; i++, bitmap += bpitch)
_glyph_scanline(dst, bitmap, ext, x, y + i, max_x, max_y, bw,
alpha, gry8);
}
static inline void
_glyph_create_mask_line(DATA8 * mask, const DATA8 * bitmap, int w)
{
const DATA8 bitrepl[2] = { 0x0, 0xff };
int i;
for (i = 0; i < w; i += 8, bitmap++)
{
int j, size;
DATA32 bits;
if (i + 8 < w)
size = 8;
else
size = w - i;
bits = *bitmap;
for (j = size - 1; j >= 0; j--, mask++)
*mask = bitrepl[(bits >> j) & 0x1];
}
}
static void
_soft8_font_glyph_draw_mono(Soft8_Image * dst,
RGBA_Draw_Context * dc __UNUSED__,
RGBA_Font_Glyph * fg __UNUSED__, int x, int y,
DATA8 alpha, DATA8 gry8, const Eina_Rectangle ext,
int bw, int bh, int bpitch, const DATA8 * bitmap)
{
DATA8 *mask;
int i, max_x, max_y;
max_x = ext.x + ext.w;
max_y = ext.y + ext.h;
mask = alloca(bpitch);
for (i = 0; i < bh; i++, bitmap += bpitch)
{
_glyph_create_mask_line(mask, bitmap, bw);
_glyph_scanline(dst, mask, ext, x, y + i, max_x, max_y, bw,
alpha, gry8);
}
}
void
evas_common_soft8_font_glyph_draw(void *data, void *dest __UNUSED__, void *context,
RGBA_Font_Glyph * fg, int x, int y)
{
Soft8_Image *dst;
RGBA_Draw_Context *dc;
const DATA8 *bitmap;
DATA8 alpha; // r, g, b
DATA8 gry8;
Eina_Rectangle ext;
int bpitch, bw, bh;
dst = data;
dc = context;
alpha = A_VAL(&dc->col.col);
if (alpha == 0)
return;
gry8 = GRY_8_FROM_RGB(&dc->col.col);
/*
* if (r > alpha) r = alpha;
* if (g > alpha) g = alpha;
* if (b > alpha) b = alpha;
*
* gry8 = GRY_8_FROM_COMPONENTS(r, g, b);
*/
bitmap = fg->glyph_out->bitmap.buffer;
bh = fg->glyph_out->bitmap.rows;
bw = fg->glyph_out->bitmap.width;
bpitch = fg->glyph_out->bitmap.pitch;
if (bpitch < bw)
bpitch = bw;
_calc_ext(dst, dc, &ext);
if ((fg->glyph_out->bitmap.num_grays == 256) &&
(fg->glyph_out->bitmap.pixel_mode == ft_pixel_mode_grays))
_soft8_font_glyph_draw_grayscale(dst, dc, fg, x, y, alpha, gry8,
ext, bw, bh, bpitch, bitmap);
else
_soft8_font_glyph_draw_mono(dst, dc, fg, x, y, alpha, gry8,
ext, bw, bh, bpitch, bitmap);
}
void *
evas_common_soft8_font_glyph_new(void *data __UNUSED__, RGBA_Font_Glyph * fg __UNUSED__)
{
return (void *)1; /* core requires != NULL to work */
}
void
evas_common_soft8_font_glyph_free(void *ext_dat __UNUSED__)
{
}

@ -1,463 +0,0 @@
#include "evas_common_soft8.h"
#include "evas_soft8_scanline_blend.c"
static void
_soft8_image_draw_scaled_solid_solid(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context * dc __UNUSED__,
int dst_offset, int w, int h,
int *offset_x, int *offset_y)
{
DATA8 *dst_itr;
int y, w_align;
w_align = w & ~7;
dst_itr = dst->pixels + dst_offset;
for (y = 0; y < h; y++, dst_itr += dst->stride)
{
DATA8 *d, *s;
int x;
s = src->pixels + offset_y[y];
pld(s, 0);
pld(offset_x, 0);
d = dst_itr;
x = 0;
while (x < w_align)
{
pld(s, 32);
pld(offset_x + x, 32);
UNROLL8(
{
_soft8_pt_blend_solid_solid(d, s[offset_x[x]]); x++; d++;}
);
}
for (; x < w; x++, d++)
_soft8_pt_blend_solid_solid(d, s[offset_x[x]]);
}
}
static void
_soft8_image_draw_scaled_transp_solid(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context * dc __UNUSED__,
int dst_offset, int w, int h,
int *offset_x, int *offset_y)
{
DATA8 *dst_itr;
int y, w_align;
w_align = w & ~7;
dst_itr = dst->pixels + dst_offset;
for (y = 0; y < h; y++, dst_itr += dst->stride)
{
DATA8 *d, *s;
DATA8 *a;
int x;
s = src->pixels + offset_y[y];
a = src->alpha + offset_y[y];
pld(s, 0);
pld(a, 0);
pld(offset_x, 0);
d = dst_itr;
x = 0;
while (x < w_align)
{
pld(s, 32);
pld(a, 8);
pld(offset_x + x, 32);
UNROLL8(
{
int off_x = offset_x[x];
_soft8_pt_blend_transp_solid(d, s[off_x], a[off_x]);
x++; d++;});
}
for (; x < w; x++, d++)
_soft8_pt_blend_transp_solid(d, s[offset_x[x]], a[offset_x[x]]);
}
}
static inline void
_soft8_image_draw_scaled_no_mul(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc,
int dst_offset, int w, int h,
int *offset_x, int *offset_y)
{
if ((src->cache_entry.flags.alpha && src->alpha) &&
(!dst->cache_entry.flags.alpha))
_soft8_image_draw_scaled_transp_solid
(src, dst, dc, dst_offset, w, h, offset_x, offset_y);
else if (!dst->cache_entry.flags.alpha)
_soft8_image_draw_scaled_solid_solid
(src, dst, dc, dst_offset, w, h, offset_x, offset_y);
else
ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
}
static void
_soft8_image_draw_scaled_solid_solid_mul_alpha(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context *
dc __UNUSED__, int dst_offset,
int w, int h, int *offset_x,
int *offset_y, DATA8 alpha)
{
DATA8 *dst_itr;
int y, w_align;
w_align = w & ~7;
dst_itr = dst->pixels + dst_offset;
for (y = 0; y < h; y++, dst_itr += dst->stride)
{
DATA8 *d, *s;
int x;
s = src->pixels + offset_y[y];
pld(s, 0);
pld(offset_x, 0);
d = dst_itr;
x = 0;
while (x < w_align)
{
pld(s, 32);
pld(offset_x + x, 32);
UNROLL8(
{
_soft8_pt_blend_solid_solid_mul_alpha
(d, s[offset_x[x]], alpha); x++; d++;}
);
}
for (; x < w; x++, d++)
_soft8_pt_blend_solid_solid_mul_alpha(d, s[offset_x[x]], alpha);
}
}
static void
_soft8_image_draw_scaled_transp_solid_mul_alpha(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context *
dc __UNUSED__, int dst_offset,
int w, int h, int *offset_x,
int *offset_y, DATA8 alpha)
{
DATA8 *dst_itr;
int y, w_align;
w_align = w & ~7;
dst_itr = dst->pixels + dst_offset;
for (y = 0; y < h; y++, dst_itr += dst->stride)
{
DATA8 *d, *s;
DATA8 *a;
int x;
s = src->pixels + offset_y[y];
a = src->alpha + offset_y[y];
pld(s, 0);
pld(a, 0);
pld(offset_x, 0);
d = dst_itr;
x = 0;
while (x < w_align)
{
pld(s, 32);
pld(a, 8);
pld(offset_x + x, 32);
UNROLL8(
{
int off_x = offset_x[x];
_soft8_pt_blend_transp_solid_mul_alpha
(d, s[off_x], a[off_x], alpha); x++; d++;});
}
for (; x < w; x++, d++)
_soft8_pt_blend_transp_solid_mul_alpha
(d, s[offset_x[x]], a[offset_x[x]], alpha);
}
}
static inline void
_soft8_image_draw_scaled_mul_alpha(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc,
int dst_offset, int w, int h,
int *offset_x, int *offset_y, DATA8 a)
{
if ((src->cache_entry.flags.alpha && src->alpha) &&
(!dst->cache_entry.flags.alpha))
_soft8_image_draw_scaled_transp_solid_mul_alpha
(src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
else if (!dst->cache_entry.flags.alpha)
_soft8_image_draw_scaled_solid_solid_mul_alpha
(src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
else
ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha,
A_VAL(&dc->mul.col));
}
static void
_soft8_image_draw_scaled_solid_solid_mul_color(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context *
dc __UNUSED__, int dst_offset,
int w, int h, int *offset_x,
int *offset_y, DATA8 r, DATA8 g,
DATA8 b, DATA8 alpha)
{
DATA8 *dst_itr;
int y, w_align;
w_align = w & ~7;
dst_itr = dst->pixels + dst_offset;
if (alpha == 0xff)
for (y = 0; y < h; y++, dst_itr += dst->stride)
{
DATA8 *d, *s;
int x;
s = src->pixels + offset_y[y];
pld(s, 0);
pld(offset_x, 0);
d = dst_itr;
x = 0;
while (x < w_align)
{
pld(s, 32);
pld(offset_x + x, 32);
UNROLL8(
{
_soft8_pt_blend_solid_solid_mul_color_solid
(d, s[offset_x[x]], r, g, b); x++; d++;}
);
}
for (; x < w; x++, d++)
_soft8_pt_blend_solid_solid_mul_color_solid
(d, s[offset_x[x]], r, g, b);
}
else
for (y = 0; y < h; y++, dst_itr += dst->stride)
{
DATA8 *d, *s;
int x;
s = src->pixels + offset_y[y];
pld(s, 0);
pld(offset_x, 0);
d = dst_itr;
x = 0;
while (x < w_align)
{
pld(s, 32);
pld(offset_x + x, 32);
UNROLL8(
{
_soft8_pt_blend_solid_solid_mul_color_transp
(d, s[offset_x[x]], alpha, r, g, b); x++; d++;}
);
}
for (; x < w; x++, d++)
_soft8_pt_blend_solid_solid_mul_color_transp
(d, s[offset_x[x]], alpha, r, g, b);
}
}
static void
_soft8_image_draw_scaled_transp_solid_mul_color(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context *
dc __UNUSED__, int dst_offset,
int w, int h, int *offset_x,
int *offset_y, DATA8 r, DATA8 g,
DATA8 b, DATA8 alpha)
{
DATA8 *dst_itr;
int y, w_align;
w_align = w & ~7;
dst_itr = dst->pixels + dst_offset;
if (alpha == 0xff)
for (y = 0; y < h; y++, dst_itr += dst->stride)
{
DATA8 *d, *s;
DATA8 *a;
int x;
s = src->pixels + offset_y[y];
a = src->alpha + offset_y[y];
pld(s, 0);
pld(a, 0);
pld(offset_x, 0);
d = dst_itr;
x = 0;
while (x < w_align)
{
pld(s, 32);
pld(a, 8);
pld(offset_x + x, 32);
UNROLL8(
{
int off_x = offset_x[x];
_soft8_pt_blend_transp_solid_mul_color_solid
(d, s[off_x], a[off_x], r, g, b); x++; d++;});
}
for (; x < w; x++, d++)
_soft8_pt_blend_transp_solid_mul_color_solid
(d, s[offset_x[x]], a[offset_x[x]], r, g, b);
}
else
for (y = 0; y < h; y++, dst_itr += dst->stride)
{
DATA8 *d, *s;
DATA8 *a;
int x;
s = src->pixels + offset_y[y];
a = src->alpha + offset_y[y];
pld(s, 0);
pld(a, 0);
pld(offset_x, 0);
d = dst_itr;
x = 0;
while (x < w_align)
{
pld(s, 32);
pld(a, 8);
pld(offset_x + x, 32);
UNROLL8(
{
int off_x = offset_x[x];
_soft8_pt_blend_transp_solid_mul_color_transp
(d, s[off_x], a[off_x], alpha, r, g, b); x++; d++;});
}
for (; x < w; x++, d++)
_soft8_pt_blend_transp_solid_mul_color_transp
(d, s[offset_x[x]], a[offset_x[x]], alpha, r, g, b);
}
}
static inline void
_soft8_image_draw_scaled_mul_color(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc,
int dst_offset, int w, int h,
int *offset_x, int *offset_y,
DATA8 r, DATA8 g, DATA8 b, DATA8 a)
{
if ((src->cache_entry.flags.alpha && src->alpha) &&
(!dst->cache_entry.flags.alpha))
_soft8_image_draw_scaled_transp_solid_mul_color
(src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
else if (!dst->cache_entry.flags.alpha)
_soft8_image_draw_scaled_solid_solid_mul_color
(src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
else
ERR("Unsupported draw of scaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH COLOR MUL 0x%08x",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha,
dc->mul.col);
}
static inline void
_soft8_image_draw_scaled_mul(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc,
int dst_offset, int w, int h,
int *offset_x, int *offset_y, DATA8 r, DATA8 g,
DATA8 b, DATA8 a)
{
if ((a == r) && (a == g) && (a == b))
_soft8_image_draw_scaled_mul_alpha
(src, dst, dc, dst_offset, w, h, offset_x, offset_y, a);
else
_soft8_image_draw_scaled_mul_color
(src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a);
}
void
evas_common_soft8_image_draw_scaled_sampled(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc,
const Eina_Rectangle sr,
const Eina_Rectangle dr,
const Eina_Rectangle cr)
{
int x, y, dst_offset, *offset_x, *offset_y;
DATA8 mul_gry8;
DATA8 r, g, b, a;
if (!dc->mul.use)
{
r = g = b = a = 0xff;
mul_gry8 = 0xff;
}
else
{
a = A_VAL(&dc->mul.col);
if (a == 0)
return;
r = R_VAL(&dc->mul.col);
g = G_VAL(&dc->mul.col);
b = B_VAL(&dc->mul.col);
if (r > a)
r = a;
if (g > a)
g = a;
if (b > a)
b = a;
mul_gry8 = GRY_8_FROM_COMPONENTS(r, g, b);
}
/* pre-calculated scale tables */
offset_x = alloca(cr.w * sizeof(*offset_x));
for (x = 0; x < cr.w; x++)
offset_x[x] = (((x + cr.x - dr.x) * sr.w) / dr.w) + sr.x;
offset_y = alloca(cr.h * sizeof(*offset_y));
for (y = 0; y < cr.h; y++)
offset_y[y] = (((((y + cr.y - dr.y) * sr.h) / dr.h) + sr.y)
* src->stride);
dst_offset = cr.x + (cr.y * dst->stride);
if (mul_gry8 == 0xff)
_soft8_image_draw_scaled_no_mul
(src, dst, dc, dst_offset, cr.w, cr.h, offset_x, offset_y);
else
_soft8_image_draw_scaled_mul
(src, dst, dc, dst_offset, cr.w, cr.h, offset_x, offset_y, r, g, b,
a);
}

@ -1,284 +0,0 @@
#include "evas_common_soft8.h"
#include "evas_soft8_scanline_blend.c"
static void
_soft8_image_draw_unscaled_solid_solid(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc __UNUSED__,
int src_offset, int dst_offset,
int w, int h)
{
DATA8 *src_itr, *dst_itr;
int y;
src_itr = src->pixels + src_offset;
dst_itr = dst->pixels + dst_offset;
for (y = 0; y < h; y++)
{
_soft8_scanline_blend_solid_solid(src_itr, dst_itr, w);
src_itr += src->stride;
dst_itr += dst->stride;
}
}
static void
_soft8_image_draw_unscaled_transp_solid(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc __UNUSED__,
int src_offset, int dst_offset,
int w, int h)
{
DATA8 *src_itr, *dst_itr;
DATA8 *alpha_itr;
int y;
src_itr = src->pixels + src_offset;
alpha_itr = src->alpha + src_offset;
dst_itr = dst->pixels + dst_offset;
for (y = 0; y < h; y++)
{
_soft8_scanline_blend_transp_solid(src_itr, alpha_itr, dst_itr, w);
src_itr += src->stride;
alpha_itr += src->stride;
dst_itr += dst->stride;
}
}
static inline void
_soft8_image_draw_unscaled_no_mul(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc,
int src_offset, int dst_offset,
int width, int height)
{
if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
_soft8_image_draw_unscaled_transp_solid(src, dst, dc,
src_offset, dst_offset,
width, height);
else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
_soft8_image_draw_unscaled_solid_solid(src, dst, dc,
src_offset, dst_offset,
width, height);
else
ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITHOUT COLOR MUL",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha);
}
static void
_soft8_image_draw_unscaled_solid_solid_mul_alpha(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context *
dc __UNUSED__, int src_offset,
int dst_offset, int w, int h,
DATA8 a)
{
DATA8 *src_itr, *dst_itr;
int y;
src_itr = src->pixels + src_offset;
dst_itr = dst->pixels + dst_offset;
for (y = 0; y < h; y++)
{
_soft8_scanline_blend_solid_solid_mul_alpha(src_itr, dst_itr, w, a);
src_itr += src->stride;
dst_itr += dst->stride;
}
}
static void
_soft8_image_draw_unscaled_transp_solid_mul_alpha(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context *
dc __UNUSED__, int src_offset,
int dst_offset, int w, int h,
DATA8 a)
{
DATA8 *src_itr, *dst_itr;
DATA8 *alpha_itr;
int y;
src_itr = src->pixels + src_offset;
alpha_itr = src->alpha + src_offset;
dst_itr = dst->pixels + dst_offset;
for (y = 0; y < h; y++)
{
_soft8_scanline_blend_transp_solid_mul_alpha(src_itr, alpha_itr,
dst_itr, w, a);
src_itr += src->stride;
alpha_itr += src->stride;
dst_itr += dst->stride;
}
}
static inline void
_soft8_image_draw_unscaled_mul_alpha(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc,
int src_offset, int dst_offset,
int width, int height, DATA8 a)
{
if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
_soft8_image_draw_unscaled_transp_solid_mul_alpha
(src, dst, dc, src_offset, dst_offset, width, height, a);
else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
_soft8_image_draw_unscaled_solid_solid_mul_alpha
(src, dst, dc, src_offset, dst_offset, width, height, a);
else
ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "
"dst->cache_entry.flags.alpha=%d, WITH ALPHA MUL %d",
src->cache_entry.flags.alpha, dst->cache_entry.flags.alpha, A_VAL(&dc->mul.col));
}
static void
_soft8_image_draw_unscaled_solid_solid_mul_color(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context *
dc __UNUSED__, int src_offset,
int dst_offset, int w, int h,
DATA8 r, DATA8 g, DATA8 b,
DATA8 a)
{
DATA8 *src_itr, *dst_itr;
int y;
src_itr = src->pixels + src_offset;
dst_itr = dst->pixels + dst_offset;
if (a == 0xff)
for (y = 0; y < h; y++)
{
_soft8_scanline_blend_solid_solid_mul_color_solid
(src_itr, dst_itr, w, r, g, b);
src_itr += src->stride;
dst_itr += dst->stride;
}
else
for (y = 0; y < h; y++)
{
_soft8_scanline_blend_solid_solid_mul_color_transp
(src_itr, dst_itr, w, a, r, g, b);
src_itr += src->stride;
dst_itr += dst->stride;
}
}
static void
_soft8_image_draw_unscaled_transp_solid_mul_color(Soft8_Image * src,
Soft8_Image * dst,
RGBA_Draw_Context *
dc __UNUSED__, int src_offset,
int dst_offset, int w, int h,
DATA8 r, DATA8 g, DATA8 b,
DATA8 a)
{
DATA8 *src_itr, *dst_itr;
DATA8 *alpha_itr;
int y;
src_itr = src->pixels + src_offset;
alpha_itr = src->alpha + src_offset;
dst_itr = dst->pixels + dst_offset;
if (a == 0xff)
for (y = 0; y < h; y++)
{
_soft8_scanline_blend_transp_solid_mul_color_solid
(src_itr, alpha_itr, dst_itr, w, r, g, b);
src_itr += src->stride;
alpha_itr += src->stride;
dst_itr += dst->stride;
}
else
for (y = 0; y < h; y++)
{
_soft8_scanline_blend_transp_solid_mul_color_transp
(src_itr, alpha_itr, dst_itr, w, a, r, g, b);
src_itr += src->stride;
alpha_itr += src->stride;
dst_itr += dst->stride;
}
}
static inline void
_soft8_image_draw_unscaled_mul_color(Soft8_Image * src, Soft8_Image * dst,
RGBA_Draw_Context * dc,
int src_offset, int dst_offset,
int width, int height,
DATA8 r, DATA8 g, DATA8 b, DATA8 a)
{
if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha))
_soft8_image_draw_unscaled_transp_solid_mul_color
(src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha))
_soft8_image_draw_unscaled_solid_solid_mul_color
(src, dst, dc, src_offset, dst_offset, width, height, r, g, b, a);
else
ERR("Unsupported draw of unscaled images src->cache_entry.flags.alpha=%d, "