[cairo-commit] src/cairo-ft-font.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Dec 16 08:49:05 UTC 2018


 src/cairo-ft-font.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit c0ed8ce1a111cb9472aef080ac3aa31526443f7c
Author: suzuki toshiya <mpsuzuki at hiroshima-u.ac.jp>
Date:   Thu Dec 13 14:36:56 2018 +0900

    [cairo-ft-font.c] conditionalize the changes by 3ec4aa24 on 2018-07-16 for legacy FreeType2 without color font feature

diff --git a/src/cairo-ft-font.c b/src/cairo-ft-font.c
index 325dd61b4..1841adb85 100644
--- a/src/cairo-ft-font.c
+++ b/src/cairo-ft-font.c
@@ -976,10 +976,12 @@ _compute_xrender_bitmap_size(FT_Bitmap      *target,
 	pitch = width * 4;
 	break;
 
+#ifdef FT_PIXEL_MODE_BGRA
     case FT_PIXEL_MODE_BGRA:
 	/* each pixel is replicated into a 32-bit ARGB value */
 	pitch = width * 4;
 	break;
+#endif
 
     default:  /* unsupported source format */
 	return -1;
@@ -1177,10 +1179,12 @@ _fill_xrender_bitmap(FT_Bitmap      *target,
 	}
 	break;
 
+#ifdef FT_PIXEL_MODE_BGRA
     case FT_PIXEL_MODE_BGRA:
 	for (h = height; h > 0; h--, srcLine += src_pitch, dstLine += pitch)
 	    memcpy (dstLine, srcLine, width * 4);
 	break;
+#endif
 
     default:
 	assert (0);
@@ -1289,6 +1293,7 @@ _get_bitmap_surface (FT_Bitmap		     *bitmap,
 	    component_alpha = TRUE;
 	}
 	break;
+#ifdef FT_PIXEL_MODE_BGRA
     case FT_PIXEL_MODE_BGRA:
 	stride = width * 4;
 	if (own_buffer) {
@@ -1311,6 +1316,7 @@ _get_bitmap_surface (FT_Bitmap		     *bitmap,
 	}
 	format = CAIRO_FORMAT_ARGB32;
 	break;
+#endif
     case FT_PIXEL_MODE_GRAY2:
     case FT_PIXEL_MODE_GRAY4:
     convert:
@@ -2487,7 +2493,9 @@ _cairo_ft_scaled_glyph_init (void			*abstract_font,
 	vertical_layout = TRUE;
     }
 
+#ifdef FT_LOAD_COLOR
     load_flags |= FT_LOAD_COLOR;
+#endif
 
 
     if (info & CAIRO_SCALED_GLYPH_INFO_METRICS) {
@@ -2656,7 +2664,9 @@ LOAD:
          */
 	scaled_glyph_loaded = FALSE;
         info &= ~CAIRO_SCALED_GLYPH_INFO_METRICS;
+#ifdef FT_LOAD_COLOR
         load_flags &= ~FT_LOAD_COLOR;
+#endif
         goto LOAD;
     }
 


More information about the cairo-commit mailing list