summaryrefslogtreecommitdiff
path: root/fpdfsdk/fxedit
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-23 09:25:17 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-23 14:49:18 +0000
commita0061afa12e0fec210727c9478adb8ac78c5d63c (patch)
tree340b7f1eb44ef89122fa5dc8e952e2a19c39c02f /fpdfsdk/fxedit
parentb147e07ee36be10ca0796a6566be107077c21a03 (diff)
downloadpdfium-a0061afa12e0fec210727c9478adb8ac78c5d63c.tar.xz
Convert TransformPoint calls to Transform calls
This Cl converts remaining calls to TransformPoint to use Transform instead. Change-Id: I7a2c000492da5dda3975b4449812f281816fdab6 Reviewed-on: https://pdfium-review.googlesource.com/2822 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/fxedit')
-rw-r--r--fpdfsdk/fxedit/fxet_edit.cpp55
-rw-r--r--fpdfsdk/fxedit/fxet_edit.h1
2 files changed, 12 insertions, 44 deletions
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index 5b6fd55685..1acc57795a 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -63,10 +63,8 @@ void DrawTextString(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
const CFX_ByteString& str,
FX_ARGB crTextFill,
- FX_ARGB crTextStroke,
int32_t nHorzScale) {
- FX_FLOAT x = pt.x, y = pt.y;
- pUser2Device->TransformPoint(x, y);
+ CFX_PointF pos = pUser2Device->Transform(pt);
if (pFont) {
if (nHorzScale != 100) {
@@ -77,44 +75,16 @@ void DrawTextString(CFX_RenderDevice* pDevice,
ro.m_Flags = RENDER_CLEARTYPE;
ro.m_ColorMode = RENDER_COLOR_NORMAL;
- if (crTextStroke != 0) {
- CFX_PointF pt1;
- CFX_PointF pt2;
- pUser2Device->TransformPoint(pt1.x, pt1.y);
- pUser2Device->TransformPoint(pt2.x, pt2.y);
- CFX_GraphStateData gsd;
- gsd.m_LineWidth =
- (FX_FLOAT)FXSYS_fabs((pt2.x + pt2.y) - (pt1.x + pt1.y));
-
- CPDF_TextRenderer::DrawTextString(pDevice, x, y, pFont, fFontSize, &mt,
- str, crTextFill, crTextStroke, &gsd,
- &ro);
- } else {
- CPDF_TextRenderer::DrawTextString(pDevice, x, y, pFont, fFontSize, &mt,
- str, crTextFill, 0, nullptr, &ro);
- }
+ CPDF_TextRenderer::DrawTextString(pDevice, pos.x, pos.y, pFont, fFontSize,
+ &mt, str, crTextFill, nullptr, &ro);
} else {
CPDF_RenderOptions ro;
ro.m_Flags = RENDER_CLEARTYPE;
ro.m_ColorMode = RENDER_COLOR_NORMAL;
- if (crTextStroke != 0) {
- CFX_PointF pt1;
- CFX_PointF pt2;
- pUser2Device->TransformPoint(pt1.x, pt1.y);
- pUser2Device->TransformPoint(pt2.x, pt2.y);
- CFX_GraphStateData gsd;
- gsd.m_LineWidth =
- (FX_FLOAT)FXSYS_fabs((pt2.x + pt2.y) - (pt1.x + pt1.y));
-
- CPDF_TextRenderer::DrawTextString(pDevice, x, y, pFont, fFontSize,
- pUser2Device, str, crTextFill,
- crTextStroke, &gsd, &ro);
- } else {
- CPDF_TextRenderer::DrawTextString(pDevice, x, y, pFont, fFontSize,
- pUser2Device, str, crTextFill, 0,
- nullptr, &ro);
- }
+ CPDF_TextRenderer::DrawTextString(pDevice, pos.x, pos.y, pFont, fFontSize,
+ pUser2Device, str, crTextFill, nullptr,
+ &ro);
}
}
}
@@ -748,7 +718,6 @@ void CFX_Edit::DrawEdit(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
CFX_Edit* pEdit,
FX_COLORREF crTextFill,
- FX_COLORREF crTextStroke,
const CFX_FloatRect& rcClip,
const CFX_PointF& ptOffset,
const CPVT_WordRange* pRange,
@@ -830,7 +799,7 @@ void CFX_Edit::DrawEdit(CFX_RenderDevice* pDevice,
DrawTextString(
pDevice, CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device,
- sTextBuf.MakeString(), crOldFill, crTextStroke, nHorzScale);
+ sTextBuf.MakeString(), crOldFill, nHorzScale);
sTextBuf.Clear();
}
@@ -848,17 +817,17 @@ void CFX_Edit::DrawEdit(CFX_RenderDevice* pDevice,
word.ptWord.y + ptOffset.y),
pFontMap->GetPDFFont(word.nFontIndex), fFontSize, pUser2Device,
GetPDFWordString(pFontMap, word.nFontIndex, word.Word, SubWord),
- crCurFill, crTextStroke, nHorzScale);
+ crCurFill, nHorzScale);
}
oldplace = place;
}
}
if (sTextBuf.GetLength() > 0) {
- DrawTextString(
- pDevice, CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
- pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device,
- sTextBuf.MakeString(), crOldFill, crTextStroke, nHorzScale);
+ DrawTextString(pDevice,
+ CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
+ pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device,
+ sTextBuf.MakeString(), crOldFill, nHorzScale);
}
}
diff --git a/fpdfsdk/fxedit/fxet_edit.h b/fpdfsdk/fxedit/fxet_edit.h
index c8caeb9844..ab83af2e3b 100644
--- a/fpdfsdk/fxedit/fxet_edit.h
+++ b/fpdfsdk/fxedit/fxet_edit.h
@@ -324,7 +324,6 @@ class CFX_Edit {
CFX_Matrix* pUser2Device,
CFX_Edit* pEdit,
FX_COLORREF crTextFill,
- FX_COLORREF crTextStroke,
const CFX_FloatRect& rcClip,
const CFX_PointF& ptOffset,
const CPVT_WordRange* pRange,