diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-19 17:17:54 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-19 17:17:54 -0700 |
commit | fa6eb28e08d924271d91758f945ce48a1c2dbf0c (patch) | |
tree | 6d4e627b18c5ac50cca976709ae5fb2c01b525c6 /core/src/fpdfapi/fpdf_render | |
parent | e5b0bd1a79f90b7758246655e18ef965a87bcd0b (diff) | |
download | pdfium-fa6eb28e08d924271d91758f945ce48a1c2dbf0c.tar.xz |
Merge to XFA: 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.
(cherry picked from commit 5fef754bc09e971f1bf1ba79da98c0a7ee1e1c8d)
Review URL: https://codereview.chromium.org/1189413006.
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) |