OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "core/fxcodec/include/fx_codec.h" | 10 #include "core/fxcodec/include/fx_codec.h" |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 bClearType = !!(text_flags & FXTEXT_CLEARTYPE); | 472 bClearType = !!(text_flags & FXTEXT_CLEARTYPE); |
473 } | 473 } |
474 bNormal = !bClearType; | 474 bNormal = !bClearType; |
475 } | 475 } |
476 } | 476 } |
477 } | 477 } |
478 if (!pCache) | 478 if (!pCache) |
479 pCache = CFX_GEModule::Get()->GetFontCache(); | 479 pCache = CFX_GEModule::Get()->GetFontCache(); |
480 | 480 |
481 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); | 481 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); |
482 FX_FONTCACHE_DEFINE(pCache, pFont); | 482 CFX_AutoFontCache autoFontCache(pCache, pFont); |
483 std::vector<FXTEXT_GLYPHPOS> glyphs(nChars); | 483 std::vector<FXTEXT_GLYPHPOS> glyphs(nChars); |
484 CFX_Matrix matrixCTM = GetCTM(); | 484 CFX_Matrix matrixCTM = GetCTM(); |
485 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a); | 485 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a); |
486 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d); | 486 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d); |
487 CFX_Matrix deviceCtm = char2device; | 487 CFX_Matrix deviceCtm = char2device; |
488 deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0); | 488 deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0); |
489 text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0); | 489 text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0); |
490 for (size_t i = 0; i < glyphs.size(); ++i) { | 490 for (size_t i = 0; i < glyphs.size(); ++i) { |
491 FXTEXT_GLYPHPOS& glyph = glyphs[i]; | 491 FXTEXT_GLYPHPOS& glyph = glyphs[i]; |
492 const FXTEXT_CHARPOS& charpos = pCharPos[i]; | 492 const FXTEXT_CHARPOS& charpos = pCharPos[i]; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 const CFX_Matrix* pUser2Device, | 627 const CFX_Matrix* pUser2Device, |
628 const CFX_GraphStateData* pGraphState, | 628 const CFX_GraphStateData* pGraphState, |
629 uint32_t fill_color, | 629 uint32_t fill_color, |
630 FX_ARGB stroke_color, | 630 FX_ARGB stroke_color, |
631 CFX_PathData* pClippingPath, | 631 CFX_PathData* pClippingPath, |
632 int nFlag) { | 632 int nFlag) { |
633 if (!pCache) | 633 if (!pCache) |
634 pCache = CFX_GEModule::Get()->GetFontCache(); | 634 pCache = CFX_GEModule::Get()->GetFontCache(); |
635 | 635 |
636 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); | 636 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); |
637 FX_FONTCACHE_DEFINE(pCache, pFont); | 637 CFX_AutoFontCache autoFontCache(pCache, pFont); |
638 for (int iChar = 0; iChar < nChars; iChar++) { | 638 for (int iChar = 0; iChar < nChars; iChar++) { |
639 const FXTEXT_CHARPOS& charpos = pCharPos[iChar]; | 639 const FXTEXT_CHARPOS& charpos = pCharPos[iChar]; |
640 CFX_Matrix matrix; | 640 CFX_Matrix matrix; |
641 if (charpos.m_bGlyphAdjust) | 641 if (charpos.m_bGlyphAdjust) |
642 matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1], | 642 matrix.Set(charpos.m_AdjustMatrix[0], charpos.m_AdjustMatrix[1], |
643 charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0); | 643 charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3], 0, 0); |
644 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, | 644 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, |
645 charpos.m_OriginY); | 645 charpos.m_OriginY); |
646 const CFX_PathData* pPath = pFaceCache->LoadGlyphPath( | 646 const CFX_PathData* pPath = pFaceCache->LoadGlyphPath( |
647 pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth); | 647 pFont, charpos.m_GlyphIndex, charpos.m_FontCharWidth); |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 void _CFX_UniqueKeyGen::Generate(int count, ...) { | 1402 void _CFX_UniqueKeyGen::Generate(int count, ...) { |
1403 va_list argList; | 1403 va_list argList; |
1404 va_start(argList, count); | 1404 va_start(argList, count); |
1405 for (int i = 0; i < count; i++) { | 1405 for (int i = 0; i < count; i++) { |
1406 int p = va_arg(argList, int); | 1406 int p = va_arg(argList, int); |
1407 ((uint32_t*)m_Key)[i] = p; | 1407 ((uint32_t*)m_Key)[i] = p; |
1408 } | 1408 } |
1409 va_end(argList); | 1409 va_end(argList); |
1410 m_KeyLen = count * sizeof(uint32_t); | 1410 m_KeyLen = count * sizeof(uint32_t); |
1411 } | 1411 } |
OLD | NEW |