OLD | NEW |
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/fpdf_page/pageint.h" | 7 #include "core/fpdfapi/fpdf_page/pageint.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "core/fpdfapi/fpdf_parser/cpdf_document.h" | 29 #include "core/fpdfapi/fpdf_parser/cpdf_document.h" |
30 #include "core/fpdfapi/fpdf_parser/cpdf_name.h" | 30 #include "core/fpdfapi/fpdf_parser/cpdf_name.h" |
31 #include "core/fpdfapi/fpdf_parser/cpdf_number.h" | 31 #include "core/fpdfapi/fpdf_parser/cpdf_number.h" |
32 #include "core/fpdfapi/fpdf_parser/cpdf_reference.h" | 32 #include "core/fpdfapi/fpdf_parser/cpdf_reference.h" |
33 #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" | 33 #include "core/fpdfapi/fpdf_parser/cpdf_stream.h" |
34 #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" | 34 #include "core/fpdfapi/fpdf_parser/cpdf_stream_acc.h" |
35 #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" | 35 #include "core/fpdfapi/fpdf_parser/fpdf_parser_decode.h" |
36 #include "core/fxcrt/fx_safe_types.h" | 36 #include "core/fxcrt/fx_safe_types.h" |
37 #include "core/fxge/cfx_graphstatedata.h" | 37 #include "core/fxge/cfx_graphstatedata.h" |
38 #include "core/fxge/cfx_pathdata.h" | 38 #include "core/fxge/cfx_pathdata.h" |
| 39 #include "third_party/base/ptr_util.h" |
39 | 40 |
40 namespace { | 41 namespace { |
41 | 42 |
42 const int kSingleCoordinatePair = 1; | 43 const int kSingleCoordinatePair = 1; |
43 const int kTensorCoordinatePairs = 16; | 44 const int kTensorCoordinatePairs = 16; |
44 const int kCoonsCoordinatePairs = 12; | 45 const int kCoonsCoordinatePairs = 12; |
45 const int kSingleColorPerPatch = 1; | 46 const int kSingleColorPerPatch = 1; |
46 const int kQuadColorsPerPatch = 4; | 47 const int kQuadColorsPerPatch = 4; |
47 | 48 |
48 const char kPathOperatorSubpath = 'm'; | 49 const char kPathOperatorSubpath = 'm'; |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 ImageMatrix.Concat(m_mtContentToUser); | 784 ImageMatrix.Concat(m_mtContentToUser); |
784 | 785 |
785 std::unique_ptr<CPDF_ImageObject> pImageObj(new CPDF_ImageObject); | 786 std::unique_ptr<CPDF_ImageObject> pImageObj(new CPDF_ImageObject); |
786 if (pImage) { | 787 if (pImage) { |
787 pImageObj->SetUnownedImage( | 788 pImageObj->SetUnownedImage( |
788 m_pDocument->GetPageData()->GetImage(pImage->GetStream())); | 789 m_pDocument->GetPageData()->GetImage(pImage->GetStream())); |
789 } else if (pStream->GetObjNum()) { | 790 } else if (pStream->GetObjNum()) { |
790 pImageObj->SetUnownedImage(m_pDocument->LoadImageF(pStream)); | 791 pImageObj->SetUnownedImage(m_pDocument->LoadImageF(pStream)); |
791 } else { | 792 } else { |
792 pImageObj->SetOwnedImage( | 793 pImageObj->SetOwnedImage( |
793 WrapUnique(new CPDF_Image(m_pDocument, pStream, bInline))); | 794 pdfium::MakeUnique<CPDF_Image>(m_pDocument, pStream, bInline)); |
794 } | 795 } |
795 SetGraphicStates(pImageObj.get(), pImageObj->GetImage()->IsMask(), FALSE, | 796 SetGraphicStates(pImageObj.get(), pImageObj->GetImage()->IsMask(), FALSE, |
796 FALSE); | 797 FALSE); |
797 pImageObj->m_Matrix = ImageMatrix; | 798 pImageObj->m_Matrix = ImageMatrix; |
798 pImageObj->CalcBoundingBox(); | 799 pImageObj->CalcBoundingBox(); |
799 CPDF_ImageObject* pRet = pImageObj.get(); | 800 CPDF_ImageObject* pRet = pImageObj.get(); |
800 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pImageObj)); | 801 m_pObjectHolder->GetPageObjectList()->push_back(std::move(pImageObj)); |
801 return pRet; | 802 return pRet; |
802 } | 803 } |
803 | 804 |
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1673 } else { | 1674 } else { |
1674 PDF_ReplaceAbbr(pElement); | 1675 PDF_ReplaceAbbr(pElement); |
1675 } | 1676 } |
1676 } | 1677 } |
1677 break; | 1678 break; |
1678 } | 1679 } |
1679 default: | 1680 default: |
1680 break; | 1681 break; |
1681 } | 1682 } |
1682 } | 1683 } |
OLD | NEW |