[raster] Handle `FT_RASTER_FLAG_AA' correctly. This fixes a breakage caused by the commit `[raster] Remove 5-level gray AA mode from monochrome rasterizer.'. Problem reported by Markus Trippelsdorf <markus@trippelsdorf.de> and octoploid <octoploid@yandex.com>. * src/raster/ftraster.c (ft_black_render): Handle `FT_RASTER_FLAG_AA'. * src/raster/ftrend1.c (ft_raster1_render): Remove gray AA mode remnants.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
diff --git a/ChangeLog b/ChangeLog
index 334a439..be6cc7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2015-01-23 Behdad Esfahbod <behdad@behdad.org>
+
+ [raster] Handle `FT_RASTER_FLAG_AA' correctly.
+
+ This fixes a breakage caused by the commit `[raster] Remove
+ 5-level gray AA mode from monochrome rasterizer.'.
+
+ Problem reported by Markus Trippelsdorf <markus@trippelsdorf.de> and
+ octoploid <octoploid@yandex.com>.
+
+ * src/raster/ftraster.c (ft_black_render): Handle
+ `FT_RASTER_FLAG_AA'.
+
+ * src/raster/ftrend1.c (ft_raster1_render): Remove gray AA mode
+ remnants.
+
2015-01-18 Werner Lemberg <wl@gnu.org>
* src/base/ftobjs.c (FT_New_Library): Fix compiler warning.
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 65ba454..fd0481b 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -3108,6 +3108,9 @@
if ( params->flags & FT_RASTER_FLAG_DIRECT )
return FT_THROW( Unsupported );
+ if ( params->flags & FT_RASTER_FLAG_AA )
+ return FT_THROW( Unsupported );
+
if ( !target_map )
return FT_THROW( Invalid );
diff --git a/src/raster/ftrend1.c b/src/raster/ftrend1.c
index dc03b34..718d632 100644
--- a/src/raster/ftrend1.c
+++ b/src/raster/ftrend1.c
@@ -187,19 +187,8 @@
slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
- /* allocate new one, depends on pixel format */
- if ( !( mode & FT_RENDER_MODE_MONO ) )
- {
- /* we pad to 32 bits, only for backwards compatibility with FT 1.x */
- pitch = FT_PAD_CEIL( width, 4 );
- bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
- bitmap->num_grays = 256;
- }
- else
- {
- pitch = ( ( width + 15 ) >> 4 ) << 1;
- bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
- }
+ pitch = ( ( width + 15 ) >> 4 ) << 1;
+ bitmap->pixel_mode = FT_PIXEL_MODE_MONO;
bitmap->width = width;
bitmap->rows = height;
@@ -218,9 +207,6 @@
params.source = outline;
params.flags = 0;
- if ( bitmap->pixel_mode == FT_PIXEL_MODE_GRAY )
- params.flags |= FT_RASTER_FLAG_AA;
-
/* render outline into the bitmap */
error = render->raster_render( render->raster, ¶ms );