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 "core/fdrm/crypto/include/fx_crypt.h" | 9 #include "core/fdrm/crypto/include/fx_crypt.h" |
10 #include "core/fpdfapi/fpdf_font/font_int.h" | 10 #include "core/fpdfapi/fpdf_font/font_int.h" |
11 #include "core/include/fpdfapi/cpdf_array.h" | 11 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" |
12 #include "core/include/fpdfapi/cpdf_dictionary.h" | 12 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" |
13 #include "core/include/fpdfapi/cpdf_document.h" | 13 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
14 #include "core/include/fpdfapi/fpdf_module.h" | 14 #include "core/fpdfapi/include/cpdf_modulemgr.h" |
| 15 #include "core/fpdfapi/ipdf_pagemodule.h" |
15 #include "core/include/fpdfapi/fpdf_page.h" | 16 #include "core/include/fpdfapi/fpdf_page.h" |
16 | 17 |
| 18 namespace { |
| 19 |
17 class CPDF_PageModule : public IPDF_PageModule { | 20 class CPDF_PageModule : public IPDF_PageModule { |
18 public: | 21 public: |
19 CPDF_PageModule() | 22 CPDF_PageModule() |
20 : m_StockGrayCS(nullptr, PDFCS_DEVICEGRAY), | 23 : m_StockGrayCS(nullptr, PDFCS_DEVICEGRAY), |
21 m_StockRGBCS(nullptr, PDFCS_DEVICERGB), | 24 m_StockRGBCS(nullptr, PDFCS_DEVICERGB), |
22 m_StockCMYKCS(nullptr, PDFCS_DEVICECMYK), | 25 m_StockCMYKCS(nullptr, PDFCS_DEVICECMYK), |
23 m_StockPatternCS(nullptr) {} | 26 m_StockPatternCS(nullptr) {} |
24 | 27 |
25 private: | 28 private: |
26 ~CPDF_PageModule() override {} | 29 ~CPDF_PageModule() override {} |
(...skipping 14 matching lines...) Expand all Loading... |
41 CPDF_ColorSpace* GetStockCS(int family) override; | 44 CPDF_ColorSpace* GetStockCS(int family) override; |
42 void NotifyCJKAvailable() override; | 45 void NotifyCJKAvailable() override; |
43 | 46 |
44 CPDF_FontGlobals m_FontGlobals; | 47 CPDF_FontGlobals m_FontGlobals; |
45 CPDF_DeviceCS m_StockGrayCS; | 48 CPDF_DeviceCS m_StockGrayCS; |
46 CPDF_DeviceCS m_StockRGBCS; | 49 CPDF_DeviceCS m_StockRGBCS; |
47 CPDF_DeviceCS m_StockCMYKCS; | 50 CPDF_DeviceCS m_StockCMYKCS; |
48 CPDF_PatternCS m_StockPatternCS; | 51 CPDF_PatternCS m_StockPatternCS; |
49 }; | 52 }; |
50 | 53 |
| 54 } // namespace |
| 55 |
51 CPDF_ColorSpace* CPDF_PageModule::GetStockCS(int family) { | 56 CPDF_ColorSpace* CPDF_PageModule::GetStockCS(int family) { |
52 if (family == PDFCS_DEVICEGRAY) { | 57 if (family == PDFCS_DEVICEGRAY) { |
53 return &m_StockGrayCS; | 58 return &m_StockGrayCS; |
54 } | 59 } |
55 if (family == PDFCS_DEVICERGB) { | 60 if (family == PDFCS_DEVICERGB) { |
56 return &m_StockRGBCS; | 61 return &m_StockRGBCS; |
57 } | 62 } |
58 if (family == PDFCS_DEVICECMYK) { | 63 if (family == PDFCS_DEVICECMYK) { |
59 return &m_StockCMYKCS; | 64 return &m_StockCMYKCS; |
60 } | 65 } |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 } | 606 } |
602 | 607 |
603 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( | 608 CPDF_CountedPattern* CPDF_DocPageData::FindPatternPtr( |
604 CPDF_Object* pPatternObj) const { | 609 CPDF_Object* pPatternObj) const { |
605 if (!pPatternObj) | 610 if (!pPatternObj) |
606 return nullptr; | 611 return nullptr; |
607 | 612 |
608 auto it = m_PatternMap.find(pPatternObj); | 613 auto it = m_PatternMap.find(pPatternObj); |
609 return it != m_PatternMap.end() ? it->second : nullptr; | 614 return it != m_PatternMap.end() ? it->second : nullptr; |
610 } | 615 } |
OLD | NEW |