Commit 66e446c5 authored by Byeongsik Jeon's avatar Byeongsik Jeon Committed by Alexandre Julliard

gdi32: Improves the subpixel rendering availability for FreeType 2.8.1+.

FreeType 2.8.1+ implemented its own subpixel rendering. So FT_Err_Uniplemented_Feature check is not the reliable way. Signed-off-by: 's avatarByeongsik Jeon <bsjeon@hanmail.net> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 935eed8e
......@@ -993,18 +993,22 @@ static BOOL is_hinting_enabled(void)
static BOOL is_subpixel_rendering_enabled( void )
{
#ifdef FT_LCD_FILTER_H
static int enabled = -1;
if (enabled == -1)
{
enabled = (pFT_Library_SetLcdFilter &&
pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature);
/* FreeType >= 2.8.1 offers LCD-optimezed rendering without lcd filters. */
if (FT_SimpleVersion >= ((2 << 16) | (8 << 8) | (1 << 0)))
enabled = TRUE;
#ifdef FT_LCD_FILTER_H
else if (pFT_Library_SetLcdFilter &&
pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature)
enabled = TRUE;
#endif
else enabled = FALSE;
TRACE("subpixel rendering is %senabled\n", enabled ? "" : "NOT ");
}
return enabled;
#else
return FALSE;
#endif
}
......@@ -7274,7 +7278,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
case WINE_GGO_HBGR_BITMAP:
case WINE_GGO_VRGB_BITMAP:
case WINE_GGO_VBGR_BITMAP:
#ifdef FT_LCD_FILTER_H
{
switch (ft_face->glyph->format)
{
......@@ -7360,8 +7363,10 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
if ( needsTransform )
pFT_Outline_Transform (&ft_face->glyph->outline, &transMatTategaki);
#ifdef FT_LCD_FILTER_H
if ( pFT_Library_SetLcdFilter )
pFT_Library_SetLcdFilter( library, FT_LCD_FILTER_DEFAULT );
#endif
pFT_Render_Glyph (ft_face->glyph, render_mode);
src = ft_face->glyph->bitmap.buffer;
......@@ -7442,9 +7447,6 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
break;
}
#else
return GDI_ERROR;
#endif
case GGO_NATIVE:
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment