diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-15 17:15:12 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-15 17:15:12 -0700 |
commit | 5fef754bc09e971f1bf1ba79da98c0a7ee1e1c8d (patch) | |
tree | cd30e84ea6ab945b5f7312468546c510c08049b1 /core/src/fpdfapi/fpdf_render | |
parent | 0ef0de55657db8a83372ad8eb22d84c5893afc4c (diff) | |
download | pdfium-5fef754bc09e971f1bf1ba79da98c0a7ee1e1c8d.tar.xz |
Make CPDF_PageModuleDef and CPDF_RenderModuleDef pure virtual.
Get rid of the dummy implementations, which are never used when
the modules have been initialized.
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1177383003.
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render.cpp | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp index 608e124118..06c9ea614f 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render.cpp @@ -78,34 +78,40 @@ void CPDF_DocRenderData::ReleaseCachedType3(CPDF_Type3Font* pFont) if (m_Type3FaceMap.Lookup(pFont, pCache)) pCache->RemoveRef(); } -class CPDF_RenderModule : public CPDF_RenderModuleDef + +class CPDF_RenderModule : public IPDF_RenderModule { public: - virtual ~CPDF_RenderModule() {} - virtual FX_BOOL Installed() - { - return TRUE; - } - virtual CPDF_DocRenderData* CreateDocData(CPDF_Document* pDoc); - virtual void DestroyDocData(CPDF_DocRenderData* p); - virtual void ClearDocData(CPDF_DocRenderData* p); - virtual CPDF_DocRenderData* GetRenderData() + CPDF_RenderModule() {} + +private: + ~CPDF_RenderModule() override {} + + CPDF_DocRenderData* CreateDocData(CPDF_Document* pDoc) override; + void DestroyDocData(CPDF_DocRenderData* p) override; + void ClearDocData(CPDF_DocRenderData* p) override; + + CPDF_DocRenderData* GetRenderData() override { return &m_RenderData; } - virtual CPDF_PageRenderCache* CreatePageCache(CPDF_Page* pPage) + + CPDF_PageRenderCache* CreatePageCache(CPDF_Page* pPage) override { return new CPDF_PageRenderCache(pPage); } - virtual void DestroyPageCache(CPDF_PageRenderCache* pCache); - virtual CPDF_RenderConfig* GetConfig() + + void DestroyPageCache(CPDF_PageRenderCache* pCache) override; + + CPDF_RenderConfig* GetConfig() override { return &m_RenderConfig; } -private: - CPDF_DocRenderData m_RenderData; - CPDF_RenderConfig m_RenderConfig; + + CPDF_DocRenderData m_RenderData; + CPDF_RenderConfig m_RenderConfig; }; + CPDF_DocRenderData* CPDF_RenderModule::CreateDocData(CPDF_Document* pDoc) { CPDF_DocRenderData* pData = new CPDF_DocRenderData(pDoc); @@ -126,11 +132,12 @@ void CPDF_RenderModule::DestroyPageCache(CPDF_PageRenderCache* pCache) { delete pCache; } + void CPDF_ModuleMgr::InitRenderModule() { - delete m_pRenderModule; - m_pRenderModule = new CPDF_RenderModule; + m_pRenderModule.reset(new CPDF_RenderModule); } + CPDF_RenderOptions::CPDF_RenderOptions() : m_ColorMode(RENDER_COLOR_NORMAL) , m_Flags(RENDER_CLEARTYPE) |