forked from old/legacy-imlib2
better asm detection - there's an --enable-mmx now too if you want to
force or disable the feature by force... it will try autodetect under linux but only on the build machine... SVN revision: 2546
This commit is contained in:
parent
ed923261d4
commit
cc8e9b0183
2
README
2
README
|
@ -9,7 +9,7 @@ as well as rendering, manipulation etc. It also does ALL of these FAST and
|
|||
tries to be highly intelligent about doing it to make writing niaeve programs
|
||||
that are still very fast.
|
||||
|
||||
This is an early stage of its release and thus is Imlib2 0.0.1 - there are
|
||||
This is an early stage of its release and thus is Imlib2 0.0.4 - there are
|
||||
bugs that have to be worked out - primarily ones that might deal with network
|
||||
rendering, endianess and the lack of loaders.
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
/* Define if you have the <freetype/freetype.h> header file. */
|
||||
#undef HAVE_FREETYPE_FREETYPE_H
|
||||
|
||||
/* Pentium II/III and up detected - enabling ASM */
|
||||
/* enabling MMX Assembly */
|
||||
#undef DO_MMX_ASM
|
||||
|
||||
/* Name of package */
|
||||
|
|
29
configure.in
29
configure.in
|
@ -3,10 +3,33 @@ dnl Process this file with autoconf to create configure.
|
|||
AC_INIT(src/Imlib2.h)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AC_CANONICAL_SYSTEM
|
||||
if test x$target_cpu = xi686; then
|
||||
AC_DEFINE(DO_MMX_ASM, 1, [Pentium II/III and up detected - enabling ASM])
|
||||
mmx=no
|
||||
AC_ARG_ENABLE(mmx, "Enables building of MMX assembly routines",
|
||||
[
|
||||
echo "*****************YESYESYESYESYESYES****************"
|
||||
if test x$enableval = xyes; then
|
||||
mmx=yes
|
||||
fi
|
||||
],
|
||||
[
|
||||
echo "*****************NOT****************"
|
||||
if test x$target_os = xlinux-gnu; then
|
||||
mmx=`cat /proc/cpuinfo | grep mmx`
|
||||
if test -n "$mmx"; then
|
||||
mmx=yes
|
||||
fi
|
||||
else
|
||||
echo "You are not running Linux - This script cannot auto-detect mmx assembly."
|
||||
echo "You will have to ebnalbe the mmx assembly (which gives anywhere from 10%"
|
||||
echo "to 300% speedups) by adding --enable-mmx on the configure command-line."
|
||||
fi
|
||||
AM_INIT_AUTOMAKE(imlib2, 0.0.3)
|
||||
]
|
||||
)
|
||||
if test x$mmx = xyes; then
|
||||
AC_DEFINE(DO_MMX_ASM, 1, [enabling MMX Assembly])
|
||||
fi
|
||||
|
||||
AM_INIT_AUTOMAKE(imlib2, 0.0.4)
|
||||
|
||||
pkglibdir='${libdir}'/loaders
|
||||
AC_SUBST(pkglibdir)
|
||||
|
|
|
@ -24,7 +24,7 @@ libImlib2_la_SOURCES = rend.c ximage.c scale.c rgba.c image.c color.c grab.c \
|
|||
libImlib2_la_LIBADD = @DLLDFLAGS@ $(top_builddir)/libltdl/libltdlc.la \
|
||||
-lX11 -lXext -lttf $(LDFLAGS)
|
||||
libImlib2_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
libImlib2_la_LDFLAGS = -version-info 0:3:0
|
||||
libImlib2_la_LDFLAGS = -version-info 0:4:0
|
||||
|
||||
SYS_LOADERS_PATH = @pkglibdir@
|
||||
image.lo: loaderpath.h
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#ifdef DO_MMX_ASM
|
||||
|
||||
/*\
|
||||
|*| MMX assembly rotation routine for Imlib2
|
||||
|*| Written by Willem Monsuwe <willem@stack.nl>
|
||||
|
@ -39,8 +41,6 @@
|
|||
#define m0fff -28(%ebp)
|
||||
#define mulsow -32(%ebp)
|
||||
|
||||
#ifdef DO_MMX_ASM
|
||||
|
||||
__imlib_mmx_RotateAA:
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include <config.h>
|
||||
|
||||
#ifdef DO_MMX_ASM
|
||||
|
||||
/*\
|
||||
|*| MMX assembly scaling routine for Imlib2
|
||||
|*| Written by Willem Monsuwe <willem@stack.nl>
|
||||
|
@ -46,8 +48,6 @@
|
|||
#define yapoints 12(%edx)
|
||||
#define xup_yup 16(%edx)
|
||||
|
||||
#ifdef DO_MMX_ASM
|
||||
|
||||
__imlib_Scale_mmx_AARGBA:
|
||||
pushl %ebp
|
||||
movl %esp, %ebp
|
||||
|
|
26
test/main.c
26
test/main.c
|
@ -184,6 +184,8 @@ int main (int argc, char **argv)
|
|||
{
|
||||
if (scaleup)
|
||||
XResizeWindow(disp, win, w * 4, h * 4);
|
||||
else if (scaleboth)
|
||||
XResizeWindow(disp, win, w * 2, h * 2);
|
||||
else
|
||||
XResizeWindow(disp, win, w, h);
|
||||
XMapWindow(disp, win);
|
||||
|
@ -352,7 +354,29 @@ int main (int argc, char **argv)
|
|||
}
|
||||
imlib_context_set_image(im);
|
||||
}
|
||||
pixels += (w - i) * (((w - i) * h) / w);
|
||||
pixels += (w + i) * (((w + i) * h) / w);
|
||||
}
|
||||
}
|
||||
else if (scaleboth)
|
||||
{
|
||||
for (i = 0; i < w * 2; i+= 1)
|
||||
{
|
||||
if (!blendtest)
|
||||
imlib_render_image_on_drawable_at_size(0, 0,
|
||||
2 * w - i, (((i) * h) / w));
|
||||
else
|
||||
{
|
||||
Imlib_Image im_tmp;
|
||||
im_tmp = imlib_create_cropped_scaled_image(0, 0, w, h,
|
||||
2 * w - i, (((i) * h) / w));
|
||||
if (im_tmp)
|
||||
{
|
||||
imlib_context_set_image(im_tmp);
|
||||
imlib_free_image();
|
||||
}
|
||||
imlib_context_set_image(im);
|
||||
}
|
||||
pixels += (2 * w - i) * (((i) * h) / w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue