summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-02-23 15:23:29 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-02-23 15:23:29 -0500
commit2c8fad44315db58f5b3222161dcb699691dca904 (patch)
tree70e9bdf55e1e3197d8bd088abd103012b602e32f /core/src/fpdfapi/fpdf_page
parent2886a25b68225ad3ad70d417b01108ad1d126488 (diff)
downloadpdfium-2c8fad44315db58f5b3222161dcb699691dca904.tar.xz
Remove FXSYS_Mul.
This define just multiples the two parameters together. Inline the *'s. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1729613003 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp8
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp15
3 files changed, 11 insertions, 16 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index be038004ac..81cf92ee05 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -246,7 +246,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i];
if (i > 0) {
if (charcode == (FX_DWORD)-1) {
- curpos -= FXSYS_Mul(m_pCharPos[i - 1], fontsize) / 1000;
+ curpos -= (m_pCharPos[i - 1] * fontsize) / 1000;
continue;
}
m_pCharPos[i - 1] = curpos;
@@ -336,7 +336,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
max_x = max_x * fontsize / 1000;
} else {
if (pTextAdvanceX) {
- *pTextAdvanceX = FXSYS_Mul(curpos, horz_scale);
+ *pTextAdvanceX = curpos * horz_scale;
}
if (pTextAdvanceY) {
*pTextAdvanceY = 0;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index bee4a5b707..de3a6572f2 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -315,13 +315,13 @@ void CPDF_TextState::SetFont(CPDF_Font* pFont) {
FX_FLOAT CPDF_TextState::GetFontSizeV() const {
FX_FLOAT* pMatrix = GetMatrix();
FX_FLOAT unit = FXSYS_sqrt2(pMatrix[1], pMatrix[3]);
- FX_FLOAT size = FXSYS_Mul(unit, GetFontSize());
+ FX_FLOAT size = unit * GetFontSize();
return (FX_FLOAT)FXSYS_fabs(size);
}
FX_FLOAT CPDF_TextState::GetFontSizeH() const {
FX_FLOAT* pMatrix = GetMatrix();
FX_FLOAT unit = FXSYS_sqrt2(pMatrix[0], pMatrix[2]);
- FX_FLOAT size = FXSYS_Mul(unit, GetFontSize());
+ FX_FLOAT size = unit * GetFontSize();
return (FX_FLOAT)FXSYS_fabs(size);
}
FX_FLOAT CPDF_TextState::GetBaselineAngle() const {
@@ -449,10 +449,10 @@ void CPDF_AllStates::SetLineDash(CPDF_Array* pArray,
FX_FLOAT phase,
FX_FLOAT scale) {
CFX_GraphStateData* pData = m_GraphState.GetModify();
- pData->m_DashPhase = FXSYS_Mul(phase, scale);
+ pData->m_DashPhase = phase * scale;
pData->SetDashCount(pArray->GetCount());
for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
- pData->m_DashArray[i] = FXSYS_Mul(pArray->GetNumberAt(i), scale);
+ pData->m_DashArray[i] = pArray->GetNumberAt(i) * scale;
}
}
void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS,
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index efe0f25a9f..fe07a63bca 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -1351,12 +1351,10 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs,
if (fInitKerning != 0) {
if (!pFont->IsVertWriting()) {
m_pCurStates->m_TextX -=
- FXSYS_Mul(fInitKerning, m_pCurStates->m_TextState.GetFontSize()) /
- 1000;
+ (fInitKerning * m_pCurStates->m_TextState.GetFontSize()) / 1000;
} else {
m_pCurStates->m_TextY -=
- FXSYS_Mul(fInitKerning, m_pCurStates->m_TextState.GetFontSize()) /
- 1000;
+ (fInitKerning * m_pCurStates->m_TextState.GetFontSize()) / 1000;
}
}
if (nsegs == 0) {
@@ -1396,13 +1394,11 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs,
if (pKerning && pKerning[nsegs - 1] != 0) {
if (!pFont->IsVertWriting()) {
m_pCurStates->m_TextX -=
- FXSYS_Mul(pKerning[nsegs - 1],
- m_pCurStates->m_TextState.GetFontSize()) /
+ (pKerning[nsegs - 1] * m_pCurStates->m_TextState.GetFontSize()) /
1000;
} else {
m_pCurStates->m_TextY -=
- FXSYS_Mul(pKerning[nsegs - 1],
- m_pCurStates->m_TextState.GetFontSize()) /
+ (pKerning[nsegs - 1] * m_pCurStates->m_TextState.GetFontSize()) /
1000;
}
}
@@ -1430,8 +1426,7 @@ void CPDF_StreamContentParser::Handle_ShowText_Positioning() {
if (nsegs == 0) {
for (int i = 0; i < n; i++) {
m_pCurStates->m_TextX -=
- FXSYS_Mul(pArray->GetNumberAt(i),
- m_pCurStates->m_TextState.GetFontSize()) /
+ (pArray->GetNumberAt(i) * m_pCurStates->m_TextState.GetFontSize()) /
1000;
}
return;