diff options
author | Lei Zhang <thestig@chromium.org> | 2018-05-07 20:44:37 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-07 20:44:37 +0000 |
commit | 0c290e89dc29c7019033bff14c9e49ebc0caa9bd (patch) | |
tree | 7e295b4f5fc07d0e2eaeded3708d8207383b3a07 /core/fpdfapi | |
parent | 7a38ca461520ab6ad34dc1271a04c64dd71415c4 (diff) | |
download | pdfium-0c290e89dc29c7019033bff14c9e49ebc0caa9bd.tar.xz |
Initialize CPDF_RenderStatus members in the header.
Also move static private members into the .cpp file.
Change-Id: Idbbdc7c78ac4199968888466caa20c58a5653dfd
Reviewed-on: https://pdfium-review.googlesource.com/32151
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/render/cpdf_renderstatus.cpp | 27 | ||||
-rw-r--r-- | core/fpdfapi/render/cpdf_renderstatus.h | 27 |
2 files changed, 17 insertions, 37 deletions
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp index abccde52b4..4df9f18375 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.cpp +++ b/core/fpdfapi/render/cpdf_renderstatus.cpp @@ -68,6 +68,8 @@ namespace { constexpr int kShadingSteps = 256; +constexpr int kRenderMaxRecursionDepth = 64; +int g_CurrentRecursionDepth = 0; void ReleaseCachedType3(CPDF_Type3Font* pFont) { CPDF_Document* pDoc = pFont->GetDocument(); @@ -1010,26 +1012,7 @@ bool Type3CharMissingStrokeColor(const CPDF_Type3Char* pChar, } // namespace -// static -int CPDF_RenderStatus::s_CurrentRecursionDepth = 0; - -CPDF_RenderStatus::CPDF_RenderStatus() - : m_pFormResource(nullptr), - m_pPageResource(nullptr), - m_pContext(nullptr), - m_bStopped(false), - m_pDevice(nullptr), - m_pCurObj(nullptr), - m_pStopObj(nullptr), - m_bPrint(false), - m_iTransparency(0), - m_bDropObjects(false), - m_bStdCS(false), - m_GroupFamily(0), - m_bLoadMask(false), - m_pType3Char(nullptr), - m_T3FillColor(0), - m_curBlend(FXDIB_BLEND_NORMAL) {} +CPDF_RenderStatus::CPDF_RenderStatus() {} CPDF_RenderStatus::~CPDF_RenderStatus() {} @@ -1126,8 +1109,8 @@ void CPDF_RenderStatus::RenderSingleObject(CPDF_PageObject* pObj, #if defined _SKIA_SUPPORT_ DebugVerifyDeviceIsPreMultiplied(); #endif - AutoRestorer<int> restorer(&s_CurrentRecursionDepth); - if (++s_CurrentRecursionDepth > kRenderMaxRecursionDepth) { + AutoRestorer<int> restorer(&g_CurrentRecursionDepth); + if (++g_CurrentRecursionDepth > kRenderMaxRecursionDepth) { return; } m_pCurObj = pObj; diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h index 6d5e680363..c6be9883d2 100644 --- a/core/fpdfapi/render/cpdf_renderstatus.h +++ b/core/fpdfapi/render/cpdf_renderstatus.h @@ -156,31 +156,28 @@ class CPDF_RenderStatus { FX_RECT GetObjectClippedRect(const CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device) const; - static const int kRenderMaxRecursionDepth = 64; - static int s_CurrentRecursionDepth; - CPDF_RenderOptions m_Options; UnownedPtr<CPDF_Dictionary> m_pFormResource; UnownedPtr<CPDF_Dictionary> m_pPageResource; std::vector<CPDF_Type3Font*> m_Type3FontCache; UnownedPtr<CPDF_RenderContext> m_pContext; - bool m_bStopped; - CFX_RenderDevice* m_pDevice; + bool m_bStopped = false; + CFX_RenderDevice* m_pDevice = nullptr; CFX_Matrix m_DeviceMatrix; CPDF_ClipPath m_LastClipPath; - const CPDF_PageObject* m_pCurObj; - const CPDF_PageObject* m_pStopObj; + const CPDF_PageObject* m_pCurObj = nullptr; + const CPDF_PageObject* m_pStopObj = nullptr; CPDF_GraphicStates m_InitialStates; std::unique_ptr<CPDF_ImageRenderer> m_pImageRenderer; - bool m_bPrint; - int m_iTransparency; - bool m_bDropObjects; - bool m_bStdCS; - uint32_t m_GroupFamily; - bool m_bLoadMask; + bool m_bPrint = false; + int m_iTransparency = 0; + bool m_bDropObjects = false; + bool m_bStdCS = false; + uint32_t m_GroupFamily = 0; + bool m_bLoadMask = false; UnownedPtr<CPDF_Type3Char> m_pType3Char; - FX_ARGB m_T3FillColor; - int m_curBlend; + FX_ARGB m_T3FillColor = 0; + int m_curBlend = FXDIB_BLEND_NORMAL; }; #endif // CORE_FPDFAPI_RENDER_CPDF_RENDERSTATUS_H_ |