Move some RetainPtr getters/setters out of headers.

RetainPtr operations are not trivial.

Change-Id: Ic106ada69d1c023a8132a2a59db17d550fd81fa0
Reviewed-on: https://pdfium-review.googlesource.com/22911
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/font/cpdf_type3char.cpp b/core/fpdfapi/font/cpdf_type3char.cpp
index f1448ab..8a89582 100644
--- a/core/fpdfapi/font/cpdf_type3char.cpp
+++ b/core/fpdfapi/font/cpdf_type3char.cpp
@@ -12,6 +12,7 @@
 #include "core/fpdfapi/page/cpdf_image.h"
 #include "core/fpdfapi/page/cpdf_imageobject.h"
 #include "core/fpdfapi/page/cpdf_pageobject.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
 #include "core/fxge/fx_dib.h"
 
 namespace {
@@ -93,3 +94,11 @@
 void CPDF_Type3Char::ResetForm() {
   m_pForm.reset();
 }
+
+RetainPtr<CFX_DIBitmap> CPDF_Type3Char::GetBitmap() {
+  return m_pBitmap;
+}
+
+const RetainPtr<CFX_DIBitmap>& CPDF_Type3Char::GetBitmap() const {
+  return m_pBitmap;
+}
diff --git a/core/fpdfapi/font/cpdf_type3char.h b/core/fpdfapi/font/cpdf_type3char.h
index 2aec16a..c9c5555 100644
--- a/core/fpdfapi/font/cpdf_type3char.h
+++ b/core/fpdfapi/font/cpdf_type3char.h
@@ -31,8 +31,8 @@
   void Transform(const CFX_Matrix& matrix);
   void ResetForm();
 
-  RetainPtr<CFX_DIBitmap> GetBitmap() { return m_pBitmap; }
-  const RetainPtr<CFX_DIBitmap>& GetBitmap() const { return m_pBitmap; }
+  RetainPtr<CFX_DIBitmap> GetBitmap();
+  const RetainPtr<CFX_DIBitmap>& GetBitmap() const;
 
   const CPDF_Form* form() const { return m_pForm.get(); }
   CPDF_Form* form() { return m_pForm.get(); }
diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp
index bca711f..6d969a3 100644
--- a/core/fxge/cfx_font.cpp
+++ b/core/fxge/cfx_font.cpp
@@ -228,6 +228,10 @@
   ClearFaceCache();
   m_Face = face;
 }
+
+void CFX_Font::SetSubstFont(std::unique_ptr<CFX_SubstFont> subst) {
+  m_pSubstFont = std::move(subst);
+}
 #endif  // PDF_ENABLE_XFA
 
 CFX_Font::~CFX_Font() {
diff --git a/core/fxge/cfx_font.h b/core/fxge/cfx_font.h
index 13cb892..c8c4cf7 100644
--- a/core/fxge/cfx_font.h
+++ b/core/fxge/cfx_font.h
@@ -8,7 +8,6 @@
 #define CORE_FXGE_CFX_FONT_H_
 
 #include <memory>
-#include <utility>
 #include <vector>
 
 #include "core/fxcrt/bytestring.h"
@@ -47,9 +46,7 @@
   bool LoadFile(const RetainPtr<IFX_SeekableReadStream>& pFile, int nFaceIndex);
 
   void SetFace(FXFT_Face face);
-  void SetSubstFont(std::unique_ptr<CFX_SubstFont> subst) {
-    m_pSubstFont = std::move(subst);
-  }
+  void SetSubstFont(std::unique_ptr<CFX_SubstFont> subst);
 #endif  // PDF_ENABLE_XFA
 
   const CFX_GlyphBitmap* LoadGlyphBitmap(uint32_t glyph_index,
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 63bf1d9..919a7a9 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -429,6 +429,14 @@
   return m_pDeviceDriver->GetCTM();
 }
 
+RetainPtr<CFX_DIBitmap> CFX_RenderDevice::GetBitmap() const {
+  return m_pBitmap;
+}
+
+void CFX_RenderDevice::SetBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap) {
+  m_pBitmap = pBitmap;
+}
+
 bool CFX_RenderDevice::CreateCompatibleBitmap(
     const RetainPtr<CFX_DIBitmap>& pDIB,
     int width,
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 0f1cf9b..5b18b22 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -113,10 +113,8 @@
   int GetRenderCaps() const { return m_RenderCaps; }
   int GetDeviceCaps(int id) const;
   CFX_Matrix GetCTM() const;
-  RetainPtr<CFX_DIBitmap> GetBitmap() const { return m_pBitmap; }
-  void SetBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap) {
-    m_pBitmap = pBitmap;
-  }
+  RetainPtr<CFX_DIBitmap> GetBitmap() const;
+  void SetBitmap(const RetainPtr<CFX_DIBitmap>& pBitmap);
   bool CreateCompatibleBitmap(const RetainPtr<CFX_DIBitmap>& pDIB,
                               int width,
                               int height) const;