diff --git a/x11/libgdiplus/patches/patch-src_gdiplus-private_h b/x11/libgdiplus/patches/patch-src_gdiplus-private_h deleted file mode 100644 index 05f63f3d008..00000000000 --- a/x11/libgdiplus/patches/patch-src_gdiplus-private_h +++ /dev/null @@ -1,13 +0,0 @@ -$OpenBSD: patch-src_gdiplus-private_h,v 1.1 2014/01/10 13:33:21 naddy Exp $ ---- src/gdiplus-private.h.orig Thu Jan 13 23:28:19 2011 -+++ src/gdiplus-private.h Fri Jan 10 14:24:53 2014 -@@ -30,7 +30,8 @@ - #include - #include - #include --#include -+#include -+#include FT_TRUETYPE_TABLES_H - #include - #include - diff --git a/x11/libgdiplus/patches/patch-src_gifcodec_c b/x11/libgdiplus/patches/patch-src_gifcodec_c deleted file mode 100644 index 7d7338514a5..00000000000 --- a/x11/libgdiplus/patches/patch-src_gifcodec_c +++ /dev/null @@ -1,202 +0,0 @@ -$OpenBSD: patch-src_gifcodec_c,v 1.3 2015/03/28 16:06:48 sthen Exp $ - -giflib 5.1+ -http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/graphics/libgdiplus/patches/patch-src_gifcodec.c?rev=1.2 - ---- src/gifcodec.c.orig Fri Dec 2 17:23:12 2011 -+++ src/gifcodec.c Sat Mar 28 16:04:03 2015 -@@ -39,8 +39,12 @@ GUID gdip_gif_image_format_guid = {0xb96b3cb0U, 0x0728 - - #include "gifcodec.h" - --/* giflib declares this incorrectly as EgifOpen */ -+/* giflib declares this incorrectly as EgifOpen up to 4.1.2 -+ GIF_LIB_VERSION is defined up to 4.1.6, and prototype is changed in 5.0, -+ so it is safe to use it as check condition */ -+#ifdef GIF_LIB_VERSION - extern GifFileType *EGifOpen(void *userData, OutputFunc writeFunc); -+#endif - - /* Data structure used for callback */ - typedef struct -@@ -129,7 +133,11 @@ AddExtensionBlockMono(SavedImage *New, int Len, BYTE E - - if (ExtData) { - memcpy(ep->Bytes, ExtData, Len); -+#if GIFLIB_MAJOR >= 5 -+ ep->Function = New->ExtensionBlocks[New->ExtensionBlockCount++].Function; -+#else - ep->Function = New->Function; -+#endif - } - - return (GIF_OK); -@@ -232,7 +240,11 @@ DGifSlurpMono(GifFileType * GifFile, SavedImage *Trail - } - - case EXTENSION_RECORD_TYPE: { -+#if GIFLIB_MAJOR >= 5 -+ if (DGifGetExtension(GifFile, &temp_save.ExtensionBlocks[temp_save.ExtensionBlockCount].Function, &ExtData) == GIF_ERROR) { -+#else - if (DGifGetExtension(GifFile, &temp_save.Function, &ExtData) == GIF_ERROR) { -+#endif - return (GIF_ERROR); - } - -@@ -245,7 +257,9 @@ DGifSlurpMono(GifFileType * GifFile, SavedImage *Trail - if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) { - return (GIF_ERROR); - } -+#if GIFLIB_MAJOR < 5 - temp_save.Function = 0; -+#endif - } - break; - } -@@ -304,9 +318,17 @@ gdip_load_gif_image (void *stream, GpImage **image, BO - loop_counter = FALSE; - - if (from_file) { -+#if GIFLIB_MAJOR >= 5 -+ gif = DGifOpen(stream, &gdip_gif_fileinputfunc, NULL); -+#else - gif = DGifOpen(stream, &gdip_gif_fileinputfunc); -+#endif - } else { -+#if GIFLIB_MAJOR >= 5 -+ gif = DGifOpen (stream, &gdip_gif_inputfunc, NULL); -+#else - gif = DGifOpen (stream, &gdip_gif_inputfunc); -+#endif - } - - if (gif == NULL) { -@@ -581,7 +603,7 @@ gdip_load_gif_image (void *stream, GpImage **image, BO - } - - FreeExtensionMono(&global_extensions); -- DGifCloseFile (gif); -+ DGifCloseFile (gif, NULL); - - *image = result; - return Ok; -@@ -597,7 +619,7 @@ error: - - if (gif != NULL) { - FreeExtensionMono (&global_extensions); -- DGifCloseFile (gif); -+ DGifCloseFile (gif, NULL); - } - - *image = NULL; -@@ -661,9 +683,17 @@ gdip_save_gif_image (void *stream, GpImage *image, BOO - } - - if (from_file) { -+#if GIFLIB_MAJOR >= 5 -+ fp = EGifOpenFileName (stream, 0, NULL); -+#else - fp = EGifOpenFileName (stream, 0); -+#endif - } else { -+#if GIFLIB_MAJOR >= 5 -+ fp = EGifOpen (stream, gdip_gif_outputfunc, NULL); -+#else - fp = EGifOpen (stream, gdip_gif_outputfunc); -+#endif - } - - if (!fp) { -@@ -702,7 +732,11 @@ gdip_save_gif_image (void *stream, GpImage *image, BOO - goto error; - } - -+#if GIFLIB_MAJOR >= 5 -+ cmap = GifMakeMapObject(cmap_size, 0); -+#else - cmap = MakeMapObject(cmap_size, 0); -+#endif - - pixbuf = GdipAlloc(pixbuf_size); - if (pixbuf == NULL) { -@@ -793,7 +827,11 @@ gdip_save_gif_image (void *stream, GpImage *image, BOO - pixbuf = pixbuf_org; - } else { - cmap_size = 256; -+#if GIFLIB_MAJOR >= 5 -+ cmap = GifMakeMapObject (cmap_size, 0); -+#else - cmap = MakeMapObject (cmap_size, 0); -+#endif - - red = GdipAlloc(pixbuf_size); - green = GdipAlloc(pixbuf_size); -@@ -824,13 +862,21 @@ gdip_save_gif_image (void *stream, GpImage *image, BOO - v += 4; - } - } -+#if GIFLIB_MAJOR >= 5 -+ if (GifQuantizeBuffer(bitmap_data->width, bitmap_data->height, &cmap_size, -+#else - if (QuantizeBuffer(bitmap_data->width, bitmap_data->height, &cmap_size, -+#endif - red, green, blue, pixbuf, cmap->Colors) == GIF_ERROR) { - goto error; - } - } - -+#if GIFLIB_MAJOR >= 5 -+ cmap->BitsPerPixel = GifBitSize (cmap_size); -+#else - cmap->BitsPerPixel = BitSize (cmap_size); -+#endif - cmap->ColorCount = 1 << cmap->BitsPerPixel; - - if ((frame == 0) && (k == 0)) { -@@ -848,8 +894,15 @@ gdip_save_gif_image (void *stream, GpImage *image, BOO - Buffer[0] = 1; - Buffer[1] = ptr[0]; - Buffer[2] = ptr[1]; -+#if GIFLIB_MAJOR >= 5 -+ EGifPutExtensionLeader(fp, APPLICATION_EXT_FUNC_CODE); -+ EGifPutExtensionBlock(fp, 11, "NETSCAPE2.0"); -+ EGifPutExtensionBlock(fp, 3, Buffer); -+ EGifPutExtensionTrailer(fp); -+#else - EGifPutExtensionFirst(fp, APPLICATION_EXT_FUNC_CODE, 11, "NETSCAPE2.0"); - EGifPutExtensionLast(fp, APPLICATION_EXT_FUNC_CODE, 3, Buffer); -+#endif - } - } - -@@ -901,7 +954,11 @@ gdip_save_gif_image (void *stream, GpImage *image, BOO - pixbuf += bitmap_data->width; - } - -+#if GIFLIB_MAJOR >= 5 -+ GifFreeMapObject (cmap); -+#else - FreeMapObject (cmap); -+#endif - if (red != NULL) { - GdipFree (red); - } -@@ -923,13 +980,17 @@ gdip_save_gif_image (void *stream, GpImage *image, BOO - } - } - -- EGifCloseFile (fp); -+ EGifCloseFile (fp, NULL); - - return Ok; - - error: - if (cmap != NULL) { -+#if GIFLIB_MAJOR >= 5 -+ GifFreeMapObject (cmap); -+#else - FreeMapObject (cmap); -+#endif - } - - if (red != NULL) { diff --git a/x11/libgdiplus/patches/patch-src_pngcodec_c b/x11/libgdiplus/patches/patch-src_pngcodec_c deleted file mode 100644 index f6dc1d4896c..00000000000 --- a/x11/libgdiplus/patches/patch-src_pngcodec_c +++ /dev/null @@ -1,164 +0,0 @@ -$OpenBSD: patch-src_pngcodec_c,v 1.3 2011/07/08 20:36:09 naddy Exp $ - -Fix build with png-1.5. - ---- src/pngcodec.c.orig Thu Jan 13 15:28:19 2011 -+++ src/pngcodec.c Mon Jul 4 13:34:52 2011 -@@ -116,10 +116,15 @@ gdip_load_png_properties (png_structp png_ptr, png_inf - bitmap_data->dpi_horz = png_get_x_pixels_per_inch(png_ptr, info_ptr); - bitmap_data->dpi_vert = png_get_y_pixels_per_inch(png_ptr, info_ptr); - #elif defined(PNG_pHYs_SUPPORTED) -- if ((info_ptr->valid & PNG_INFO_pHYs) && (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)) { -- bitmap_data->image_flags |= ImageFlagsHasRealDPI; -- bitmap_data->dpi_horz = info_ptr->x_pixels_per_unit * 0.0254; -- bitmap_data->dpi_vert = info_ptr->y_pixels_per_unit * 0.0254; -+ if (png_get_valid (png_ptr, info_ptr, PNG_INFO_pHYs)) { -+ png_uint_32 res_x, res_y; -+ int unit_type; -+ png_get_pHYs (png_ptr, info_ptr, &res_x, &res_y, &unit_type); -+ if (unit_type == PNG_RESOLUTION_METER) { -+ bitmap_data->image_flags |= ImageFlagsHasRealDPI; -+ bitmap_data->dpi_horz = res_x * 0.0254; -+ bitmap_data->dpi_vert = res_y * 0.0254; -+ } - } - #endif - /* default to screen resolution (if nothing was provided or available) */ -@@ -130,7 +135,7 @@ gdip_load_png_properties (png_structp png_ptr, png_inf - #if defined(PNG_iCCP_SUPPORTED) - { - png_charp name; -- png_charp profile; -+ png_bytep profile; - png_uint_32 proflen; - int compression_type; - -@@ -292,6 +297,11 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, Get - ImageFlags colourspace_flag; - int i; - int j; -+ png_colorp png_palette; -+ int png_num_palette; -+ png_bytep trans_alpha; -+ int num_trans; -+ png_color_16p trans_color; - - width = png_get_image_width (png_ptr, info_ptr); - height = png_get_image_height (png_ptr, info_ptr); -@@ -309,6 +319,8 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, Get - } - - /* Copy palette. */ -+ png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette); -+ - num_colours = 1 << bit_depth; - - if (png_get_color_type (png_ptr, info_ptr) == PNG_COLOR_TYPE_GRAY) { -@@ -321,8 +333,8 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, Get - colourspace_flag = ImageFlagsColorSpaceRGB; - - palette_entries = num_colours; -- if (palette_entries > info_ptr->num_palette) { -- palette_entries = info_ptr->num_palette; -+ if (palette_entries > png_num_palette) { -+ palette_entries = png_num_palette; - } - - palette = GdipAlloc (sizeof(ColorPalette) + (num_colours - 1) * sizeof(ARGB)); -@@ -331,29 +343,30 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, Get - - for (i=0; i < palette_entries; i++) { - set_pixel_bgra (&palette->Entries[i], 0, -- info_ptr->palette[i].blue, -- info_ptr->palette[i].green, -- info_ptr->palette[i].red, -+ png_palette[i].blue, -+ png_palette[i].green, -+ png_palette[i].red, - 0xFF); /* alpha */ - } - } - -+ png_get_tRNS (png_ptr, info_ptr, &trans_alpha, &num_trans, &trans_color); - /* Make sure transparency is respected. */ -- if (info_ptr->num_trans > 0) { -+ if (num_trans > 0) { - palette->Flags |= PaletteFlagsHasAlpha; - colourspace_flag |= ImageFlagsHasAlpha; - -- if (info_ptr->num_trans > info_ptr->num_palette) { -- info_ptr->num_trans = info_ptr->num_palette; -+ if (num_trans > png_num_palette) { -+ num_trans = png_num_palette; - } - -- for (i=0; i < info_ptr->num_trans; i++) { -+ for (i=0; i < num_trans; i++) { - set_pixel_bgra(&palette->Entries[i], 0, -- info_ptr->palette[i].blue, -- info_ptr->palette[i].green, -- info_ptr->palette[i].red, -+ png_palette[i].blue, -+ png_palette[i].green, -+ png_palette[i].red, - #if PNG_LIBPNG_VER > 10399 -- info_ptr->trans_alpha [i]); /* alpha */ -+ trans_alpha [i]); /* alpha */ - #else - info_ptr->trans[i]); /* alpha */ - #endif -@@ -398,6 +411,8 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, Get - BYTE bit_depth; - int stride; - int interlace; -+ png_colorp png_palette; -+ int png_num_palette; - png_bytep *row_pointers; - BYTE *rawptr; - int i, j; -@@ -490,32 +505,33 @@ gdip_load_png_image_from_file_or_stream (FILE *fp, Get - png_byte palette = 0; - png_byte pix = *rowp++; - -+ png_get_PLTE (png_ptr, info_ptr, &png_palette, &png_num_palette); - palette = (pix >> 6) & 0x03; - set_pixel_bgra (rawptr, 0, -- info_ptr->palette[palette].blue, -- info_ptr->palette[palette].green, -- info_ptr->palette[palette].red, -+ png_palette[palette].blue, -+ png_palette[palette].green, -+ png_palette[palette].red, - 0xFF); /* alpha */ - - palette = (pix >> 4) & 0x03; - set_pixel_bgra (rawptr, 4, -- info_ptr->palette[palette].blue, -- info_ptr->palette[palette].green, -- info_ptr->palette[palette].red, -+ png_palette[palette].blue, -+ png_palette[palette].green, -+ png_palette[palette].red, - 0xFF); /* alpha */ - - palette = (pix >> 2) & 0x03; - set_pixel_bgra (rawptr, 8, -- info_ptr->palette[palette].blue, -- info_ptr->palette[palette].green, -- info_ptr->palette[palette].red, -+ png_palette[palette].blue, -+ png_palette[palette].green, -+ png_palette[palette].red, - 0xFF); /* alpha */ - - palette = pix & 0x03; - set_pixel_bgra (rawptr, 12, -- info_ptr->palette[palette].blue, -- info_ptr->palette[palette].green, -- info_ptr->palette[palette].red, -+ png_palette[palette].blue, -+ png_palette[palette].green, -+ png_palette[palette].red, - 0xFF); /* alpha */ - rawptr += 16; - }