diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-08-15 19:02:38 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-08-15 19:02:38 +0000 |
commit | b6e3d231ef2c28df1e5149cb16ad7046ebb0714e (patch) | |
tree | df242fdcd352fd4239be92cad2cf5f4cefdc08fd /core/fpdfapi/render/cpdf_rendercontext.cpp | |
parent | 48ae3075a5c80e75923a60d4d0ba0b56d9b08c2a (diff) | |
download | pdfium-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/fpdfapi/render/cpdf_rendercontext.cpp')
-rw-r--r-- | core/fpdfapi/render/cpdf_rendercontext.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
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; |