summaryrefslogtreecommitdiff
path: root/cairo
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-06 09:37:16 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-06 09:52:42 +0000
commit79f5f4c97188e8584aceb6af98473c06f40f7500 (patch)
treea87132e1defa9a85cff6224354f9e77d755bcddf /cairo
parent504e01e52e38583c6bcbd620973b314596633cdb (diff)
Resolves: fdo#44219 RHEL-4 buildbox doesn't have FT_Library_SetLcdFilter
Diffstat (limited to 'cairo')
-rw-r--r--cairo/cairo.dlsym.lcdfilter.patch56
-rw-r--r--cairo/cairo/makefile.mk4
2 files changed, 59 insertions, 1 deletions
diff --git a/cairo/cairo.dlsym.lcdfilter.patch b/cairo/cairo.dlsym.lcdfilter.patch
new file mode 100644
index 000000000000..46f7ac74fd7a
--- /dev/null
+++ b/cairo/cairo.dlsym.lcdfilter.patch
@@ -0,0 +1,56 @@
+--- misc/cairo-1.10.2/src/cairo-ft-font.c 2012-01-06 09:09:21.500373823 +0000
++++ misc/build/cairo-1.10.2/src/cairo-ft-font.c 2012-01-06 09:31:01.645238786 +0000
+@@ -59,6 +59,8 @@
+
+ #if HAVE_FT_LIBRARY_SETLCDFILTER
+ #include FT_LCD_FILTER_H
++#elif HAVE_DLFCN_H
++#include <dlfcn.h>
+ #endif
+
+ /* Fontconfig version older than 2.6 didn't have these options */
+@@ -1217,6 +1219,26 @@
+ return CAIRO_STATUS_SUCCESS;
+ }
+
++static void try_FT_Library_SetLcdFilter( FT_Library library,
++ int lcd_filter )
++{
++#if HAVE_FT_LIBRARY_SETLCDFILTER
++ FT_Library_SetLcdFilter (library, lcd_filter);
++#elif HAVE_DLFCN_H
++ static void (*pFT_Library_SetLcdFilter) (FT_Library, int);
++ static int dlsymed = 0;
++
++ if (!dlsymed)
++ {
++ pFT_Library_SetLcdFilter = dlsym(RTLD_DEFAULT, "FT_Library_SetLcdFilter");
++ dlsymed = 1;
++ }
++
++ if (pFT_Library_SetLcdFilter)
++ (*pFT_Library_SetLcdFilter) (library, lcd_filter);
++#endif
++}
++
+ /* Converts an outline FT_GlyphSlot into an image
+ *
+ * This could go through _render_glyph_bitmap as well, letting
+@@ -1350,15 +1372,11 @@
+ break;
+ }
+
+-#if HAVE_FT_LIBRARY_SETLCDFILTER
+- FT_Library_SetLcdFilter (library, lcd_filter);
+-#endif
++ try_FT_Library_SetLcdFilter(library, lcd_filter);
+
+ fterror = FT_Render_Glyph (face->glyph, render_mode);
+
+-#if HAVE_FT_LIBRARY_SETLCDFILTER
+- FT_Library_SetLcdFilter (library, FT_LCD_FILTER_NONE);
+-#endif
++ try_FT_Library_SetLcdFilter(library, FT_LCD_FILTER_NONE);
+
+ if (fterror != 0)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
diff --git a/cairo/cairo/makefile.mk b/cairo/cairo/makefile.mk
index 7f84e3dedda2..1c06c7495a9b 100644
--- a/cairo/cairo/makefile.mk
+++ b/cairo/cairo/makefile.mk
@@ -47,7 +47,9 @@ CAIROVERSION=1.10.2
TARFILE_NAME=$(PRJNAME)-$(CAIROVERSION)
TARFILE_MD5=f101a9e88b783337b20b2e26dfd26d5f
-PATCH_FILES=..$/$(TARFILE_NAME).patch
+PATCH_FILES=\
+ ..$/cairo-1.10.2.patch \
+ ..$/cairo.dlsym.lcdfilter.patch
.IF "$(OS)$(COM)" == "WNTMSC"
PATCH_FILES+= ..$/$(TARFILE_NAME).wntmsc.patch