summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-02-22 17:27:07 -0800
committerWei Li <weili@chromium.org>2016-02-22 17:27:07 -0800
commit4f4de9a14eed86bb49340079b9bd43ed7a3caf70 (patch)
tree2a97fb41237f4058d6fc69c9695405fb4aefabc5 /core/src/fpdfapi/fpdf_render
parentd219a247dfaa697f9761ee558b58c23680509058 (diff)
downloadpdfium-4f4de9a14eed86bb49340079b9bd43ed7a3caf70.tar.xz
refactor CPDF_PageObject and subclasses
Use virtual functions to replace type based logic; remove unused functions; disable default copy constructor/assign operator. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1720003003 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp2
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp3
-rw-r--r--core/src/fpdfapi/fpdf_render/render_int.h2
3 files changed, 3 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index acfc083e0e..954d3886b5 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -462,7 +462,7 @@ FX_BOOL CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus,
int blendType) {
m_pRenderStatus = pStatus;
m_bStdCS = bStdCS;
- m_pImageObject = (CPDF_ImageObject*)pObj;
+ m_pImageObject = pObj->AsImage();
m_BlendType = blendType;
m_pObj2Device = pObj2Device;
CPDF_Dictionary* pOC = m_pImageObject->m_pImage->GetOC();
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 769ee05dc9..136c318339 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -731,8 +731,7 @@ void CPDF_RenderStatus::DrawTextPathWithPattern(const CPDF_TextObject* textobj,
FX_BOOL bStroke) {
if (!bStroke) {
CPDF_PathObject path;
- CPDF_TextObject* pCopy = new CPDF_TextObject;
- pCopy->Copy(textobj);
+ CPDF_TextObject* pCopy = textobj->Clone();
path.m_bStroke = FALSE;
path.m_FillType = FXFILL_WINDING;
path.m_ClipPath.AppendTexts(&pCopy, 1);
diff --git a/core/src/fpdfapi/fpdf_render/render_int.h b/core/src/fpdfapi/fpdf_render/render_int.h
index 5af5909d2e..b7f007dd5d 100644
--- a/core/src/fpdfapi/fpdf_render/render_int.h
+++ b/core/src/fpdfapi/fpdf_render/render_int.h
@@ -340,7 +340,7 @@ class CPDF_ImageRenderer : public IPDF_ObjectRenderer {
protected:
CPDF_RenderStatus* m_pRenderStatus;
- CPDF_ImageObject* m_pImageObject;
+ const CPDF_ImageObject* m_pImageObject;
int m_Status;
const CFX_Matrix* m_pObj2Device;
CFX_Matrix m_ImageMatrix;