Index: head/graphics/gd/Makefile =================================================================== --- head/graphics/gd/Makefile (revision 488715) +++ head/graphics/gd/Makefile (revision 488716) @@ -1,95 +1,96 @@ # Created by: jeff@cetlink.net # $FreeBSD$ PORTNAME= libgd PORTVERSION= 2.2.5 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES+= graphics MASTER_SITES= https://github.com/${PORTNAME}/${PORTNAME}/releases/download/gd-${PORTVERSION}/ MAINTAINER?= dinoex@FreeBSD.org COMMENT?= Graphics library for fast creation of images LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libtiff.so:graphics/tiff \ libpng.so:graphics/png \ libfreetype.so:print/freetype2 CONFLICTS= bazaar-1.* USES= tar:xz pkgconfig pathfix libtool:keepla shebangfix jpeg SHEBANG_FILES= ${WRKSRC}/src/bdftogd GNU_CONFIGURE= yes USE_LDCONFIG= yes TEST_TARGET= check OPTIONS_DEFINE= FONTCONFIG ICONV XPM WEBP OPTIONS_DEFAULT=FONTCONFIG WEBP NO_OPTIONS_SORT=yes FONTCONFIG_LIB_DEPENDS+= libfontconfig.so:x11-fonts/fontconfig FONTCONFIG_CONFIGURE_OFF= --with-fontconfig=no ICONV_USES= iconv ICONV_CONFIGURE_ON= ${ICONV_CONFIGURE_ARG} XPM_USE= xorg=xpm,x11 XPM_CONFIGURE_ON= --with-x XPM_CONFIGURE_OFF= --with-xpm=no WEBP_LIB_DEPENDS= libwebp.so:graphics/webp WEBP_CONFIGURE_OFF= --without-webp .include # force gdlib-config --ldflags LDFLAGS+= -L${LOCALBASE}/lib # The GD_FONTS environment variable can be set to specify the gzipped # tar-ball containing the fonts in bdf format and the bdf file names. # The tarball is the first argument, the tiny, small, medium-bold, # large, and giant fonts follow. # # For example: # GD_FONTS="/usr/ports/distfiles/x-koi8u.tgz koi6x10.bdf koi8x13.bdf \ # koi9x15.bdf koi12x24.bdf koi10x20.bdf" # .if defined(GD_FONTS) USES+= perl5 USE_PERL5= build WRKFONTS= ${WRKSRC}/src .endif pre-extract:: @${ECHO_MSG} "" @${ECHO_MSG} "GD_FONTS can be set to specify an alternative list of .bdf files" @${ECHO_MSG} "" post-extract: .if defined(GD_FONTS) cd ${WRKFONTS} && ${SH} ${FILESDIR}/makefonts extract ${GD_FONTS} .endif pre-configure: .if defined(GD_FONTS) cd ${WRKFONTS} && ${SH} ${FILESDIR}/makefonts configure ${GD_FONTS} .endif # bump shlib version ${REINPLACE_CMD} \ -e 's|^GDLIB_LT_CURRENT=3|GDLIB_LT_CURRENT=6|' \ ${WRKSRC}/configure pre-configure-ICONV-off: ${REINPLACE_CMD} \ -e 's|iconv|noiconv|' \ ${WRKSRC}/configure .if defined(GD_FONTS) pre-build: cd ${WRKFONTS} && ${SH} ${FILESDIR}/makefonts build ${GD_FONTS} .endif post-install: ${INSTALL_DATA} ${WRKSRC}/src/gdhelpers.h \ ${STAGEDIR}${PREFIX}/include/ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libgd.so.6* .include Index: head/graphics/gd/files/patch-gd.c =================================================================== --- head/graphics/gd/files/patch-gd.c (nonexistent) +++ head/graphics/gd/files/patch-gd.c (revision 488716) @@ -0,0 +1,136 @@ +index d8eaf43..d852068 100644 +--- src/gd.c ++++ src/gd.c +@@ -66,6 +66,9 @@ static const unsigned char gd_toascii[256] = { + }; + #endif /*CHARSET_EBCDIC */ + ++/* 2.0.10: cast instead of floor() yields 35% performance improvement. Thanks to John Buckman. */ ++#define floor_cast(exp) ((long) exp) ++ + extern const int gdCosT[]; + extern const int gdSinT[]; + +@@ -3452,50 +3455,51 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst, + int dstW, int dstH, int srcW, int srcH) + { + int x, y; ++ double sy1, sy2, sx1, sx2; ++ + if (!dst->trueColor) { + gdImageCopyResized (dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); + return; + } + for (y = dstY; (y < dstY + dstH); y++) { ++ sy1 = ((double) y - (double) dstY) * (double) srcH / (double) dstH; ++ sy2 = ((double) (y + 1) - (double) dstY) * (double) srcH / (double) dstH; + for (x = dstX; (x < dstX + dstW); x++) { +- float sy1, sy2, sx1, sx2; +- float sx, sy; +- float spixels = 0.0; +- float red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0; +- float alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0; +- sy1 = ((float)(y - dstY)) * (float)srcH / (float)dstH; +- sy2 = ((float)(y + 1 - dstY)) * (float) srcH / (float) dstH; ++ double sx, sy; ++ double spixels = 0; ++ double red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0; ++ double alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0; ++ sx1 = ((double) x - (double) dstX) * (double) srcW / dstW; ++ sx2 = ((double) (x + 1) - (double) dstX) * (double) srcW / dstW; + sy = sy1; + do { +- float yportion; +- if (floorf(sy) == floorf(sy1)) { +- yportion = 1.0 - (sy - floorf(sy)); ++ double yportion; ++ if (floor_cast(sy) == floor_cast(sy1)) { ++ yportion = 1.0f - (sy - floor_cast(sy)); + if (yportion > sy2 - sy1) { + yportion = sy2 - sy1; + } +- sy = floorf(sy); ++ sy = floor_cast(sy); + } else if (sy == floorf(sy2)) { +- yportion = sy2 - floorf(sy2); ++ yportion = sy2 - floor_cast(sy2); + } else { +- yportion = 1.0; ++ yportion = 1.0f; + } +- sx1 = ((float)(x - dstX)) * (float) srcW / dstW; +- sx2 = ((float)(x + 1 - dstX)) * (float) srcW / dstW; + sx = sx1; + do { +- float xportion; +- float pcontribution; ++ double xportion; ++ double pcontribution; + int p; +- if (floorf(sx) == floorf(sx1)) { +- xportion = 1.0 - (sx - floorf(sx)); ++ if (floorf(sx) == floor_cast(sx1)) { ++ xportion = 1.0f - (sx - floor_cast(sx)); + if (xportion > sx2 - sx1) { + xportion = sx2 - sx1; + } +- sx = floorf(sx); ++ sx = floor_cast(sx); + } else if (sx == floorf(sx2)) { +- xportion = sx2 - floorf(sx2); ++ xportion = sx2 - floor_cast(sx2); + } else { +- xportion = 1.0; ++ xportion = 1.0f; + } + pcontribution = xportion * yportion; + p = gdImageGetTrueColorPixel(src, (int) sx + srcX, (int) sy + srcY); +@@ -3508,21 +3512,24 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst, + alpha_sum += alpha_factor; + contrib_sum += pcontribution; + spixels += xportion * yportion; +- sx += 1.0; ++ sx += 1.0f; + } + while (sx < sx2); ++ + sy += 1.0f; + } ++ + while (sy < sy2); + +- if (spixels != 0.0) { ++ if (spixels != 0.0f) { + red /= spixels; + green /= spixels; + blue /= spixels; + alpha /= spixels; ++ alpha += 0.5; + } +- if ( alpha_sum != 0.0) { +- if( contrib_sum != 0.0) { ++ if ( alpha_sum != 0.0f) { ++ if( contrib_sum != 0.0f) { + alpha_sum /= contrib_sum; + } + red /= alpha_sum; +@@ -3530,14 +3537,14 @@ BGD_DECLARE(void) gdImageCopyResampled (gdImagePtr dst, + blue /= alpha_sum; + } + /* Clamping to allow for rounding errors above */ +- if (red > 255.0) { +- red = 255.0; ++ if (red > 255.0f) { ++ red = 255.0f; + } +- if (green > 255.0) { +- green = 255.0; ++ if (green > 255.0f) { ++ green = 255.0f; + } + if (blue > 255.0f) { +- blue = 255.0; ++ blue = 255.0f; + } + if (alpha > gdAlphaMax) { + alpha = gdAlphaMax; Property changes on: head/graphics/gd/files/patch-gd.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property