summaryrefslogtreecommitdiff
path: root/core/fxge/ge
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-16 13:42:11 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-16 19:05:27 +0000
commit2c02faed1da2375a91c7f9c003beb606a0611074 (patch)
tree81529e4ecb5e30bcd7274ae91376776f928d6e7f /core/fxge/ge
parentabf240c57ff461f04a1766cce585cf54521e2170 (diff)
downloadpdfium-2c02faed1da2375a91c7f9c003beb606a0611074.tar.xz
Change FXTEXT_CHARPOS to use CFX_PointF
This CL updates the Origin x,y coordinates in FXTEXT_CHARPOS to be an CFX_PointF. Change-Id: I67281db2cb82687e12490145f7c99aee908e5fa8 Reviewed-on: https://pdfium-review.googlesource.com/2718 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fxge/ge')
-rw-r--r--core/fxge/ge/cfx_renderdevice.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/core/fxge/ge/cfx_renderdevice.cpp b/core/fxge/ge/cfx_renderdevice.cpp
index d2c677ecc2..f2bf48912c 100644
--- a/core/fxge/ge/cfx_renderdevice.cpp
+++ b/core/fxge/ge/cfx_renderdevice.cpp
@@ -346,6 +346,21 @@ bool ShouldDrawDeviceText(const CFX_Font* pFont, uint32_t text_flags) {
} // namespace
+FXTEXT_CHARPOS::FXTEXT_CHARPOS()
+ : m_GlyphIndex(0),
+ m_FontCharWidth(0),
+#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_
+ m_ExtGID(0),
+#endif
+ m_FallbackFontPosition(0),
+ m_bGlyphAdjust(false),
+ m_bFontStyle(false) {
+}
+
+FXTEXT_CHARPOS::FXTEXT_CHARPOS(const FXTEXT_CHARPOS&) = default;
+
+FXTEXT_CHARPOS::~FXTEXT_CHARPOS(){};
+
CFX_RenderDevice::CFX_RenderDevice()
: m_pBitmap(nullptr),
m_Width(0),
@@ -912,8 +927,9 @@ bool CFX_RenderDevice::DrawNormalText(int nChars,
for (size_t i = 0; i < glyphs.size(); ++i) {
FXTEXT_GLYPHPOS& glyph = glyphs[i];
const FXTEXT_CHARPOS& charpos = pCharPos[i];
- glyph.m_fOriginX = charpos.m_OriginX;
- glyph.m_fOriginY = charpos.m_OriginY;
+ glyph.m_fOriginX = charpos.m_Origin.x;
+ glyph.m_fOriginY = charpos.m_Origin.y;
+
text2Device.TransformPoint(glyph.m_fOriginX, glyph.m_fOriginY);
if (anti_alias < FXFT_RENDER_MODE_LCD)
glyph.m_OriginX = FXSYS_round(glyph.m_fOriginX);
@@ -1069,8 +1085,8 @@ bool CFX_RenderDevice::DrawTextPath(int nChars,
charpos.m_AdjustMatrix[2], charpos.m_AdjustMatrix[3],
0, 0);
}
- matrix.Concat(CFX_Matrix(font_size, 0, 0, font_size, charpos.m_OriginX,
- charpos.m_OriginY));
+ matrix.Concat(CFX_Matrix(font_size, 0, 0, font_size, charpos.m_Origin.x,
+ charpos.m_Origin.y));
const CFX_PathData* pPath =
pFont->LoadGlyphPath(charpos.m_GlyphIndex, charpos.m_FontCharWidth);
if (!pPath)