diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-02-21 12:56:43 -0500 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-21 19:46:30 +0000 |
commit | b97f8d578f6a11962f36d522bd1dbf33064e7461 (patch) | |
tree | 0a527c7a5c973fd4402a757f78c73e1c3a4ab1ae /core | |
parent | 1f403cee9478021862c7cc4e516907bd51e8f0f6 (diff) | |
download | pdfium-b97f8d578f6a11962f36d522bd1dbf33064e7461.tar.xz |
Cleanup StreamContentParser transform methods
The ConvertTextSpace method was called once, and it was the only caller of
ConvertUserSpace. Fold both methods back into the callsite and convert the
use of TransformPoint to Transform.
Change-Id: Ia09ec8846c28603df0616135ba1519dbbba219c3
Reviewed-on: https://pdfium-review.googlesource.com/2810
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser.cpp | 18 | ||||
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser.h | 2 |
2 files changed, 5 insertions, 15 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp index e991e456b7..8015a8df45 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp @@ -1229,16 +1229,6 @@ CPDF_Pattern* CPDF_StreamContentParser::FindPattern(const CFX_ByteString& name, m_pCurStates->m_ParentMatrix); } -void CPDF_StreamContentParser::ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y) { - m_pCurStates->m_TextMatrix.TransformPoint(x, y); - ConvertUserSpace(x, y); -} - -void CPDF_StreamContentParser::ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y) { - m_pCurStates->m_CTM.TransformPoint(x, y); - m_mtContentToUser.TransformPoint(x, y); -} - void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs, FX_FLOAT fInitKerning, FX_FLOAT* pKerning, @@ -1276,9 +1266,11 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs, pCTM[3] = m_pCurStates->m_CTM.d; } pText->SetSegments(pStrs, pKerning, nsegs); - pText->m_Pos = CFX_PointF(m_pCurStates->m_TextX, - m_pCurStates->m_TextY + m_pCurStates->m_TextRise); - ConvertTextSpace(pText->m_Pos.x, pText->m_Pos.y); + pText->m_Pos = m_mtContentToUser.Transform( + m_pCurStates->m_CTM.Transform(m_pCurStates->m_TextMatrix.Transform( + CFX_PointF(m_pCurStates->m_TextX, + m_pCurStates->m_TextY + m_pCurStates->m_TextRise)))); + FX_FLOAT x_advance; FX_FLOAT y_advance; pText->CalcPositionData(&x_advance, &y_advance, diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h index ca7ea7c106..cd41990b0a 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.h +++ b/core/fpdfapi/page/cpdf_streamcontentparser.h @@ -92,8 +92,6 @@ class CPDF_StreamContentParser { FX_FLOAT* pKerning, int count); - void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y); - void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y); void OnChangeTextMatrix(); void ParsePathObject(); void AddPathPoint(FX_FLOAT x, FX_FLOAT y, FXPT_TYPE type, bool close); |