From 71c24b839498fb89184002ed30fcff353e1e402c Mon Sep 17 00:00:00 2001 From: John Abd-El-Malek Date: Fri, 30 Jan 2015 16:55:08 -0800 Subject: Use system FreeType on Linux. This saves 406KB in the binary size of the plugin. More importantly, it gets rid of the linker flag preventing bundling PDFium into the Chromium binary. BUG=453844 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/826613004 --- core/src/fxge/ge/fx_ge_text.cpp | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'core/src') diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp index eb9b7d0a13..aca739afae 100644 --- a/core/src/fxge/ge/fx_ge_text.cpp +++ b/core/src/fxge/ge/fx_ge_text.cpp @@ -1332,12 +1332,10 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde pFont->AdjustMMParams(glyph_index, dest_width, pFont->GetSubstFont()->m_Weight); } } - int transflag = FXFT_Get_Face_Internal_Flag(m_Face); FXFT_Set_Transform(m_Face, &ft_matrix, 0); int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT) ? FXFT_LOAD_NO_BITMAP : (FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING); int error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags); if (error) { - FXFT_Set_Face_Internal_Flag(m_Face, transflag); return NULL; } int weight = 0; @@ -1349,7 +1347,6 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde if (pSubstFont && !(pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) && weight > 400) { int index = (weight - 400) / 10; if (index >= WEIGHTPOW_ARRAY_SIZE) { - FXFT_Set_Face_Internal_Flag(m_Face, transflag); return NULL; } int level = 0; @@ -1363,13 +1360,11 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde FXFT_Library_SetLcdFilter(CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary, FT_LCD_FILTER_DEFAULT); error = FXFT_Render_Glyph(m_Face, anti_alias); if (error) { - FXFT_Set_Face_Internal_Flag(m_Face, transflag); return NULL; } int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(m_Face)); int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(m_Face)); if (bmwidth > 2048 || bmheight > 2048) { - FXFT_Set_Face_Internal_Flag(m_Face, transflag); return NULL; } int dib_width = bmwidth; @@ -1406,7 +1401,6 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont, FX_DWORD glyph_inde _GammaAdjust(pDestBuf, bmwidth, bmheight, dest_pitch, CFX_GEModule::Get()->GetTextGammaTable()); } } - FXFT_Set_Face_Internal_Flag(m_Face, transflag); return pGlyphBitmap; } FX_BOOL _OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, @@ -1448,7 +1442,6 @@ FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size, } FXFT_Face face = pFont->GetFace(); FXFT_Select_Charmap(pFont->m_Face, FXFT_ENCODING_UNICODE); - int transflag = FXFT_Get_Face_Internal_Flag(pFont->m_Face); if (pText_matrix) { FXFT_Matrix ft_matrix; ft_matrix.xx = (signed long)(pText_matrix->a / 64 * 65536); @@ -1476,7 +1469,6 @@ FX_BOOL OutputText(void* dib, int x, int y, CFX_Font* pFont, double font_size, glyph_index, argb); x_pos += (FX_FLOAT)w / em; } - FXFT_Set_Face_Internal_Flag(pFont->m_Face, transflag); return TRUE; } FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size, @@ -1493,11 +1485,9 @@ FX_BOOL OutputGlyph(void* dib, int x, int y, CFX_Font* pFont, double font_size, ft_matrix.xy = ft_matrix.yx = 0; ft_matrix.yy = (signed long)(font_size / 64 * 65536); } - int transflag = FXFT_Get_Face_Internal_Flag(pFont->m_Face); FXFT_Set_Transform(pFont->m_Face, &ft_matrix, 0); FX_BOOL ret = _OutputGlyph(dib, x, y, pFont, glyph_index, argb); - FXFT_Set_Face_Internal_Flag(pFont->m_Face, transflag); return ret; } const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont, FX_DWORD glyph_index, int dest_width) @@ -1644,12 +1634,10 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width) AdjustMMParams(glyph_index, dest_width, m_pSubstFont->m_Weight); } } - int transflag = FXFT_Get_Face_Internal_Flag(m_Face); FXFT_Set_Transform(m_Face, &ft_matrix, 0); int load_flags = (m_Face->face_flags & FT_FACE_FLAG_SFNT) ? FXFT_LOAD_NO_BITMAP : FXFT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING; int error = FXFT_Load_Glyph(m_Face, glyph_index, load_flags); if (error) { - FXFT_Set_Face_Internal_Flag(m_Face, transflag); return NULL; } if (m_pSubstFont && !(m_pSubstFont->m_SubstFlags & FXFONT_SUBST_MM) && m_pSubstFont->m_Weight > 400) { @@ -1676,7 +1664,6 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width) params.m_PointCount = 0; FXFT_Outline_Decompose(FXFT_Get_Glyph_Outline(m_Face), &funcs, ¶ms); if (params.m_PointCount == 0) { - FXFT_Set_Face_Internal_Flag(m_Face, transflag); return NULL; } CFX_PathData* pPath = FX_NEW CFX_PathData; @@ -1695,7 +1682,6 @@ CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width) if (params.m_PointCount) { pPath->GetPoints()[params.m_PointCount - 1].m_Flag |= FXPT_CLOSEFIGURE; } - FXFT_Set_Face_Internal_Flag(m_Face, transflag); return pPath; } void _CFX_UniqueKeyGen::Generate(int count, ...) -- cgit v1.2.3