summaryrefslogtreecommitdiff
path: root/third_party/freetype/src/base/ftlcdfil.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/freetype/src/base/ftlcdfil.c')
-rw-r--r--third_party/freetype/src/base/ftlcdfil.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/third_party/freetype/src/base/ftlcdfil.c b/third_party/freetype/src/base/ftlcdfil.c
index ff6f7e98ce..f8e1709e92 100644
--- a/third_party/freetype/src/base/ftlcdfil.c
+++ b/third_party/freetype/src/base/ftlcdfil.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for color filtering of subpixel bitmap glyphs (body). */
/* */
-/* Copyright 2006-2015 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -296,6 +296,8 @@
return FT_THROW( Invalid_Argument );
ft_memcpy( library->lcd_weights, weights, 5 );
+ library->lcd_filter_func = _ft_lcd_filter_fir;
+ library->lcd_extra = 2;
return FT_Err_Ok;
}
@@ -305,12 +307,10 @@
FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter )
{
+ static const FT_Byte default_filter[5] =
+ { 0x08, 0x4d, 0x56, 0x4d, 0x08 };
static const FT_Byte light_filter[5] =
{ 0x00, 0x55, 0x56, 0x55, 0x00 };
- /* the values here sum up to a value larger than 256, */
- /* providing a cheap gamma correction */
- static const FT_Byte default_filter[5] =
- { 0x10, 0x40, 0x70, 0x40, 0x10 };
if ( !library )
@@ -324,25 +324,9 @@
break;
case FT_LCD_FILTER_DEFAULT:
-#if defined( FT_FORCE_LEGACY_LCD_FILTER )
-
- library->lcd_filter_func = _ft_lcd_filter_legacy;
- library->lcd_extra = 0;
-
-#elif defined( FT_FORCE_LIGHT_LCD_FILTER )
-
- ft_memcpy( library->lcd_weights, light_filter, 5 );
- library->lcd_filter_func = _ft_lcd_filter_fir;
- library->lcd_extra = 2;
-
-#else
-
ft_memcpy( library->lcd_weights, default_filter, 5 );
library->lcd_filter_func = _ft_lcd_filter_fir;
library->lcd_extra = 2;
-
-#endif
-
break;
case FT_LCD_FILTER_LIGHT:
@@ -354,6 +338,7 @@
#ifdef USE_LEGACY
case FT_LCD_FILTER_LEGACY:
+ case FT_LCD_FILTER_LEGACY1:
library->lcd_filter_func = _ft_lcd_filter_legacy;
library->lcd_extra = 0;
break;