summaryrefslogtreecommitdiff
path: root/core/src/fxge/ge
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-08-13 17:49:51 -0700
committerTom Sepez <tsepez@chromium.org>2015-08-13 17:49:51 -0700
commit97108cb8cd9318be6cdf62cba7447a373910f349 (patch)
treee7e2db2a7ef07243c65b3c9c8fdfdd4ce4b0beb1 /core/src/fxge/ge
parent371c87f65f2545ac329ca2f8db9c1f964babf1aa (diff)
downloadpdfium-97108cb8cd9318be6cdf62cba7447a373910f349.tar.xz
Merge to XFA: OutputText() is dead code.
(cherry picked from commit dbf5f4cc33561223587d2535bbdeefae330fecfe) Original Review URL: https://codereview.chromium.org/1291213003 . TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1287263003 .
Diffstat (limited to 'core/src/fxge/ge')
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp101
1 files changed, 0 insertions, 101 deletions
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index 124ee7d88d..b3273f78eb 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -1617,107 +1617,6 @@ CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont,
}
return pGlyphBitmap;
}
-FX_BOOL _OutputGlyph(void* dib,
- int x,
- int y,
- CFX_Font* pFont,
- int glyph_index,
- FX_ARGB argb) {
- CFX_DIBitmap* pDib = (CFX_DIBitmap*)dib;
- FXFT_Face face = pFont->GetFace();
- int error = FXFT_Load_Glyph(face, glyph_index, FXFT_LOAD_NO_BITMAP);
- if (error) {
- return FALSE;
- }
- error = FXFT_Render_Glyph(face, FXFT_RENDER_MODE_NORMAL);
- if (error) {
- return FALSE;
- }
- int bmwidth = FXFT_Get_Bitmap_Width(FXFT_Get_Glyph_Bitmap(face));
- int bmheight = FXFT_Get_Bitmap_Rows(FXFT_Get_Glyph_Bitmap(face));
- int left = FXFT_Get_Glyph_BitmapLeft(face);
- int top = FXFT_Get_Glyph_BitmapTop(face);
- const uint8_t* src_buf =
- (const uint8_t*)FXFT_Get_Bitmap_Buffer(FXFT_Get_Glyph_Bitmap(face));
- int src_pitch = FXFT_Get_Bitmap_Pitch(FXFT_Get_Glyph_Bitmap(face));
- CFX_DIBitmap mask;
- mask.Create(bmwidth, bmheight, FXDIB_8bppMask);
- uint8_t* dest_buf = mask.GetBuffer();
- int dest_pitch = mask.GetPitch();
- for (int row = 0; row < bmheight; row++) {
- const uint8_t* src_scan = src_buf + row * src_pitch;
- uint8_t* dest_scan = dest_buf + row * dest_pitch;
- FXSYS_memcpy(dest_scan, src_scan, dest_pitch);
- }
- pDib->CompositeMask(x + left, y - top, bmwidth, bmheight, &mask, argb, 0, 0);
- return TRUE;
-}
-FX_BOOL OutputText(void* dib,
- int x,
- int y,
- CFX_Font* pFont,
- double font_size,
- CFX_AffineMatrix* pText_matrix,
- unsigned short const* text,
- unsigned long argb) {
- if (!pFont) {
- return FALSE;
- }
- FXFT_Face face = pFont->GetFace();
- FXFT_Select_Charmap(pFont->m_Face, FXFT_ENCODING_UNICODE);
- if (pText_matrix) {
- FXFT_Matrix ft_matrix;
- ft_matrix.xx = (signed long)(pText_matrix->a / 64 * 65536);
- ft_matrix.xy = (signed long)(pText_matrix->c / 64 * 65536);
- ft_matrix.yx = (signed long)(pText_matrix->b / 64 * 65536);
- ft_matrix.yy = (signed long)(pText_matrix->d / 64 * 65536);
- FXFT_Set_Transform(face, &ft_matrix, 0);
- }
- FX_FLOAT x_pos = 0;
- for (; *text != 0; text++) {
- FX_WCHAR unicode = *text;
- int glyph_index = FXFT_Get_Char_Index(pFont->m_Face, unicode);
- if (glyph_index <= 0) {
- continue;
- }
- int err = FXFT_Load_Glyph(
- pFont->m_Face, glyph_index,
- FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
- if (err) {
- continue;
- }
- int w = FXFT_Get_Glyph_HoriAdvance(pFont->m_Face);
- int em = FXFT_Get_Face_UnitsPerEM(pFont->m_Face);
- FX_FLOAT x1, y1;
- pText_matrix->Transform(x_pos, 0, x1, y1);
- _OutputGlyph(dib, (int)x1 + x, (int)-y1 + y, pFont, glyph_index, argb);
- x_pos += (FX_FLOAT)w / em;
- }
- return TRUE;
-}
-FX_BOOL OutputGlyph(void* dib,
- int x,
- int y,
- CFX_Font* pFont,
- double font_size,
- CFX_AffineMatrix* pMatrix,
- unsigned long glyph_index,
- unsigned long argb) {
- FXFT_Matrix ft_matrix;
- if (pMatrix) {
- ft_matrix.xx = (signed long)(pMatrix->a * font_size / 64 * 65536);
- ft_matrix.xy = (signed long)(pMatrix->c * font_size / 64 * 65536);
- ft_matrix.yx = (signed long)(pMatrix->b * font_size / 64 * 65536);
- ft_matrix.yy = (signed long)(pMatrix->d * font_size / 64 * 65536);
- } else {
- ft_matrix.xx = (signed long)(font_size / 64 * 65536);
- ft_matrix.xy = ft_matrix.yx = 0;
- ft_matrix.yy = (signed long)(font_size / 64 * 65536);
- }
- FXFT_Set_Transform(pFont->m_Face, &ft_matrix, 0);
- FX_BOOL ret = _OutputGlyph(dib, x, y, pFont, glyph_index, argb);
- return ret;
-}
const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont,
FX_DWORD glyph_index,
int dest_width) {