summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render
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/fpdfapi/render
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/fpdfapi/render')
-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
10 files changed, 22 insertions, 19 deletions
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"