Move class TextCharPos into its own file.

Move it out of cfx_renderdevice.h, just like with TextGlyphPos.
Adjust #includes and forward declarations.

Change-Id: I875f34361a05ac779d6b13a4562a20b9969b795a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/56650
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxge/BUILD.gn b/core/fxge/BUILD.gn
index 3461a6b..c6a74d8 100644
--- a/core/fxge/BUILD.gn
+++ b/core/fxge/BUILD.gn
@@ -108,6 +108,8 @@
     "scoped_font_transform.h",
     "scoped_font_transform.h",
     "systemfontinfo_iface.h",
+    "text_char_pos.cpp",
+    "text_char_pos.h",
     "text_glyph_pos.cpp",
     "text_glyph_pos.h",
   ]
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp
index 7b253a6..96adc88 100644
--- a/core/fxge/apple/fx_apple_platform.cpp
+++ b/core/fxge/apple/fx_apple_platform.cpp
@@ -19,6 +19,7 @@
 #include "core/fxge/cfx_substfont.h"
 #include "core/fxge/dib/cfx_dibitmap.h"
 #include "core/fxge/fx_freetype.h"
+#include "core/fxge/text_char_pos.h"
 #include "third_party/base/span.h"
 
 #ifndef _SKIA_SUPPORT_
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 63582ed..133ebff 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -25,6 +25,7 @@
 #include "core/fxge/dib/cfx_imagerenderer.h"
 #include "core/fxge/fx_font.h"
 #include "core/fxge/renderdevicedriver_iface.h"
+#include "core/fxge/text_char_pos.h"
 #include "core/fxge/text_glyph_pos.h"
 
 #if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
@@ -367,12 +368,6 @@
 
 }  // namespace
 
-TextCharPos::TextCharPos() = default;
-
-TextCharPos::TextCharPos(const TextCharPos&) = default;
-
-TextCharPos::~TextCharPos() = default;
-
 CFX_RenderDevice::CFX_RenderDevice() = default;
 
 CFX_RenderDevice::~CFX_RenderDevice() {
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index eeb3e1a..437d270 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -24,29 +24,11 @@
 class CFX_ImageRenderer;
 class CFX_PathData;
 class PauseIndicatorIface;
+class TextCharPos;
 struct CFX_Color;
 
 enum class BorderStyle { SOLID, DASH, BEVELED, INSET, UNDERLINE };
 
-class TextCharPos {
- public:
-  TextCharPos();
-  TextCharPos(const TextCharPos&);
-  ~TextCharPos();
-
-  CFX_PointF m_Origin;
-  uint32_t m_Unicode = 0;
-  uint32_t m_GlyphIndex = 0;
-  uint32_t m_FontCharWidth = 0;
-#if defined(OS_MACOSX)
-  uint32_t m_ExtGID = 0;
-#endif
-  int32_t m_FallbackFontPosition = 0;
-  bool m_bGlyphAdjust = false;
-  bool m_bFontStyle = false;
-  float m_AdjustMatrix[4];
-};
-
 class CFX_RenderDevice {
  public:
   class StateRestorer {
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 9f6b1b4..0f0e5d4 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -30,6 +30,7 @@
 #include "core/fxge/dib/cfx_dibitmap.h"
 #include "core/fxge/dib/cfx_imagerenderer.h"
 #include "core/fxge/dib/cfx_imagestretcher.h"
+#include "core/fxge/text_char_pos.h"
 #include "third_party/base/logging.h"
 #include "third_party/base/ptr_util.h"
 #include "third_party/skia/include/core/SkCanvas.h"
diff --git a/core/fxge/skia/fx_skia_device_embeddertest.cpp b/core/fxge/skia/fx_skia_device_embeddertest.cpp
index 6daea67..588cb96 100644
--- a/core/fxge/skia/fx_skia_device_embeddertest.cpp
+++ b/core/fxge/skia/fx_skia_device_embeddertest.cpp
@@ -8,6 +8,7 @@
 #include "core/fxge/cfx_pathdata.h"
 #include "core/fxge/cfx_renderdevice.h"
 #include "core/fxge/skia/fx_skia_device.h"
+#include "core/fxge/text_char_pos.h"
 #include "fpdfsdk/cpdfsdk_helpers.h"
 #include "public/fpdfview.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/core/fxge/text_char_pos.cpp b/core/fxge/text_char_pos.cpp
new file mode 100644
index 0000000..cf88b96
--- /dev/null
+++ b/core/fxge/text_char_pos.cpp
@@ -0,0 +1,13 @@
+// Copyright 2019 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "core/fxge/text_char_pos.h"
+
+TextCharPos::TextCharPos() = default;
+
+TextCharPos::TextCharPos(const TextCharPos&) = default;
+
+TextCharPos::~TextCharPos() = default;
diff --git a/core/fxge/text_char_pos.h b/core/fxge/text_char_pos.h
new file mode 100644
index 0000000..c211be8
--- /dev/null
+++ b/core/fxge/text_char_pos.h
@@ -0,0 +1,31 @@
+// Copyright 2019 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FXGE_TEXT_CHAR_POS_H_
+#define CORE_FXGE_TEXT_CHAR_POS_H_
+
+#include "core/fxcrt/fx_coordinates.h"
+
+class TextCharPos {
+ public:
+  TextCharPos();
+  TextCharPos(const TextCharPos&);
+  ~TextCharPos();
+
+  CFX_PointF m_Origin;
+  uint32_t m_Unicode = 0;
+  uint32_t m_GlyphIndex = 0;
+  uint32_t m_FontCharWidth = 0;
+#if defined(OS_MACOSX)
+  uint32_t m_ExtGID = 0;
+#endif
+  int32_t m_FallbackFontPosition = 0;
+  bool m_bGlyphAdjust = false;
+  bool m_bFontStyle = false;
+  float m_AdjustMatrix[4];
+};
+
+#endif  // CORE_FXGE_TEXT_CHAR_POS_H_
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index 6705437..d7594be 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -20,6 +20,7 @@
 #include "core/fxge/dib/cfx_dibextractor.h"
 #include "core/fxge/dib/cfx_dibitmap.h"
 #include "core/fxge/fx_dib.h"
+#include "core/fxge/text_char_pos.h"
 #include "core/fxge/win32/cpsoutput.h"
 #include "third_party/base/ptr_util.h"
 
diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp
index f0ad867..9ed2426 100644
--- a/core/fxge/win32/fx_win32_print.cpp
+++ b/core/fxge/win32/fx_win32_print.cpp
@@ -18,6 +18,7 @@
 #include "core/fxge/dib/cfx_imagerenderer.h"
 #include "core/fxge/dib/cstretchengine.h"
 #include "core/fxge/fx_freetype.h"
+#include "core/fxge/text_char_pos.h"
 #include "core/fxge/win32/cpsoutput.h"
 #include "core/fxge/win32/win32_int.h"