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

Side by Side Diff: core/fpdfapi/page/fpdf_page_func.cpp

Issue 2453163002: Take advantage of implicit std::unique_ptr<>(nulltpr_t) ctor. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « core/fpdfapi/page/cpdf_colorspace.cpp ('k') | core/fpdfapi/render/fpdf_render_pattern.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/page/pageint.h" 7 #include "core/fpdfapi/page/pageint.h"
8 8
9 #include <limits.h> 9 #include <limits.h>
10 10
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 if (type == Type::kType0Sampled) 744 if (type == Type::kType0Sampled)
745 pFunc.reset(new CPDF_SampledFunc()); 745 pFunc.reset(new CPDF_SampledFunc());
746 else if (type == Type::kType2ExpotentialInterpolation) 746 else if (type == Type::kType2ExpotentialInterpolation)
747 pFunc.reset(new CPDF_ExpIntFunc()); 747 pFunc.reset(new CPDF_ExpIntFunc());
748 else if (type == Type::kType3Stitching) 748 else if (type == Type::kType3Stitching)
749 pFunc.reset(new CPDF_StitchFunc()); 749 pFunc.reset(new CPDF_StitchFunc());
750 else if (type == Type::kType4PostScript) 750 else if (type == Type::kType4PostScript)
751 pFunc.reset(new CPDF_PSFunc()); 751 pFunc.reset(new CPDF_PSFunc());
752 752
753 if (!pFunc || !pFunc->Init(pFuncObj)) 753 if (!pFunc || !pFunc->Init(pFuncObj))
754 return std::unique_ptr<CPDF_Function>(); 754 return nullptr;
755
755 return pFunc; 756 return pFunc;
756 } 757 }
757 758
758 // static 759 // static
759 CPDF_Function::Type CPDF_Function::IntegerToFunctionType(int iType) { 760 CPDF_Function::Type CPDF_Function::IntegerToFunctionType(int iType) {
760 switch (iType) { 761 switch (iType) {
761 case 0: 762 case 0:
762 case 2: 763 case 2:
763 case 3: 764 case 3:
764 case 4: 765 case 4:
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
849 return m_Type == Type::kType2ExpotentialInterpolation 850 return m_Type == Type::kType2ExpotentialInterpolation
850 ? static_cast<const CPDF_ExpIntFunc*>(this) 851 ? static_cast<const CPDF_ExpIntFunc*>(this)
851 : nullptr; 852 : nullptr;
852 } 853 }
853 854
854 const CPDF_StitchFunc* CPDF_Function::ToStitchFunc() const { 855 const CPDF_StitchFunc* CPDF_Function::ToStitchFunc() const {
855 return m_Type == Type::kType3Stitching 856 return m_Type == Type::kType3Stitching
856 ? static_cast<const CPDF_StitchFunc*>(this) 857 ? static_cast<const CPDF_StitchFunc*>(this)
857 : nullptr; 858 : nullptr;
858 } 859 }
OLDNEW
« no previous file with comments | « core/fpdfapi/page/cpdf_colorspace.cpp ('k') | core/fpdfapi/render/fpdf_render_pattern.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698