summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-15 19:02:38 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-15 19:02:38 +0000
commitb6e3d231ef2c28df1e5149cb16ad7046ebb0714e (patch)
treedf242fdcd352fd4239be92cad2cf5f4cefdc08fd /core
parent48ae3075a5c80e75923a60d4d0ba0b56d9b08c2a (diff)
downloadpdfium-b6e3d231ef2c28df1e5149cb16ad7046ebb0714e.tar.xz
Make CPDF_RenderStatus::Initialize() saner.
Move mandatory arguments to ctor. Replace long list of positional parameters with setter methods. Make Initialize() return void since it can't fail. Change-Id: I490118923855158891cf45eecd5de1e922a3a1fe Reviewed-on: https://pdfium-review.googlesource.com/40170 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/render/cpdf_imagerenderer.cpp48
-rw-r--r--core/fpdfapi/render/cpdf_progressiverenderer.cpp16
-rw-r--r--core/fpdfapi/render/cpdf_rendercontext.cpp19
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp122
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.h46
5 files changed, 126 insertions, 125 deletions
diff --git a/core/fpdfapi/render/cpdf_imagerenderer.cpp b/core/fpdfapi/render/cpdf_imagerenderer.cpp
index c7334f6ad3..9f14e8470c 100644
--- a/core/fpdfapi/render/cpdf_imagerenderer.cpp
+++ b/core/fpdfapi/render/cpdf_imagerenderer.cpp
@@ -76,7 +76,7 @@ bool CPDF_ImageRenderer::StartRenderDIBSource() {
CPDF_GeneralState& state = m_pImageObject->m_GeneralState;
m_BitmapAlpha = FXSYS_round(255 * state.GetFillAlpha());
m_pDIBSource = m_Loader.m_pBitmap;
- if (m_pRenderStatus->GetRenderOptions()->ColorModeIs(
+ if (m_pRenderStatus->GetRenderOptions().ColorModeIs(
CPDF_RenderOptions::kAlpha) &&
!m_Loader.m_pMask) {
return StartBitmapAlpha();
@@ -104,7 +104,7 @@ bool CPDF_ImageRenderer::StartRenderDIBSource() {
m_bPatternColor = true;
}
m_FillArgb = m_pRenderStatus->GetFillArgb(m_pImageObject.Get());
- } else if (m_pRenderStatus->GetRenderOptions()->ColorModeIs(
+ } else if (m_pRenderStatus->GetRenderOptions().ColorModeIs(
CPDF_RenderOptions::kGray)) {
RetainPtr<CFX_DIBitmap> pClone = m_pDIBSource->Clone(nullptr);
if (!pClone)
@@ -114,15 +114,15 @@ bool CPDF_ImageRenderer::StartRenderDIBSource() {
m_pDIBSource = pClone;
}
m_Flags = 0;
- if (m_pRenderStatus->GetRenderOptions()->HasFlag(RENDER_FORCE_DOWNSAMPLE))
+ if (m_pRenderStatus->GetRenderOptions().HasFlag(RENDER_FORCE_DOWNSAMPLE))
m_Flags |= RENDER_FORCE_DOWNSAMPLE;
- else if (m_pRenderStatus->GetRenderOptions()->HasFlag(RENDER_FORCE_HALFTONE))
+ else if (m_pRenderStatus->GetRenderOptions().HasFlag(RENDER_FORCE_HALFTONE))
m_Flags |= RENDER_FORCE_HALFTONE;
if (m_pRenderStatus->GetRenderDevice()->GetDeviceClass() != FXDC_DISPLAY)
HandleFilters();
- if (m_pRenderStatus->GetRenderOptions()->HasFlag(RENDER_NOIMAGESMOOTH))
+ if (m_pRenderStatus->GetRenderOptions().HasFlag(RENDER_NOIMAGESMOOTH))
m_Flags |= FXDIB_NOSMOOTH;
else if (m_pImageObject->GetImage()->IsInterpol())
m_Flags |= FXDIB_INTERPOL;
@@ -176,8 +176,8 @@ bool CPDF_ImageRenderer::Start(CPDF_RenderStatus* pStatus,
m_BlendType = blendType;
m_pObj2Device = pObj2Device;
const CPDF_Dictionary* pOC = m_pImageObject->GetImage()->GetOC();
- if (pOC && m_pRenderStatus->GetRenderOptions()->GetOCContext() &&
- !m_pRenderStatus->GetRenderOptions()->GetOCContext()->CheckOCGVisible(
+ if (pOC && m_pRenderStatus->GetRenderOptions().GetOCContext() &&
+ !m_pRenderStatus->GetRenderOptions().GetOCContext()->CheckOCGVisible(
pOC)) {
return false;
}
@@ -231,11 +231,12 @@ void CPDF_ImageRenderer::CalculateDrawImage(
const RetainPtr<CFX_DIBSource>& pDIBSource,
CFX_Matrix* pNewMatrix,
const FX_RECT& rect) const {
- CPDF_RenderStatus bitmap_render;
- bitmap_render.Initialize(m_pRenderStatus->GetContext(), pBitmapDevice2,
- nullptr, nullptr, nullptr, nullptr, nullptr,
- CPDF_Transparency(),
- m_pRenderStatus->GetDropObjects(), nullptr, true);
+ CPDF_RenderStatus bitmap_render(m_pRenderStatus->GetContext(),
+ pBitmapDevice2);
+ bitmap_render.SetDropObjects(m_pRenderStatus->GetDropObjects());
+ bitmap_render.SetStdCS(true);
+ bitmap_render.Initialize(nullptr, nullptr);
+
CPDF_ImageRenderer image_render;
if (image_render.Start(&bitmap_render, pDIBSource, 0xffffffff, 255,
pNewMatrix, m_Flags, true, FXDIB_BLEND_NORMAL)) {
@@ -282,11 +283,14 @@ bool CPDF_ImageRenderer::DrawPatternImage(const CFX_Matrix* pObj2Device) {
return true;
bitmap_device1.GetBitmap()->Clear(0xffffff);
- CPDF_RenderStatus bitmap_render;
- bitmap_render.Initialize(
- m_pRenderStatus->GetContext(), &bitmap_device1, nullptr, nullptr, nullptr,
- nullptr, m_pRenderStatus->GetRenderOptions(), CPDF_Transparency(),
- m_pRenderStatus->GetDropObjects(), nullptr, true);
+
+ CPDF_RenderStatus bitmap_render(m_pRenderStatus->GetContext(),
+ &bitmap_device1);
+ bitmap_render.SetOptions(m_pRenderStatus->GetRenderOptions());
+ bitmap_render.SetDropObjects(m_pRenderStatus->GetDropObjects());
+ bitmap_render.SetStdCS(true);
+ bitmap_render.Initialize(nullptr, nullptr);
+
CFX_Matrix patternDevice = *pObj2Device;
patternDevice.Translate(static_cast<float>(-rect.left),
static_cast<float>(-rect.top));
@@ -335,11 +339,11 @@ bool CPDF_ImageRenderer::DrawMaskedImage() {
#else
bitmap_device1.GetBitmap()->Clear(0xffffff);
#endif
- CPDF_RenderStatus bitmap_render;
- bitmap_render.Initialize(m_pRenderStatus->GetContext(), &bitmap_device1,
- nullptr, nullptr, nullptr, nullptr, nullptr,
- CPDF_Transparency(),
- m_pRenderStatus->GetDropObjects(), nullptr, true);
+ CPDF_RenderStatus bitmap_render(m_pRenderStatus->GetContext(),
+ &bitmap_device1);
+ bitmap_render.SetDropObjects(m_pRenderStatus->GetDropObjects());
+ bitmap_render.SetStdCS(true);
+ bitmap_render.Initialize(nullptr, nullptr);
CPDF_ImageRenderer image_render;
if (image_render.Start(&bitmap_render, m_pDIBSource, 0, 255, &new_matrix,
m_Flags, true, FXDIB_BLEND_NORMAL)) {
diff --git a/core/fpdfapi/render/cpdf_progressiverenderer.cpp b/core/fpdfapi/render/cpdf_progressiverenderer.cpp
index de140d8a22..15b58fbefe 100644
--- a/core/fpdfapi/render/cpdf_progressiverenderer.cpp
+++ b/core/fpdfapi/render/cpdf_progressiverenderer.cpp
@@ -54,11 +54,13 @@ void CPDF_ProgressiveRenderer::Continue(PauseIndicatorIface* pPause) {
m_pCurrentLayer = m_pContext->GetLayer(m_LayerIndex);
m_LastObjectRendered =
m_pCurrentLayer->m_pObjectHolder->GetPageObjectList()->end();
- m_pRenderStatus = pdfium::MakeUnique<CPDF_RenderStatus>();
- m_pRenderStatus->Initialize(
- m_pContext.Get(), m_pDevice.Get(), nullptr, nullptr, nullptr, nullptr,
- m_pOptions, m_pCurrentLayer->m_pObjectHolder->GetTransparency(),
- false, nullptr);
+ m_pRenderStatus = pdfium::MakeUnique<CPDF_RenderStatus>(m_pContext.Get(),
+ m_pDevice.Get());
+ if (m_pOptions)
+ m_pRenderStatus->SetOptions(*m_pOptions);
+ m_pRenderStatus->SetTransparency(
+ m_pCurrentLayer->m_pObjectHolder->GetTransparency());
+ m_pRenderStatus->Initialize(nullptr, nullptr);
m_pDevice->SaveState();
m_ClipRect = m_pCurrentLayer->m_Matrix.GetInverse().TransformRect(
CFX_FloatRect(m_pDevice->GetClipBox()));
@@ -94,10 +96,10 @@ void CPDF_ProgressiveRenderer::Continue(PauseIndicatorIface* pPause) {
pCurObj, &m_pCurrentLayer->m_Matrix, pPause)) {
return;
}
- if (pCurObj->IsImage() && m_pRenderStatus->GetRenderOptions()->HasFlag(
+ if (pCurObj->IsImage() && m_pRenderStatus->GetRenderOptions().HasFlag(
RENDER_LIMITEDIMAGECACHE)) {
m_pContext->GetPageCache()->CacheOptimization(
- m_pRenderStatus->GetRenderOptions()->GetCacheSizeLimit());
+ m_pRenderStatus->GetRenderOptions().GetCacheSizeLimit());
}
if (pCurObj->IsForm() || pCurObj->IsShading())
nObjsToGo = 0;
diff --git a/core/fpdfapi/render/cpdf_rendercontext.cpp b/core/fpdfapi/render/cpdf_rendercontext.cpp
index fc756e7a90..48b87d9f2c 100644
--- a/core/fpdfapi/render/cpdf_rendercontext.cpp
+++ b/core/fpdfapi/render/cpdf_rendercontext.cpp
@@ -65,23 +65,24 @@ void CPDF_RenderContext::Render(CFX_RenderDevice* pDevice,
const CFX_Matrix* pLastMatrix) {
for (auto& layer : m_Layers) {
CFX_RenderDevice::StateRestorer restorer(pDevice);
- CPDF_RenderStatus status;
+ CPDF_RenderStatus status(this, pDevice);
+ if (pOptions)
+ status.SetOptions(*pOptions);
+ status.SetStopObject(pStopObj);
+ status.SetTransparency(layer.m_pObjectHolder->GetTransparency());
if (pLastMatrix) {
CFX_Matrix FinalMatrix = layer.m_Matrix;
FinalMatrix.Concat(*pLastMatrix);
- status.Initialize(this, pDevice, pLastMatrix, pStopObj, nullptr, nullptr,
- pOptions, layer.m_pObjectHolder->GetTransparency(),
- false, nullptr);
+ status.SetDeviceMatrix(*pLastMatrix);
+ status.Initialize(nullptr, nullptr);
status.RenderObjectList(layer.m_pObjectHolder.Get(), &FinalMatrix);
} else {
- status.Initialize(this, pDevice, nullptr, pStopObj, nullptr, nullptr,
- pOptions, layer.m_pObjectHolder->GetTransparency(),
- false, nullptr);
+ status.Initialize(nullptr, nullptr);
status.RenderObjectList(layer.m_pObjectHolder.Get(), &layer.m_Matrix);
}
- if (status.GetRenderOptions()->HasFlag(RENDER_LIMITEDIMAGECACHE)) {
+ if (status.GetRenderOptions().HasFlag(RENDER_LIMITEDIMAGECACHE)) {
m_pPageCache->CacheOptimization(
- status.GetRenderOptions()->GetCacheSizeLimit());
+ status.GetRenderOptions().GetCacheSizeLimit());
}
if (status.IsStopped())
break;
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 85e446f1a5..76c5e87228 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -998,42 +998,15 @@ bool Type3CharMissingStrokeColor(const CPDF_Type3Char* pChar,
} // namespace
-CPDF_RenderStatus::CPDF_RenderStatus() {}
+CPDF_RenderStatus::CPDF_RenderStatus(CPDF_RenderContext* pContext,
+ CFX_RenderDevice* pDevice)
+ : m_pContext(pContext), m_pDevice(pDevice) {}
CPDF_RenderStatus::~CPDF_RenderStatus() {}
-bool CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext,
- CFX_RenderDevice* pDevice,
- const CFX_Matrix* pDeviceMatrix,
- const CPDF_PageObject* pStopObj,
- const CPDF_RenderStatus* pParentState,
- const CPDF_GraphicStates* pInitialStates,
- const CPDF_RenderOptions* pOptions,
- const CPDF_Transparency& transparency,
- bool bDropObjects,
- const CPDF_Dictionary* pFormResource,
- bool bStdCS,
- CPDF_Type3Char* pType3Char,
- FX_ARGB fill_color,
- uint32_t GroupFamily,
- bool bLoadMask) {
- m_pContext = pContext;
- m_pDevice = pDevice;
+void CPDF_RenderStatus::Initialize(const CPDF_RenderStatus* pParentState,
+ const CPDF_GraphicStates* pInitialStates) {
m_bPrint = m_pDevice->GetDeviceClass() != FXDC_DISPLAY;
- if (pDeviceMatrix) {
- m_DeviceMatrix = *pDeviceMatrix;
- }
- m_pStopObj = pStopObj;
- if (pOptions) {
- m_Options = *pOptions;
- }
- m_bDropObjects = bDropObjects;
- m_bStdCS = bStdCS;
- m_T3FillColor = fill_color;
- m_pType3Char = pType3Char;
- m_GroupFamily = GroupFamily;
- m_bLoadMask = bLoadMask;
- m_pFormResource = pFormResource;
m_pPageResource = m_pContext->GetPageResources();
if (pInitialStates && !m_pType3Char) {
m_InitialStates.CopyStates(*pInitialStates);
@@ -1054,9 +1027,6 @@ bool CPDF_RenderStatus::Initialize(CPDF_RenderContext* pContext,
} else {
m_InitialStates.DefaultStates();
}
- m_pImageRenderer.reset();
- m_Transparency = transparency;
- return true;
}
void CPDF_RenderStatus::RenderObjectList(
@@ -1230,10 +1200,13 @@ void CPDF_RenderStatus::DrawObjWithBackground(CPDF_PageObject* pObj,
if (pFormDict)
pFormResource = pFormDict->GetDictFor("Resources");
}
- CPDF_RenderStatus status;
- status.Initialize(m_pContext.Get(), buffer.GetDevice(), buffer.GetMatrix(),
- nullptr, nullptr, nullptr, &m_Options, m_Transparency,
- m_bDropObjects, pFormResource);
+ CPDF_RenderStatus status(m_pContext.Get(), buffer.GetDevice());
+ status.SetOptions(m_Options);
+ status.SetDeviceMatrix(*buffer.GetMatrix());
+ status.SetTransparency(m_Transparency);
+ status.SetDropObjects(m_bDropObjects);
+ status.SetFormResource(pFormResource);
+ status.Initialize(nullptr, nullptr);
status.RenderSingleObject(pObj, &matrix);
buffer.OutputToDevice();
}
@@ -1253,10 +1226,13 @@ bool CPDF_RenderStatus::ProcessForm(const CPDF_FormObject* pFormObj,
const CPDF_Dictionary* pFormDict = pFormObj->form()->GetDict();
const CPDF_Dictionary* pResources =
pFormDict ? pFormDict->GetDictFor("Resources") : nullptr;
- CPDF_RenderStatus status;
- status.Initialize(m_pContext.Get(), m_pDevice, nullptr, m_pStopObj, this,
- pFormObj, &m_Options, m_Transparency, m_bDropObjects,
- pResources, false);
+ CPDF_RenderStatus status(m_pContext.Get(), m_pDevice);
+ status.SetOptions(m_Options);
+ status.SetStopObject(m_pStopObj);
+ status.SetTransparency(m_Transparency);
+ status.SetDropObjects(m_bDropObjects);
+ status.SetFormResource(pResources);
+ status.Initialize(this, pFormObj);
status.m_curBlend = m_curBlend;
{
CFX_RenderDevice::StateRestorer restorer(m_pDevice);
@@ -1590,10 +1566,13 @@ bool CPDF_RenderStatus::ProcessTransparency(CPDF_PageObject* pPageObj,
(FX_ARGB)-1, 0, nullptr, 0);
}
}
- CPDF_RenderStatus bitmap_render;
- bitmap_render.Initialize(
- m_pContext.Get(), &bitmap_device, nullptr, m_pStopObj, nullptr, nullptr,
- &m_Options, CPDF_Transparency(), m_bDropObjects, pFormResource, true);
+ CPDF_RenderStatus bitmap_render(m_pContext.Get(), &bitmap_device);
+ bitmap_render.SetOptions(m_Options);
+ bitmap_render.SetStopObject(m_pStopObj);
+ bitmap_render.SetStdCS(true);
+ bitmap_render.SetDropObjects(m_bDropObjects);
+ bitmap_render.SetFormResource(pFormResource);
+ bitmap_render.Initialize(nullptr, nullptr);
bitmap_render.ProcessObjectNoClip(pPageObj, &new_matrix);
#if defined _SKIA_SUPPORT_PATHS_
bitmap_device.Flush(true);
@@ -1880,11 +1859,14 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj,
pFormResource = pType3Char->form()->GetDict()->GetDictFor("Resources");
}
if (fill_alpha == 255) {
- CPDF_RenderStatus status;
- status.Initialize(m_pContext.Get(), m_pDevice, nullptr, nullptr, this,
- pStates.get(), &options,
- pType3Char->form()->GetTransparency(), m_bDropObjects,
- pFormResource, false, pType3Char, fill_argb);
+ CPDF_RenderStatus status(m_pContext.Get(), m_pDevice);
+ status.SetOptions(options);
+ status.SetTransparency(pType3Char->form()->GetTransparency());
+ status.SetType3Char(pType3Char);
+ status.SetFillColor(fill_argb);
+ status.SetDropObjects(m_bDropObjects);
+ status.SetFormResource(pFormResource);
+ status.Initialize(this, pStates.get());
status.m_Type3FontCache = m_Type3FontCache;
status.m_Type3FontCache.push_back(pType3Font);
@@ -1900,11 +1882,14 @@ bool CPDF_RenderStatus::ProcessType3Text(CPDF_TextObject* textobj,
return true;
}
bitmap_device.GetBitmap()->Clear(0);
- CPDF_RenderStatus status;
- status.Initialize(m_pContext.Get(), &bitmap_device, nullptr, nullptr,
- this, pStates.get(), &options,
- pType3Char->form()->GetTransparency(), m_bDropObjects,
- pFormResource, false, pType3Char, fill_argb);
+ CPDF_RenderStatus status(m_pContext.Get(), &bitmap_device);
+ status.SetOptions(options);
+ status.SetTransparency(pType3Char->form()->GetTransparency());
+ status.SetType3Char(pType3Char);
+ status.SetFillColor(fill_argb);
+ status.SetDropObjects(m_bDropObjects);
+ status.SetFormResource(pFormResource);
+ status.Initialize(this, pStates.get());
status.m_Type3FontCache = m_Type3FontCache;
status.m_Type3FontCache.push_back(pType3Font);
matrix.Translate(-rect.left, -rect.top);
@@ -2244,11 +2229,12 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern,
matrix.Translate(original.x - mtPattern2Device.e,
original.y - mtPattern2Device.f);
CFX_RenderDevice::StateRestorer restorer2(m_pDevice);
- CPDF_RenderStatus status;
- status.Initialize(m_pContext.Get(), m_pDevice, nullptr, nullptr, this,
- pStates.get(), &m_Options,
- pPattern->form()->GetTransparency(), m_bDropObjects,
- pFormResource);
+ CPDF_RenderStatus status(m_pContext.Get(), m_pDevice);
+ status.SetOptions(m_Options);
+ status.SetTransparency(pPattern->form()->GetTransparency());
+ status.SetFormResource(pFormResource);
+ status.SetDropObjects(m_bDropObjects);
+ status.Initialize(this, pStates.get());
status.RenderObjectList(pPattern->form(), &matrix);
}
}
@@ -2570,10 +2556,14 @@ RetainPtr<CFX_DIBitmap> CPDF_RenderStatus::LoadSMask(
CPDF_RenderOptions options;
options.SetColorMode(bLuminosity ? CPDF_RenderOptions::kNormal
: CPDF_RenderOptions::kAlpha);
- CPDF_RenderStatus status;
- status.Initialize(m_pContext.Get(), &bitmap_device, nullptr, nullptr, nullptr,
- nullptr, &options, CPDF_Transparency(), m_bDropObjects,
- pFormResource, true, nullptr, 0, nCSFamily, bLuminosity);
+ CPDF_RenderStatus status(m_pContext.Get(), &bitmap_device);
+ status.SetOptions(options);
+ status.SetGroupFamily(nCSFamily);
+ status.SetLoadMask(bLuminosity);
+ status.SetStdCS(true);
+ status.SetFormResource(pFormResource);
+ status.SetDropObjects(m_bDropObjects);
+ status.Initialize(nullptr, nullptr);
status.RenderObjectList(&form, &matrix);
auto pMask = pdfium::MakeRetain<CFX_DIBitmap>();
diff --git a/core/fpdfapi/render/cpdf_renderstatus.h b/core/fpdfapi/render/cpdf_renderstatus.h
index 92b96f9bec..b15c1d1482 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.h
+++ b/core/fpdfapi/render/cpdf_renderstatus.h
@@ -29,6 +29,7 @@ class CPDF_Object;
class CPDF_PageObject;
class CPDF_PageObjectHolder;
class CPDF_PathObject;
+class CPDF_RenderContext;
class CPDF_ShadingObject;
class CPDF_ShadingPattern;
class CPDF_TilingPattern;
@@ -39,24 +40,27 @@ class CPDF_Type3Font;
class CPDF_RenderStatus {
public:
- CPDF_RenderStatus();
+ CPDF_RenderStatus(CPDF_RenderContext* pContext, CFX_RenderDevice* pDevice);
~CPDF_RenderStatus();
- bool Initialize(class CPDF_RenderContext* pContext,
- CFX_RenderDevice* pDevice,
- const CFX_Matrix* pDeviceMatrix,
- const CPDF_PageObject* pStopObj,
- const CPDF_RenderStatus* pParentStatus,
- const CPDF_GraphicStates* pInitialStates,
- const CPDF_RenderOptions* pOptions,
- const CPDF_Transparency& transparency,
- bool bDropObjects,
- const CPDF_Dictionary* pFormResource = nullptr,
- bool bStdCS = false,
- CPDF_Type3Char* pType3Char = nullptr,
- FX_ARGB fill_color = 0,
- uint32_t GroupFamily = 0,
- bool bLoadMask = false);
+ // Called prior to Initialize().
+ void SetOptions(const CPDF_RenderOptions& options) { m_Options = options; }
+ void SetDeviceMatrix(const CFX_Matrix& matrix) { m_DeviceMatrix = matrix; }
+ void SetStopObject(const CPDF_PageObject* pStopObj) { m_pStopObj = pStopObj; }
+ void SetFormResource(const CPDF_Dictionary* pRes) { m_pFormResource = pRes; }
+ void SetType3Char(CPDF_Type3Char* pType3Char) { m_pType3Char = pType3Char; }
+ void SetFillColor(FX_ARGB color) { m_T3FillColor = color; }
+ void SetDropObjects(bool bDropObjects) { m_bDropObjects = bDropObjects; }
+ void SetLoadMask(bool bLoadMask) { m_bLoadMask = bLoadMask; }
+ void SetStdCS(bool bStdCS) { m_bStdCS = bStdCS; }
+ void SetGroupFamily(uint32_t family) { m_GroupFamily = family; }
+ void SetTransparency(const CPDF_Transparency& transparency) {
+ m_Transparency = transparency;
+ }
+
+ void Initialize(const CPDF_RenderStatus* pParentStatus,
+ const CPDF_GraphicStates* pInitialStates);
+
void RenderObjectList(const CPDF_PageObjectHolder* pObjectHolder,
const CFX_Matrix* pObj2Device);
void RenderSingleObject(CPDF_PageObject* pObj, const CFX_Matrix* pObj2Device);
@@ -77,7 +81,7 @@ class CPDF_RenderStatus {
}
CPDF_Dictionary* GetPageResource() const { return m_pPageResource.Get(); }
CFX_RenderDevice* GetRenderDevice() const { return m_pDevice; }
- const CPDF_RenderOptions* GetRenderOptions() const { return &m_Options; }
+ const CPDF_RenderOptions& GetRenderOptions() const { return m_Options; }
#if defined _SKIA_SUPPORT_
void DebugVerifyDeviceIsPreMultiplied() const;
@@ -171,21 +175,21 @@ class CPDF_RenderStatus {
UnownedPtr<const CPDF_Dictionary> m_pFormResource;
UnownedPtr<CPDF_Dictionary> m_pPageResource;
std::vector<CPDF_Type3Font*> m_Type3FontCache;
- UnownedPtr<CPDF_RenderContext> m_pContext;
+ UnownedPtr<CPDF_RenderContext> const m_pContext;
bool m_bStopped = false;
- CFX_RenderDevice* m_pDevice = nullptr;
+ CFX_RenderDevice* const m_pDevice;
CFX_Matrix m_DeviceMatrix;
CPDF_ClipPath m_LastClipPath;
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 = false;
CPDF_Transparency m_Transparency;
+ bool m_bPrint = false;
bool m_bDropObjects = false;
bool m_bStdCS = false;
- uint32_t m_GroupFamily = 0;
bool m_bLoadMask = false;
+ uint32_t m_GroupFamily = 0;
UnownedPtr<CPDF_Type3Char> m_pType3Char;
FX_ARGB m_T3FillColor = 0;
int m_curBlend = FXDIB_BLEND_NORMAL;