summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/render/cpdf_imagerenderer.cpp5
-rw-r--r--core/fpdfapi/render/cpdf_imagerenderer.h2
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp24
3 files changed, 16 insertions, 15 deletions
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index e6280772c8..e04bd0c0f8 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -161,13 +161,14 @@ bool CPDF_ImageRenderer::StartRenderDIBSource() {
}
bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus,
- CPDF_PageObject* pObj,
+ CPDF_ImageObject* pImageObject,
const CFX_Matrix* pObj2Device,
bool bStdCS,
int blendType) {
+ ASSERT(pImageObject);
m_pRenderStatus = pStatus;
m_bStdCS = bStdCS;
- m_pImageObject = pObj->AsImage();
+ m_pImageObject = pImageObject;
m_BlendType = blendType;
m_pObj2Device = pObj2Device;
CPDF_Dictionary* pOC = m_pImageObject->GetImage()->GetOC();
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.h b/core/fpdfapi/render/cpdf_imagerenderer.h
index 46159284b2..345860107f 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.h
+++ b/core/fpdfapi/render/cpdf_imagerenderer.h
@@ -29,7 +29,7 @@ class CPDF_ImageRenderer {
~CPDF_ImageRenderer();
bool Start(CPDF_RenderStatus* pStatus,
- CPDF_PageObject* pObj,
+ CPDF_ImageObject* pImageObject,
const CFX_Matrix* pObj2Device,
bool bStdCS,
int blendType);
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index a08650500b..6c5d7bc102 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -1122,20 +1122,20 @@ bool CPDF_RenderStatus::ContinueSingleObject(CPDF_PageObject* pObj,
if (ProcessTransparency(pObj, pObj2Device))
return false;
- if (pObj->IsImage()) {
- m_pImageRenderer = pdfium::MakeUnique<CPDF_ImageRenderer>();
- if (!m_pImageRenderer->Start(this, pObj, pObj2Device, false,
- FXDIB_BLEND_NORMAL)) {
- if (!m_pImageRenderer->GetResult())
- DrawObjWithBackground(pObj, pObj2Device);
- m_pImageRenderer.reset();
- return false;
- }
- return ContinueSingleObject(pObj, pObj2Device, pPause);
+ if (!pObj->IsImage()) {
+ ProcessObjectNoClip(pObj, pObj2Device);
+ return false;
}
- ProcessObjectNoClip(pObj, pObj2Device);
- return false;
+ m_pImageRenderer = pdfium::MakeUnique<CPDF_ImageRenderer>();
+ if (!m_pImageRenderer->Start(this, pObj->AsImage(), pObj2Device, false,
+ FXDIB_BLEND_NORMAL)) {
+ if (!m_pImageRenderer->GetResult())
+ DrawObjWithBackground(pObj, pObj2Device);
+ m_pImageRenderer.reset();
+ return false;
+ }
+ return ContinueSingleObject(pObj, pObj2Device, pPause);
}
bool CPDF_RenderStatus::GetObjectClippedRect(const CPDF_PageObject* pObj,