Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: core/fpdfapi/fpdf_render/fpdf_render_image.cpp

Issue 2000973002: Make CPDF_Function::Load() return an unique_ptr. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: fix build, nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_render/fpdf_render_image.cpp
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 53c40b66eec535d22c8cc0e5f612f89225d7db98..d84c0037fd3e177629d35d56826350612a8ed777 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -872,20 +872,21 @@ CCodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(
int nComps,
int bpc,
const CPDF_Dictionary* pParams);
+
CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
FX_RECT* pClipRect,
const CFX_Matrix* pMatrix) {
- if (!pSMaskDict) {
- return NULL;
- }
+ if (!pSMaskDict)
+ return nullptr;
+
CPDF_Stream* pGroup = pSMaskDict->GetStreamBy("G");
- if (!pGroup) {
- return NULL;
- }
+ if (!pGroup)
+ return nullptr;
+
std::unique_ptr<CPDF_Function> pFunc;
CPDF_Object* pFuncObj = pSMaskDict->GetDirectObjectBy("TR");
if (pFuncObj && (pFuncObj->IsDictionary() || pFuncObj->IsStream()))
- pFunc.reset(CPDF_Function::Load(pFuncObj));
+ pFunc = CPDF_Function::Load(pFuncObj);
CFX_Matrix matrix = *pMatrix;
matrix.TranslateI(-pClipRect->left, -pClipRect->top);
« no previous file with comments | « core/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698