diff options
66 files changed, 114 insertions, 99 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" diff --git a/fpdfsdk/cpdfsdk_helpers.h b/fpdfsdk/cpdfsdk_helpers.h index 3695bb1f5b..241e976d0d 100644 --- a/fpdfsdk/cpdfsdk_helpers.h +++ b/fpdfsdk/cpdfsdk_helpers.h @@ -10,7 +10,6 @@ #include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfapi/parser/cpdf_parser.h" #include "core/fxge/dib/cfx_dibitmap.h" -#include "core/fxge/fx_dib.h" #include "public/fpdf_doc.h" #include "public/fpdfview.h" diff --git a/fxbarcode/BC_Writer.cpp b/fxbarcode/BC_Writer.cpp index 711b82a5b4..5af796b5b0 100644 --- a/fxbarcode/BC_Writer.cpp +++ b/fxbarcode/BC_Writer.cpp @@ -6,6 +6,8 @@ #include "fxbarcode/BC_Writer.h" +#include "core/fxge/dib/cfx_dibitmap.h" + CBC_Writer::CBC_Writer() = default; CBC_Writer::~CBC_Writer() = default; diff --git a/fxbarcode/BC_Writer.h b/fxbarcode/BC_Writer.h index 7435807c8d..2a0ace6bd1 100644 --- a/fxbarcode/BC_Writer.h +++ b/fxbarcode/BC_Writer.h @@ -8,11 +8,12 @@ #define FXBARCODE_BC_WRITER_H_ #include "core/fxcrt/fx_string.h" -#include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/fx_dib.h" #include "fxbarcode/BC_Library.h" #include "fxbarcode/utils.h" +class CFX_DIBitmap; + class CBC_Writer { public: CBC_Writer(); diff --git a/fxbarcode/cbc_codabar.h b/fxbarcode/cbc_codabar.h index e8a62799c6..3e2bc6f7c4 100644 --- a/fxbarcode/cbc_codabar.h +++ b/fxbarcode/cbc_codabar.h @@ -9,7 +9,6 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" #include "fxbarcode/cbc_onecode.h" class CBC_OnedCodaBarWriter; diff --git a/fxbarcode/cbc_code128.h b/fxbarcode/cbc_code128.h index 16e30de9b9..606b36e000 100644 --- a/fxbarcode/cbc_code128.h +++ b/fxbarcode/cbc_code128.h @@ -9,7 +9,6 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" #include "fxbarcode/cbc_onecode.h" class CBC_OnedCode128Writer; diff --git a/fxbarcode/cbc_code39.h b/fxbarcode/cbc_code39.h index 26f0457334..d129fa408e 100644 --- a/fxbarcode/cbc_code39.h +++ b/fxbarcode/cbc_code39.h @@ -10,7 +10,6 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" #include "fxbarcode/cbc_onecode.h" class CBC_OnedCode39Writer; diff --git a/fxbarcode/cbc_datamatrix.h b/fxbarcode/cbc_datamatrix.h index b02da555c0..f28e76235f 100644 --- a/fxbarcode/cbc_datamatrix.h +++ b/fxbarcode/cbc_datamatrix.h @@ -9,7 +9,6 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" #include "fxbarcode/cbc_codebase.h" class CBC_DataMatrixWriter; diff --git a/fxbarcode/cbc_ean13.h b/fxbarcode/cbc_ean13.h index da0fd85b25..f5887c7b83 100644 --- a/fxbarcode/cbc_ean13.h +++ b/fxbarcode/cbc_ean13.h @@ -10,7 +10,6 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" #include "fxbarcode/cbc_onecode.h" class CBC_OnedEAN13Writer; diff --git a/fxbarcode/cbc_ean8.h b/fxbarcode/cbc_ean8.h index 53eed478b8..d0c7b21e11 100644 --- a/fxbarcode/cbc_ean8.h +++ b/fxbarcode/cbc_ean8.h @@ -9,7 +9,6 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" #include "fxbarcode/cbc_onecode.h" class CBC_OnedEAN8Writer; diff --git a/fxbarcode/cbc_pdf417i.h b/fxbarcode/cbc_pdf417i.h index 37dd5b4b0c..964901034f 100644 --- a/fxbarcode/cbc_pdf417i.h +++ b/fxbarcode/cbc_pdf417i.h @@ -9,7 +9,6 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" #include "fxbarcode/cbc_codebase.h" class CBC_PDF417Writer; diff --git a/fxbarcode/cbc_qrcode.h b/fxbarcode/cbc_qrcode.h index e40fbc80a0..428d61580f 100644 --- a/fxbarcode/cbc_qrcode.h +++ b/fxbarcode/cbc_qrcode.h @@ -9,7 +9,6 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" #include "fxbarcode/cbc_codebase.h" class CBC_QRCodeWriter; diff --git a/fxbarcode/cbc_upca.h b/fxbarcode/cbc_upca.h index de71581b96..89bfc52016 100644 --- a/fxbarcode/cbc_upca.h +++ b/fxbarcode/cbc_upca.h @@ -9,7 +9,6 @@ #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" -#include "core/fxge/fx_dib.h" #include "fxbarcode/cbc_onecode.h" class CBC_OnedUPCAWriter; diff --git a/fxbarcode/oned/BC_OneDimWriter.h b/fxbarcode/oned/BC_OneDimWriter.h index 404775b6e9..db801daf42 100644 --- a/fxbarcode/oned/BC_OneDimWriter.h +++ b/fxbarcode/oned/BC_OneDimWriter.h @@ -10,13 +10,13 @@ #include <vector> #include "core/fxcrt/unowned_ptr.h" -#include "core/fxge/cfx_renderdevice.h" #include "fxbarcode/BC_Library.h" #include "fxbarcode/BC_Writer.h" class CFX_Font; class CFX_PathData; class CFX_RenderDevice; +class FXTEXT_CHARPOS; class CBC_OneDimWriter : public CBC_Writer { public: diff --git a/xfa/fde/cfde_textout.h b/xfa/fde/cfde_textout.h index e3799a3469..4db7faffe3 100644 --- a/xfa/fde/cfde_textout.h +++ b/xfa/fde/cfde_textout.h @@ -12,7 +12,6 @@ #include <vector> #include "core/fxcrt/cfx_char.h" -#include "core/fxge/cfx_defaultrenderdevice.h" #include "core/fxge/cfx_renderdevice.h" #include "core/fxge/fx_dib.h" #include "xfa/fde/cfde_data.h" diff --git a/xfa/fgas/layout/cfx_txtbreak.h b/xfa/fgas/layout/cfx_txtbreak.h index 63a6d93e87..be9ddb706d 100644 --- a/xfa/fgas/layout/cfx_txtbreak.h +++ b/xfa/fgas/layout/cfx_txtbreak.h @@ -11,11 +11,12 @@ #include <vector> #include "core/fxcrt/cfx_char.h" -#include "core/fxge/cfx_renderdevice.h" +#include "core/fxcrt/fx_coordinates.h" #include "xfa/fgas/layout/cfx_break.h" class CFDE_TextEditEngine; class CFGAS_GEFont; +class FXTEXT_CHARPOS; struct FDE_TEXTEDITPIECE; #define FX_TXTCHARSTYLE_ArabicShadda 0x0020 diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp index 030883b5cc..07e0b1bc9e 100644 --- a/xfa/fxfa/cxfa_ffdoc.cpp +++ b/xfa/fxfa/cxfa_ffdoc.cpp @@ -39,6 +39,17 @@ #include "xfa/fxfa/parser/cxfa_dynamicrender.h" #include "xfa/fxfa/parser/cxfa_node.h" +FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI() = default; +FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI(const FX_IMAGEDIB_AND_DPI& that) = + default; + +FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI(const RetainPtr<CFX_DIBBase>& pDib, + int32_t xDpi, + int32_t yDpi) + : pDibSource(pDib), iImageXDpi(xDpi), iImageYDpi(yDpi) {} + +FX_IMAGEDIB_AND_DPI::~FX_IMAGEDIB_AND_DPI() = default; + CXFA_FFDoc::CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment) : m_pDocEnvironment(pDocEnvironment), m_pApp(pApp) {} diff --git a/xfa/fxfa/cxfa_ffdoc.h b/xfa/fxfa/cxfa_ffdoc.h index 1b7536c836..d2aa74b0d6 100644 --- a/xfa/fxfa/cxfa_ffdoc.h +++ b/xfa/fxfa/cxfa_ffdoc.h @@ -17,6 +17,7 @@ class CFGAS_PDFFontMgr; class CFX_ChecksumContext; +class CFX_DIBBase; class CFX_DIBitmap; class CFX_XMLDocument; class CPDF_Document; @@ -38,18 +39,6 @@ struct FX_IMAGEDIB_AND_DPI { int32_t iImageYDpi; }; -inline FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI() = default; -inline FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI( - const FX_IMAGEDIB_AND_DPI& that) = default; - -inline FX_IMAGEDIB_AND_DPI::FX_IMAGEDIB_AND_DPI( - const RetainPtr<CFX_DIBBase>& pDib, - int32_t xDpi, - int32_t yDpi) - : pDibSource(pDib), iImageXDpi(xDpi), iImageYDpi(yDpi) {} - -inline FX_IMAGEDIB_AND_DPI::~FX_IMAGEDIB_AND_DPI() = default; - class CXFA_FFDoc { public: CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment); diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index f425ccf625..5a13c177ee 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -18,6 +18,7 @@ #include "core/fxcrt/cfx_memorystream.h" #include "core/fxcrt/maybe_owned.h" #include "core/fxge/cfx_pathdata.h" +#include "core/fxge/dib/cfx_dibitmap.h" #include "xfa/fwl/fwl_widgethit.h" #include "xfa/fxfa/cxfa_eventparam.h" #include "xfa/fxfa/cxfa_ffapp.h" diff --git a/xfa/fxfa/cxfa_imagerenderer.cpp b/xfa/fxfa/cxfa_imagerenderer.cpp index 49f953b7b9..164d056f00 100644 --- a/xfa/fxfa/cxfa_imagerenderer.cpp +++ b/xfa/fxfa/cxfa_imagerenderer.cpp @@ -8,6 +8,7 @@ #include "core/fxge/cfx_renderdevice.h" #include "core/fxge/dib/cfx_dibbase.h" +#include "core/fxge/dib/cfx_dibitmap.h" #include "core/fxge/dib/cfx_imagerenderer.h" #include "core/fxge/dib/cfx_imagetransformer.h" #include "third_party/base/ptr_util.h" diff --git a/xfa/fxfa/cxfa_imagerenderer.h b/xfa/fxfa/cxfa_imagerenderer.h index 0b727c9ab4..37e45d03b8 100644 --- a/xfa/fxfa/cxfa_imagerenderer.h +++ b/xfa/fxfa/cxfa_imagerenderer.h @@ -12,7 +12,6 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/unowned_ptr.h" -#include "core/fxge/fx_dib.h" class CFX_RenderDevice; class CFX_DIBBase; diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h index 1e89c794c8..f455238691 100644 --- a/xfa/fxfa/fxfa.h +++ b/xfa/fxfa/fxfa.h @@ -11,7 +11,6 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/retain_ptr.h" -#include "core/fxge/dib/cfx_dibbase.h" #include "core/fxge/fx_dib.h" #include "xfa/fxfa/fxfa_basic.h" diff --git a/xfa/fxgraphics/cxfa_graphics.h b/xfa/fxgraphics/cxfa_graphics.h index 3c9b269ea5..3eb6f42015 100644 --- a/xfa/fxgraphics/cxfa_graphics.h +++ b/xfa/fxgraphics/cxfa_graphics.h @@ -11,14 +11,9 @@ #include <vector> #include "core/fxcrt/fx_system.h" -#include "core/fxge/cfx_defaultrenderdevice.h" #include "core/fxge/cfx_graphstatedata.h" -#include "core/fxge/cfx_renderdevice.h" -#include "core/fxge/fx_dib.h" #include "xfa/fxgraphics/cxfa_gecolor.h" -class CXFA_GEPath; - using FX_FillMode = int32_t; enum class FX_HatchStyle { @@ -30,7 +25,9 @@ enum class FX_HatchStyle { DiagonalCross = 5 }; +class CFX_DIBBase; class CFX_RenderDevice; +class CXFA_GEPath; class CXFA_Graphics { public: |