Skip to content

Commit

Permalink
- removed hermeslib dependancy
Browse files Browse the repository at this point in the history
- added back old asm/mmx code
  • Loading branch information
dan committed Sep 30, 2002
1 parent 11c466e commit 1941aaf
Show file tree
Hide file tree
Showing 9 changed files with 175 additions and 235 deletions.
7 changes: 5 additions & 2 deletions acconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@
/* define if your X server has XConvertCase() */
#undef HAVE_XCONVERTCASE

/* define if you want Hermes support */
#undef HAVE_HERMES
/* define if processor is x86 */
#undef ASM_X86

/* define if processor is x86 with MMX(tm) support */
#undef ASM_X86_MMX

/* define if you have vsnprintf with C99 semantics */
#undef HAVE_C99_VSNPRINTF
Expand Down
71 changes: 45 additions & 26 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,49 @@ AC_C_CONST
#AC_TYPE_PID_T
AC_TYPE_SIGNAL




dnl Compiler/architecture specific optimizations
dnl ============================================


dnl GCC/as with MMX support
dnl -----------------------

# until we fix it, leave it disabled
asm_support=no
mmx_support=no
if test "$ac_cv_prog_gcc" = yes; then
x86=0
changequote(,)dnl
case "$host_cpu" in
i[3456]86) x86=1
;;
esac
changequote([,])dnl

if test "$host_os" != "linux" -a "$host_os" != "linux-gnu" ; then
x86=0
fi

if test $x86 = 1; then
AC_DEFINE(ASM_X86)
asm_support=yes

AC_CACHE_CHECK(whether gcc supports MMX(tm) inline asm,
ac_cv_c_inline_mmx,
[AC_TRY_LINK(,[asm ("movq %mm0, %mm1");],
ac_cv_c_inline_mmx=yes,
ac_cv_c_inline_mmx=no)])

if test "x$ac_cv_c_inline_mmx" = xyes; then
AC_DEFINE(ASM_X86_MMX)
mmx_support=yes
fi
fi
fi



dnl gettext
dnl =======
Expand Down Expand Up @@ -550,28 +592,6 @@ dnl ===============================================



dnl Hermes Support
dnl ==============

AC_ARG_ENABLE(hermes,
[ --disable-hermes disable Hermes support for wrlib ],
hermes=$enableval, hermes=yes)

if test x$hermes = xyes; then
WM_CHECK_LIB(Hermes, Hermes_ConverterRequest, [])

if test x$ac_cv_lib_Hermes_Hermes_ConverterRequest = xyes; then
WM_CHECK_HEADER(Hermes/Hermes.h)
if test x$ac_cv_header_Hermes_Hermes_h = xyes; then
GFXLIBS="$GFXLIBS -lHermes"
AC_DEFINE(HAVE_HERMES)
hermes_support=yes
fi
fi
fi



dnl PNG Support
dnl ===========
png=yes
Expand Down Expand Up @@ -974,9 +994,8 @@ echo "Installation path prefix: $prefix"
echo "Installation path prefix for binaries: $_bindir"
echo "Installation path for WPrefs.app: $wprefsdir" | sed -e 's|\$(prefix)|'"$prefix|"
echo "Graphic format libraries: $supported_gfx"
if test x$hermes_support = xyes; then
echo "Hermes support for wrlib enabled"
fi
echo "Use assembly routines for wrlib: $asm_support"
echo "Use inline MMX(tm) x86 assembly: $mmx_support"
dnl echo "Sound support: yes"
echo "Translated message files to install: $mof"
if test "x$MOFILES" != "x"; then
Expand Down
4 changes: 4 additions & 0 deletions wrlib/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- removed obsoleted RDestroyImage()
- removed Hermes code.
- Put back asm/mmx optimized code.

- fixed a bug in RCombineAreaWithOpaqueness() (Brad <lists@anomie.yi.org>)

- Added retain/release mechanism to RImage by adding RRetainImage() and
Expand Down
14 changes: 12 additions & 2 deletions wrlib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = no-dependencies

lib_LTLIBRARIES = libwraster.la

libwraster_la_LDFLAGS = -version-info 4:0:2
libwraster_la_LDFLAGS = -version-info 5:0:3

bin_SCRIPTS = get-wraster-flags

Expand All @@ -20,7 +20,6 @@ libwraster_la_SOURCES = \
CrCmap.c \
DelCmap.c \
CmapAlloc.c \
wrasterP.h \
raster.c \
draw.c \
color.c \
Expand All @@ -29,6 +28,7 @@ libwraster_la_SOURCES = \
gradient.c \
xpixmap.c \
convert.c \
x86_specific.c \
context.c \
misc.c \
scale.c \
Expand All @@ -44,6 +44,16 @@ libwraster_la_SOURCES = \
gif.c


LTCOMPILE2=`echo $(LTCOMPILE) | sed -e s/-fomit-frame-pointer//`
COMPILE2=`echo $(COMPILE) | sed -e s/-fomit-frame-pointer//`

# cant compile asm stuff with optimizations
x86_specific.lo: x86_specific.c
$(LTCOMPILE2) -O0 -c $<

x86_specific.o: x86_specific.c
$(COMPILE2) -O0 -c $<


INCLUDES = $(DFLAGS) @HEADER_SEARCH_PATH@

Expand Down
2 changes: 1 addition & 1 deletion wrlib/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
supports PseudoColor and TrueColor in some depths)
- Gimp's xcf format?
- add clipping code to RCombineArea()
- figure out what is producing those speckles when dithering is used.
- remake and optimize converters
60 changes: 1 addition & 59 deletions wrlib/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@

#include <math.h>

#include "wrasterP.h"

#ifdef HAVE_HERMES
#include <Hermes/Hermes.h>
#endif

#include "StdCmap.h"

#include "wraster.h"
Expand Down Expand Up @@ -706,66 +700,17 @@ RCreateContext(Display *dpy, int screen_number, RContextAttributes *attribs)
context->copy_gc = XCreateGC(dpy, context->drawable, GCFunction
|GCGraphicsExposures, &gcv);

#ifdef HAVE_HERMES
context->hermes_data = malloc(sizeof(RHermesData));
if (!context->hermes_data) {
RErrorCode = RERR_NOMEMORY;
free(context);
return NULL;
}

Hermes_Init();

context->hermes_data->palette = Hermes_PaletteInstance();
{
unsigned long flags = 0;

if (context->attribs->render_mode == RDitheredRendering) {
flags |= HERMES_CONVERT_DITHER;
}
context->hermes_data->converter = Hermes_ConverterInstance(flags);
}
#endif

if (context->vclass == PseudoColor || context->vclass == StaticColor) {
if (!setupPseudoColorColormap(context)) {
free(context);
return NULL;
}
#ifdef HAVE_HERMES
{
int32 palette[256];
int i;

for (i = 0; i < context->ncolors; i++) {
palette[i] = ((context->colors[i].red >> 8) << 16) ||
((context->colors[i].green >> 8) << 8) ||
((context->colors[i].blue >> 8));
}

Hermes_PaletteSet(context->hermes_data->palette, palette);
}
#endif
} else if (context->vclass == GrayScale || context->vclass == StaticGray) {
context->colors = allocateGrayScale(context);
if (!context->colors) {
free(context);
return NULL;
}
#ifdef HAVE_HERMES
{
int32 palette[256];
int i;

for (i = 0; i < context->ncolors; i++) {
palette[i] = ((context->colors[i].red >> 8) << 16) ||
((context->colors[i].green >> 8) << 8) ||
((context->colors[i].blue >> 8));
}

Hermes_PaletteSet(context->hermes_data->palette, palette);
}
#endif
} else if (context->vclass == TrueColor) {
/* calc offsets to create a TrueColor pixel */
context->red_offset = count_offset(context->visual->red_mask);
Expand All @@ -776,10 +721,7 @@ RCreateContext(Display *dpy, int screen_number, RContextAttributes *attribs)
context->attribs->render_mode = RBestMatchRendering;
}

#ifdef HAVE_HERMES

#endif


/* check avaiability of MIT-SHM */
#ifdef XSHM
if (!(context->attribs->flags & RC_UseSharedMemory)) {
Expand Down
Loading

0 comments on commit 1941aaf

Please sign in to comment.