summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-26 20:25:18 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-26 20:25:18 +0000
commit2cae3e26526a8aeef5744665589d1bfaf5efe6f3 (patch)
treec93e98db9f90d07158e2e2d2311e6b70d5f98cb6 /core
parent7df950ac2ef484880fe3cbfb9961bed34fee191d (diff)
downloadpdfium-2cae3e26526a8aeef5744665589d1bfaf5efe6f3.tar.xz
Forward declare a bunch of classes.
Then do IWYU to fix up build errors. Move some implementations out of headers to allow more forward declarations. Change-Id: Idbeb978705a21cd6fb710ca9f5e99b4ea7d93ec5 Reviewed-on: https://pdfium-review.googlesource.com/c/44632 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/page/cpdf_contentparser.h2
-rw-r--r--core/fpdfapi/page/cpdf_path.h2
-rw-r--r--core/fpdfapi/render/cpdf_charposlist.cpp6
-rw-r--r--core/fpdfapi/render/cpdf_charposlist.h9
-rw-r--r--core/fpdfapi/render/cpdf_dibbase.h2
-rw-r--r--core/fpdfapi/render/cpdf_imageloader.h7
-rw-r--r--core/fpdfapi/render/cpdf_rendercontext.cpp1
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp1
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.h4
-rw-r--r--core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp4
-rw-r--r--core/fpdfapi/render/cpdf_scaledrenderbuffer.h6
-rw-r--r--core/fpdfapi/render/cpdf_type3cache.cpp1
-rw-r--r--core/fpdfdoc/cpdf_structelement.h1
-rw-r--r--core/fpdfdoc/cpvt_generateap.h1
-rw-r--r--core/fxcodec/codec/ccodec_progressivedecoder.h2
-rw-r--r--core/fxge/BUILD.gn1
-rw-r--r--core/fxge/agg/fx_agg_driver.cpp1
-rw-r--r--core/fxge/apple/apple_int.h1
-rw-r--r--core/fxge/apple/fx_apple_platform.cpp9
-rw-r--r--core/fxge/cfx_color.h4
-rw-r--r--core/fxge/cfx_facecache.cpp1
-rw-r--r--core/fxge/cfx_renderdevice.cpp1
-rw-r--r--core/fxge/cfx_renderdevice.h16
-rw-r--r--core/fxge/cfx_unicodeencodingex.h1
-rw-r--r--core/fxge/dib/cfx_bitmapstorer.cpp1
-rw-r--r--core/fxge/dib/cfx_bitmapstorer.h3
-rw-r--r--core/fxge/dib/cfx_dibextractor.cpp1
-rw-r--r--core/fxge/dib/cfx_dibextractor.h2
-rw-r--r--core/fxge/dib/cfx_imagerenderer.cpp1
-rw-r--r--core/fxge/dib/cfx_imagerenderer.h6
-rw-r--r--core/fxge/dib/cfx_imagestretcher.cpp4
-rw-r--r--core/fxge/dib/cfx_imagestretcher.h3
-rw-r--r--core/fxge/dib/cfx_imagetransformer.cpp1
-rw-r--r--core/fxge/dib/cfx_imagetransformer.h5
-rw-r--r--core/fxge/dib/cfx_scanlinecompositor.h1
-rw-r--r--core/fxge/dib/cstretchengine.h1
-rw-r--r--core/fxge/fx_dib.h4
-rw-r--r--core/fxge/fx_font.cpp13
-rw-r--r--core/fxge/fx_font.h22
-rw-r--r--core/fxge/fx_ge_text.cpp1
-rw-r--r--core/fxge/skia/fx_skia_device.cpp1
-rw-r--r--core/fxge/skia/fx_skia_device.h1
-rw-r--r--core/fxge/win32/cfx_psrenderer.cpp1
-rw-r--r--core/fxge/win32/fx_win32_print.cpp1
44 files changed, 91 insertions, 66 deletions
diff --git a/core/fpdfapi/page/cpdf_contentparser.h b/core/fpdfapi/page/cpdf_contentparser.h
index b5db5d5e13..70be98c161 100644
--- a/core/fpdfapi/page/cpdf_contentparser.h
+++ b/core/fpdfapi/page/cpdf_contentparser.h
@@ -11,7 +11,6 @@
#include <set>
#include <vector>
-#include "core/fpdfapi/page/cpdf_pageobjectholder.h"
#include "core/fpdfapi/page/cpdf_streamcontentparser.h"
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fxcrt/maybe_owned.h"
@@ -20,6 +19,7 @@
class CPDF_AllStates;
class CPDF_Form;
class CPDF_Page;
+class CPDF_PageObjectHolder;
class CPDF_StreamAcc;
class CPDF_Type3Char;
diff --git a/core/fpdfapi/page/cpdf_path.h b/core/fpdfapi/page/cpdf_path.h
index 4a984a540c..56df5dbd64 100644
--- a/core/fpdfapi/page/cpdf_path.h
+++ b/core/fpdfapi/page/cpdf_path.h
@@ -11,9 +11,7 @@
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/shared_copy_on_write.h"
-#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_pathdata.h"
-#include "core/fxge/cfx_renderdevice.h"
class CPDF_Path {
public:
diff --git a/core/fpdfapi/render/cpdf_charposlist.cpp b/core/fpdfapi/render/cpdf_charposlist.cpp
index 7c0e28875c..052ae4df02 100644
--- a/core/fpdfapi/render/cpdf_charposlist.cpp
+++ b/core/fpdfapi/render/cpdf_charposlist.cpp
@@ -8,11 +8,9 @@
#include "core/fpdfapi/font/cpdf_cidfont.h"
#include "core/fpdfapi/font/cpdf_font.h"
+#include "core/fxge/cfx_renderdevice.h"
-CPDF_CharPosList::CPDF_CharPosList() {
- m_pCharPos = nullptr;
- m_nChars = 0;
-}
+CPDF_CharPosList::CPDF_CharPosList() = default;
CPDF_CharPosList::~CPDF_CharPosList() {
FX_Free(m_pCharPos);
diff --git a/core/fpdfapi/render/cpdf_charposlist.h b/core/fpdfapi/render/cpdf_charposlist.h
index c4636bca51..dd7c87b100 100644
--- a/core/fpdfapi/render/cpdf_charposlist.h
+++ b/core/fpdfapi/render/cpdf_charposlist.h
@@ -10,20 +10,23 @@
#include <vector>
#include "core/fxcrt/fx_system.h"
-#include "core/fxge/cfx_renderdevice.h"
class CPDF_Font;
+class FXTEXT_CHARPOS;
class CPDF_CharPosList {
public:
CPDF_CharPosList();
~CPDF_CharPosList();
+
void Load(const std::vector<uint32_t>& charCodes,
const std::vector<float>& charPos,
CPDF_Font* pFont,
float font_size);
- FXTEXT_CHARPOS* m_pCharPos;
- uint32_t m_nChars;
+
+ // TODO(thestig): Convert to unique_ptr or vector.
+ FXTEXT_CHARPOS* m_pCharPos = nullptr;
+ uint32_t m_nChars = 0;
};
#endif // CORE_FPDFAPI_RENDER_CPDF_CHARPOSLIST_H_
diff --git a/core/fpdfapi/render/cpdf_dibbase.h b/core/fpdfapi/render/cpdf_dibbase.h
index c74313d23c..4768a54ec1 100644
--- a/core/fpdfapi/render/cpdf_dibbase.h
+++ b/core/fpdfapi/render/cpdf_dibbase.h
@@ -16,10 +16,8 @@
#include "core/fpdfapi/parser/cpdf_stream_acc.h"
#include "core/fpdfapi/render/cpdf_imageloader.h"
#include "core/fpdfapi/render/cpdf_rendercontext.h"
-#include "core/fpdfapi/render/cpdf_renderoptions.h"
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/dib/cfx_dibbase.h"
#include "third_party/base/span.h"
diff --git a/core/fpdfapi/render/cpdf_imageloader.h b/core/fpdfapi/render/cpdf_imageloader.h
index 672b83b70a..7e12c01038 100644
--- a/core/fpdfapi/render/cpdf_imageloader.h
+++ b/core/fpdfapi/render/cpdf_imageloader.h
@@ -9,8 +9,8 @@
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/fx_dib.h"
+class CFX_DIBBase;
class CPDF_ImageObject;
class CPDF_PageRenderCache;
class CPDF_RenderStatus;
@@ -40,11 +40,10 @@ class CPDF_ImageLoader {
private:
void HandleFailure();
- RetainPtr<CFX_DIBBase> m_pBitmap;
- RetainPtr<CFX_DIBBase> m_pMask;
uint32_t m_MatteColor = 0;
bool m_bCached = false;
-
+ RetainPtr<CFX_DIBBase> m_pBitmap;
+ RetainPtr<CFX_DIBBase> m_pMask;
UnownedPtr<CPDF_PageRenderCache> m_pCache;
UnownedPtr<CPDF_ImageObject> m_pImageObject;
};
diff --git a/core/fpdfapi/render/cpdf_rendercontext.cpp b/core/fpdfapi/render/cpdf_rendercontext.cpp
index 604170fad0..be61188e70 100644
--- a/core/fpdfapi/render/cpdf_rendercontext.cpp
+++ b/core/fpdfapi/render/cpdf_rendercontext.cpp
@@ -16,6 +16,7 @@
#include "core/fpdfapi/render/cpdf_renderoptions.h"
#include "core/fpdfapi/render/cpdf_renderstatus.h"
#include "core/fpdfapi/render/cpdf_textrenderer.h"
+#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_dib.h"
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 691cdb408c..0e8975da61 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -56,6 +56,7 @@
#include "core/fxge/cfx_graphstatedata.h"
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_renderdevice.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/renderdevicedriver_iface.h"
#include "third_party/base/compiler_specific.h"
#include "third_party/base/logging.h"
diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h
index 1911758a2e..5d2ffae623 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.h
+++ b/core/fpdfapi/render/cpdf_renderstatus.h
@@ -12,13 +12,13 @@
#include "core/fpdfapi/page/cpdf_clippath.h"
#include "core/fpdfapi/page/cpdf_graphicstates.h"
-#include "core/fpdfapi/page/cpdf_pageobjectholder.h"
#include "core/fpdfapi/render/cpdf_renderoptions.h"
+#include "core/fpdfapi/render/cpdf_transparency.h"
#include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/fx_dib.h"
class CFX_PathData;
+class CFX_RenderDevice;
class CPDF_Color;
class CPDF_Dictionary;
class CPDF_Font;
diff --git a/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp b/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
index 1f43abec6e..a70b160e8c 100644
--- a/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
+++ b/core/fpdfapi/render/cpdf_scaledrenderbuffer.cpp
@@ -76,6 +76,10 @@ bool CPDF_ScaledRenderBuffer::Initialize(CPDF_RenderContext* pContext,
return true;
}
+CFX_RenderDevice* CPDF_ScaledRenderBuffer::GetDevice() const {
+ return m_pBitmapDevice ? m_pBitmapDevice.get() : m_pDevice.Get();
+}
+
void CPDF_ScaledRenderBuffer::OutputToDevice() {
if (m_pBitmapDevice) {
m_pDevice->StretchDIBits(m_pBitmapDevice->GetBitmap(), m_Rect.left,
diff --git a/core/fpdfapi/render/cpdf_scaledrenderbuffer.h b/core/fpdfapi/render/cpdf_scaledrenderbuffer.h
index b77e4b6309..14089f36b7 100644
--- a/core/fpdfapi/render/cpdf_scaledrenderbuffer.h
+++ b/core/fpdfapi/render/cpdf_scaledrenderbuffer.h
@@ -11,8 +11,8 @@
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/cfx_defaultrenderdevice.h"
+class CFX_DefaultRenderDevice;
class CFX_RenderDevice;
class CPDF_PageObject;
class CPDF_RenderContext;
@@ -30,9 +30,7 @@ class CPDF_ScaledRenderBuffer {
const CPDF_RenderOptions* pOptions,
int max_dpi);
- CFX_RenderDevice* GetDevice() const {
- return m_pBitmapDevice ? m_pBitmapDevice.get() : m_pDevice.Get();
- }
+ CFX_RenderDevice* GetDevice() const;
CFX_Matrix* GetMatrix() { return &m_Matrix; }
void OutputToDevice();
diff --git a/core/fpdfapi/render/cpdf_type3cache.cpp b/core/fpdfapi/render/cpdf_type3cache.cpp
index ea15a94ca8..11e5946e05 100644
--- a/core/fpdfapi/render/cpdf_type3cache.cpp
+++ b/core/fpdfapi/render/cpdf_type3cache.cpp
@@ -14,6 +14,7 @@
#include "core/fpdfapi/font/cpdf_type3font.h"
#include "core/fpdfapi/render/cpdf_type3glyphs.h"
#include "core/fxcrt/fx_safe_types.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_dib.h"
#include "core/fxge/fx_font.h"
#include "third_party/base/ptr_util.h"
diff --git a/core/fpdfdoc/cpdf_structelement.h b/core/fpdfdoc/cpdf_structelement.h
index 355599ff87..2dcdc97ecc 100644
--- a/core/fpdfdoc/cpdf_structelement.h
+++ b/core/fpdfdoc/cpdf_structelement.h
@@ -12,7 +12,6 @@
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/fx_dib.h"
class CPDF_Dictionary;
class CPDF_Object;
diff --git a/core/fpdfdoc/cpvt_generateap.h b/core/fpdfdoc/cpvt_generateap.h
index 0e219b77ed..5d94ba256b 100644
--- a/core/fpdfdoc/cpvt_generateap.h
+++ b/core/fpdfdoc/cpvt_generateap.h
@@ -13,7 +13,6 @@
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
-#include "core/fxge/cfx_color.h"
class CPDF_Dictionary;
class CPDF_Document;
diff --git a/core/fxcodec/codec/ccodec_progressivedecoder.h b/core/fxcodec/codec/ccodec_progressivedecoder.h
index 1c764cbb4b..413bd9073d 100644
--- a/core/fxcodec/codec/ccodec_progressivedecoder.h
+++ b/core/fxcodec/codec/ccodec_progressivedecoder.h
@@ -16,7 +16,6 @@
#include "core/fxcrt/fx_system.h"
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_dib.h"
#ifdef PDF_ENABLE_XFA_BMP
@@ -37,6 +36,7 @@
class CCodec_ModuleMgr;
class CFX_DIBAttribute;
+class CFX_DIBitmap;
class IFX_SeekableReadStream;
class CCodec_Dummy {}; // Placeholder to work around C++ syntax issues
diff --git a/core/fxge/BUILD.gn b/core/fxge/BUILD.gn
index 6475dc35d5..1f2680954d 100644
--- a/core/fxge/BUILD.gn
+++ b/core/fxge/BUILD.gn
@@ -105,6 +105,7 @@ jumbo_source_set("fxge") {
"fontdata/chromefontdata/chromefontdata.h",
"freetype/fx_freetype.cpp",
"fx_dib.h",
+ "fx_font.cpp",
"fx_font.h",
"fx_freetype.h",
"fx_ge_fontmap.cpp",
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index 55710763e5..10293d865c 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -13,6 +13,7 @@
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "core/fxge/cfx_graphstatedata.h"
#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagerenderer.h"
#include "core/fxge/dib/cfx_imagestretcher.h"
#include "third_party/base/ptr_util.h"
diff --git a/core/fxge/apple/apple_int.h b/core/fxge/apple/apple_int.h
index a53b91b00b..e91b1e1b81 100644
--- a/core/fxge/apple/apple_int.h
+++ b/core/fxge/apple/apple_int.h
@@ -13,7 +13,6 @@
#include "core/fxge/cfx_graphstatedata.h"
#include "core/fxge/cfx_pathdata.h"
-#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/fx_dib.h"
#include "core/fxge/renderdevicedriver_iface.h"
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp
index aad97ee4cb..a56f2a910c 100644
--- a/core/fxge/apple/fx_apple_platform.cpp
+++ b/core/fxge/apple/fx_apple_platform.cpp
@@ -9,20 +9,21 @@
#include "core/fxcrt/fx_system.h"
-#ifndef _SKIA_SUPPORT_
-#include "core/fxge/agg/fx_agg_driver.h"
-#endif
-
#include "core/fxge/apple/apple_int.h"
#include "core/fxge/cfx_cliprgn.h"
#include "core/fxge/cfx_facecache.h"
#include "core/fxge/cfx_font.h"
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/cfx_renderdevice.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_freetype.h"
#include "third_party/base/span.h"
#ifndef _SKIA_SUPPORT_
+#include "core/fxge/agg/fx_agg_driver.h"
+#endif
+
+#ifndef _SKIA_SUPPORT_
namespace {
diff --git a/core/fxge/cfx_color.h b/core/fxge/cfx_color.h
index 1dd512a42d..251962a0d5 100644
--- a/core/fxge/cfx_color.h
+++ b/core/fxge/cfx_color.h
@@ -7,9 +7,11 @@
#ifndef CORE_FXGE_CFX_COLOR_H_
#define CORE_FXGE_CFX_COLOR_H_
-#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fxcrt/fx_string.h"
#include "core/fxge/fx_dib.h"
+class CPDF_Array;
+
struct CFX_Color {
static CFX_Color ParseColor(const CPDF_Array& array);
static CFX_Color ParseColor(const ByteString& str);
diff --git a/core/fxge/cfx_facecache.cpp b/core/fxge/cfx_facecache.cpp
index 08d95a0cb8..9829755b69 100644
--- a/core/fxge/cfx_facecache.cpp
+++ b/core/fxge/cfx_facecache.cpp
@@ -17,6 +17,7 @@
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_substfont.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_freetype.h"
#include "third_party/base/numerics/safe_math.h"
#include "third_party/base/ptr_util.h"
diff --git a/core/fxge/cfx_renderdevice.cpp b/core/fxge/cfx_renderdevice.cpp
index 4b082a3349..90e80be28e 100644
--- a/core/fxge/cfx_renderdevice.cpp
+++ b/core/fxge/cfx_renderdevice.cpp
@@ -18,6 +18,7 @@
#include "core/fxge/cfx_gemodule.h"
#include "core/fxge/cfx_graphstatedata.h"
#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagerenderer.h"
#include "core/fxge/renderdevicedriver_iface.h"
diff --git a/core/fxge/cfx_renderdevice.h b/core/fxge/cfx_renderdevice.h
index 18ce7a8608..5eede11636 100644
--- a/core/fxge/cfx_renderdevice.h
+++ b/core/fxge/cfx_renderdevice.h
@@ -12,16 +12,8 @@
#include "core/fpdfdoc/cpdf_defaultappearance.h"
#include "core/fxcrt/unowned_ptr.h"
-#include "core/fxge/cfx_color.h"
#include "core/fxge/fx_dib.h"
-class CFX_DIBitmap;
-class CFX_Font;
-class CFX_GraphStateData;
-class CFX_ImageRenderer;
-class PauseIndicatorIface;
-class RenderDeviceDriverIface;
-
#define FXDC_DEVICE_CLASS 1
#define FXDC_PIXEL_WIDTH 2
#define FXDC_PIXEL_HEIGHT 3
@@ -64,7 +56,15 @@ class RenderDeviceDriverIface;
#define FXTEXT_PRINTIMAGETEXT 0x10
#define FXTEXT_NOSMOOTH 0x20
+class CFX_DIBBase;
+class CFX_DIBitmap;
+class CFX_Font;
+class CFX_GraphStateData;
+class CFX_ImageRenderer;
class CFX_PathData;
+class PauseIndicatorIface;
+class RenderDeviceDriverIface;
+struct CFX_Color;
enum class FXPT_TYPE : uint8_t { LineTo, BezierTo, MoveTo };
diff --git a/core/fxge/cfx_unicodeencodingex.h b/core/fxge/cfx_unicodeencodingex.h
index 9d5ec18fa6..ab624b9a27 100644
--- a/core/fxge/cfx_unicodeencodingex.h
+++ b/core/fxge/cfx_unicodeencodingex.h
@@ -11,7 +11,6 @@
#include "core/fxcrt/fx_system.h"
#include "core/fxge/cfx_unicodeencoding.h"
-#include "core/fxge/fx_dib.h"
class CFX_UnicodeEncodingEx final : public CFX_UnicodeEncoding {
public:
diff --git a/core/fxge/dib/cfx_bitmapstorer.cpp b/core/fxge/dib/cfx_bitmapstorer.cpp
index 2d85a2ed7b..97ddf6f0b3 100644
--- a/core/fxge/dib/cfx_bitmapstorer.cpp
+++ b/core/fxge/dib/cfx_bitmapstorer.cpp
@@ -8,6 +8,7 @@
#include <utility>
+#include "core/fxge/dib/cfx_dibitmap.h"
CFX_BitmapStorer::CFX_BitmapStorer() {}
diff --git a/core/fxge/dib/cfx_bitmapstorer.h b/core/fxge/dib/cfx_bitmapstorer.h
index 86f7f8719f..c8158a3d9a 100644
--- a/core/fxge/dib/cfx_bitmapstorer.h
+++ b/core/fxge/dib/cfx_bitmapstorer.h
@@ -9,9 +9,10 @@
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/retain_ptr.h"
-#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/scanlinecomposer_iface.h"
+class CFX_DIBitmap;
+
class CFX_BitmapStorer final : public ScanlineComposerIface {
public:
CFX_BitmapStorer();
diff --git a/core/fxge/dib/cfx_dibextractor.cpp b/core/fxge/dib/cfx_dibextractor.cpp
index 8211dc725a..f6f31e8f73 100644
--- a/core/fxge/dib/cfx_dibextractor.cpp
+++ b/core/fxge/dib/cfx_dibextractor.cpp
@@ -7,6 +7,7 @@
#include "core/fxge/dib/cfx_dibextractor.h"
#include "core/fxge/dib/cfx_dibbase.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
CFX_DIBExtractor::CFX_DIBExtractor(const RetainPtr<CFX_DIBBase>& pSrc) {
if (!pSrc->GetBuffer()) {
diff --git a/core/fxge/dib/cfx_dibextractor.h b/core/fxge/dib/cfx_dibextractor.h
index cd97f20aac..eff96b1217 100644
--- a/core/fxge/dib/cfx_dibextractor.h
+++ b/core/fxge/dib/cfx_dibextractor.h
@@ -8,9 +8,9 @@
#define CORE_FXGE_DIB_CFX_DIBEXTRACTOR_H_
#include "core/fxcrt/retain_ptr.h"
-#include "core/fxge/dib/cfx_dibitmap.h"
class CFX_DIBBase;
+class CFX_DIBitmap;
class CFX_DIBExtractor {
public:
diff --git a/core/fxge/dib/cfx_imagerenderer.cpp b/core/fxge/dib/cfx_imagerenderer.cpp
index 9641bc0ad0..6eadb05997 100644
--- a/core/fxge/dib/cfx_imagerenderer.cpp
+++ b/core/fxge/dib/cfx_imagerenderer.cpp
@@ -9,6 +9,7 @@
#include <memory>
#include "core/fxge/cfx_cliprgn.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagestretcher.h"
#include "core/fxge/dib/cfx_imagetransformer.h"
#include "third_party/base/ptr_util.h"
diff --git a/core/fxge/dib/cfx_imagerenderer.h b/core/fxge/dib/cfx_imagerenderer.h
index 2a16d2d18b..01eec3a947 100644
--- a/core/fxge/dib/cfx_imagerenderer.h
+++ b/core/fxge/dib/cfx_imagerenderer.h
@@ -13,12 +13,12 @@
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
#include "core/fxge/dib/cfx_bitmapcomposer.h"
-#include "core/fxge/dib/cfx_dibbase.h"
-#include "core/fxge/dib/cfx_dibitmap.h"
-#include "core/fxge/fx_dib.h"
+class CFX_DIBBase;
+class CFX_DIBitmap;
class CFX_ImageTransformer;
class CFX_ImageStretcher;
+class PauseIndicatorIface;
class CFX_ImageRenderer {
public:
diff --git a/core/fxge/dib/cfx_imagestretcher.cpp b/core/fxge/dib/cfx_imagestretcher.cpp
index 53c47c996e..763c1db5d2 100644
--- a/core/fxge/dib/cfx_imagestretcher.cpp
+++ b/core/fxge/dib/cfx_imagestretcher.cpp
@@ -131,6 +131,10 @@ bool CFX_ImageStretcher::Continue(PauseIndicatorIface* pPause) {
return ContinueStretch(pPause);
}
+RetainPtr<CFX_DIBBase> CFX_ImageStretcher::source() {
+ return m_pSource;
+}
+
bool CFX_ImageStretcher::StartStretch() {
m_pStretchEngine = pdfium::MakeUnique<CStretchEngine>(
m_pDest.Get(), m_DestFormat, m_DestWidth, m_DestHeight, m_ClipRect,
diff --git a/core/fxge/dib/cfx_imagestretcher.h b/core/fxge/dib/cfx_imagestretcher.h
index 8e866620fd..9f4e44b0d0 100644
--- a/core/fxge/dib/cfx_imagestretcher.h
+++ b/core/fxge/dib/cfx_imagestretcher.h
@@ -17,6 +17,7 @@
#include "core/fxge/fx_dib.h"
class CFX_DIBBase;
+class CStretchEngine;
class PauseIndicatorIface;
class CFX_ImageStretcher {
@@ -32,7 +33,7 @@ class CFX_ImageStretcher {
bool Start();
bool Continue(PauseIndicatorIface* pPause);
- RetainPtr<CFX_DIBBase> source() { return m_pSource; }
+ RetainPtr<CFX_DIBBase> source();
private:
bool StartQuickStretch();
diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
index 96249750ee..29d22f4f77 100644
--- a/core/fxge/dib/cfx_imagetransformer.cpp
+++ b/core/fxge/dib/cfx_imagetransformer.cpp
@@ -10,6 +10,7 @@
#include <memory>
#include <utility>
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagestretcher.h"
#include "core/fxge/fx_dib.h"
#include "third_party/base/compiler_specific.h"
diff --git a/core/fxge/dib/cfx_imagetransformer.h b/core/fxge/dib/cfx_imagetransformer.h
index ecd91872c0..052df941d4 100644
--- a/core/fxge/dib/cfx_imagetransformer.h
+++ b/core/fxge/dib/cfx_imagetransformer.h
@@ -13,10 +13,11 @@
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/unowned_ptr.h"
#include "core/fxge/dib/cfx_bitmapstorer.h"
-#include "core/fxge/dib/cfx_dibbase.h"
-#include "core/fxge/dib/cfx_dibitmap.h"
+class CFX_DIBBase;
+class CFX_DIBitmap;
class CFX_ImageStretcher;
+class PauseIndicatorIface;
class CFX_ImageTransformer {
public:
diff --git a/core/fxge/dib/cfx_scanlinecompositor.h b/core/fxge/dib/cfx_scanlinecompositor.h
index fc86299032..b9625d9b12 100644
--- a/core/fxge/dib/cfx_scanlinecompositor.h
+++ b/core/fxge/dib/cfx_scanlinecompositor.h
@@ -9,7 +9,6 @@
#include <memory>
-#include "core/fxge/dib/cfx_dibbase.h"
#include "core/fxge/fx_dib.h"
class CFX_ScanlineCompositor {
diff --git a/core/fxge/dib/cstretchengine.h b/core/fxge/dib/cstretchengine.h
index db7a2be56d..6bb07c662c 100644
--- a/core/fxge/dib/cstretchengine.h
+++ b/core/fxge/dib/cstretchengine.h
@@ -14,6 +14,7 @@
#include "core/fxcrt/unowned_ptr.h"
#include "core/fxge/fx_dib.h"
+class CFX_DIBBase;
class PauseIndicatorIface;
class ScanlineComposerIface;
diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h
index 96cd82a66b..221a05278f 100644
--- a/core/fxge/fx_dib.h
+++ b/core/fxge/fx_dib.h
@@ -44,10 +44,6 @@ using FX_COLORREF = uint32_t;
using FX_CMYK = uint32_t;
-class CFX_ClipRgn;
-class CFX_DIBBase;
-class CStretchEngine;
-
extern const int16_t SDP_Table[513];
#define FXDIB_DOWNSAMPLE 0x04
diff --git a/core/fxge/fx_font.cpp b/core/fxge/fx_font.cpp
new file mode 100644
index 0000000000..29c55dd0e6
--- /dev/null
+++ b/core/fxge/fx_font.cpp
@@ -0,0 +1,13 @@
+// Copyright 2018 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.
+
+#include "core/fxge/fx_font.h"
+
+#include "core/fxge/dib/cfx_dibitmap.h"
+#include "core/fxge/dib/cfx_imagestretcher.h"
+
+CFX_GlyphBitmap::CFX_GlyphBitmap()
+ : m_pBitmap(pdfium::MakeRetain<CFX_DIBitmap>()) {}
+
+CFX_GlyphBitmap::~CFX_GlyphBitmap() = default;
diff --git a/core/fxge/fx_font.h b/core/fxge/fx_font.h
index 3a68c2251b..204655ab79 100644
--- a/core/fxge/fx_font.h
+++ b/core/fxge/fx_font.h
@@ -9,18 +9,11 @@
#include <vector>
+#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_system.h"
#include "core/fxge/cfx_substfont.h"
-#include "core/fxge/dib/cfx_dibitmap.h"
-#include "core/fxge/fx_dib.h"
#include "core/fxge/fx_freetype.h"
-#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
-class SkTypeface;
-
-using CFX_TypeFace = SkTypeface;
-#endif
-
/* Font pitch and family flags */
#define FXFONT_FF_FIXEDPITCH (1 << 0)
#define FXFONT_FF_ROMAN (1 << 4)
@@ -51,6 +44,14 @@ using CFX_TypeFace = SkTypeface;
#define GET_TT_LONG(w) \
(uint32_t)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3])
+class CFX_DIBitmap;
+
+#if defined _SKIA_SUPPORT_ || defined _SKIA_SUPPORT_PATHS_
+class SkTypeface;
+
+using CFX_TypeFace = SkTypeface;
+#endif
+
// Sets the given transform on the font, and resets it to the identity when it
// goes out of scope.
class ScopedFontTransform {
@@ -72,11 +73,6 @@ class CFX_GlyphBitmap {
RetainPtr<CFX_DIBitmap> m_pBitmap;
};
-inline CFX_GlyphBitmap::CFX_GlyphBitmap()
- : m_pBitmap(pdfium::MakeRetain<CFX_DIBitmap>()) {}
-
-inline CFX_GlyphBitmap::~CFX_GlyphBitmap() = default;
-
class FXTEXT_GLYPHPOS {
public:
FXTEXT_GLYPHPOS();
diff --git a/core/fxge/fx_ge_text.cpp b/core/fxge/fx_ge_text.cpp
index a74b8fb9b9..d355058029 100644
--- a/core/fxge/fx_ge_text.cpp
+++ b/core/fxge/fx_ge_text.cpp
@@ -10,6 +10,7 @@
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxge/cfx_pathdata.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/fx_font.h"
#include "core/fxge/fx_freetype.h"
#include "core/fxge/renderdevicedriver_iface.h"
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index e0010cdf78..2067243c04 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -25,6 +25,7 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/dib/cfx_bitmapcomposer.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagerenderer.h"
#include "core/fxge/dib/cfx_imagestretcher.h"
#include "third_party/base/logging.h"
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index 7c9dfeccbd..ea3477882d 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -13,6 +13,7 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/renderdevicedriver_iface.h"
+class CFX_ClipRgn;
class FXTEXT_CHARPOS;
class SkCanvas;
class SkMatrix;
diff --git a/core/fxge/win32/cfx_psrenderer.cpp b/core/fxge/win32/cfx_psrenderer.cpp
index becf99b52d..9e01bd2d06 100644
--- a/core/fxge/win32/cfx_psrenderer.cpp
+++ b/core/fxge/win32/cfx_psrenderer.cpp
@@ -24,6 +24,7 @@
#include "core/fxge/cfx_pathdata.h"
#include "core/fxge/cfx_renderdevice.h"
#include "core/fxge/dib/cfx_dibextractor.h"
+#include "core/fxge/dib/cfx_dibitmap.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 aeec161bf5..2f99f88e68 100644
--- a/core/fxge/win32/fx_win32_print.cpp
+++ b/core/fxge/win32/fx_win32_print.cpp
@@ -14,6 +14,7 @@
#include "core/fxge/cfx_font.h"
#include "core/fxge/cfx_windowsrenderdevice.h"
#include "core/fxge/dib/cfx_dibextractor.h"
+#include "core/fxge/dib/cfx_dibitmap.h"
#include "core/fxge/dib/cfx_imagerenderer.h"
#include "core/fxge/dib/cstretchengine.h"
#include "core/fxge/fx_freetype.h"