summaryrefslogtreecommitdiff
path: root/core/fxge/skia
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/skia
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/skia')
-rw-r--r--core/fxge/skia/fx_skia_device.cpp9
-rw-r--r--core/fxge/skia/fx_skia_device.h2
-rw-r--r--core/fxge/skia/fx_skia_device_unittest.cpp3
3 files changed, 7 insertions, 7 deletions
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 8263cf66f5..431491d826 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -802,8 +802,9 @@ class SkiaState {
vFlip *= -1;
for (int index = 0; index < nChars; ++index) {
const FXTEXT_CHARPOS& cp = pCharPos[index];
- m_positions[index + count] = {cp.m_OriginX * flip, cp.m_OriginY * vFlip};
- m_glyphs[index + count] = (uint16_t)cp.m_GlyphIndex;
+ m_positions[index + count] = {cp.m_Origin.x * flip,
+ cp.m_Origin.y * vFlip};
+ m_glyphs[index + count] = static_cast<uint16_t>(cp.m_GlyphIndex);
}
SkPoint delta;
if (MatrixOffset(pMatrix, &delta)) {
@@ -1289,8 +1290,8 @@ bool CFX_SkiaDeviceDriver::DrawDeviceText(int nChars,
glyphs.setCount(nChars);
for (int index = 0; index < nChars; ++index) {
const FXTEXT_CHARPOS& cp = pCharPos[index];
- positions[index] = {cp.m_OriginX * flip, cp.m_OriginY * vFlip};
- glyphs[index] = (uint16_t)cp.m_GlyphIndex;
+ positions[index] = {cp.m_Origin.x * flip, cp.m_Origin.y * vFlip};
+ glyphs[index] = static_cast<uint16_t>(cp.m_GlyphIndex);
}
#ifdef _SKIA_SUPPORT_PATHS_
m_pBitmap->PreMultiply();
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index ff81daef46..ecb1104518 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -13,13 +13,13 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/ifx_renderdevicedriver.h"
+class FXTEXT_CHARPOS;
class SkCanvas;
class SkMatrix;
class SkPaint;
class SkPath;
class SkPictureRecorder;
class SkiaState;
-struct FXTEXT_CHARPOS;
struct SkIRect;
class CFX_SkiaDeviceDriver : public IFX_RenderDeviceDriver {
diff --git a/core/fxge/skia/fx_skia_device_unittest.cpp b/core/fxge/skia/fx_skia_device_unittest.cpp
index 3b799e6190..afd47780d7 100644
--- a/core/fxge/skia/fx_skia_device_unittest.cpp
+++ b/core/fxge/skia/fx_skia_device_unittest.cpp
@@ -36,8 +36,7 @@ void EmptyTest(CFX_SkiaDeviceDriver* driver, const State&) {
void CommonTest(CFX_SkiaDeviceDriver* driver, const State& state) {
FXTEXT_CHARPOS charPos[1];
- charPos[0].m_OriginX = 0;
- charPos[0].m_OriginY = 1;
+ charPos[0].m_Origin = CFX_PointF(0, 1);
charPos[0].m_GlyphIndex = 1;
charPos[0].m_FontCharWidth = 4;