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

Side by Side Diff: core/fpdfapi/font/cpdf_type3font.cpp

Issue 2521123003: Continue splitting pageint.h into per-class files (Closed)
Patch Set: const 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 | « BUILD.gn ('k') | core/fpdfapi/page/cpdf_allstates.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 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/font/cpdf_type3font.h" 7 #include "core/fpdfapi/font/cpdf_type3font.h"
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "core/fpdfapi/font/cpdf_type3char.h" 11 #include "core/fpdfapi/font/cpdf_type3char.h"
12 #include "core/fpdfapi/page/cpdf_form.h" 12 #include "core/fpdfapi/page/cpdf_form.h"
13 #include "core/fpdfapi/page/pageint.h" 13 #include "core/fpdfapi/page/pageint.h"
14 #include "core/fpdfapi/parser/cpdf_array.h" 14 #include "core/fpdfapi/parser/cpdf_array.h"
15 #include "core/fpdfapi/parser/cpdf_dictionary.h" 15 #include "core/fpdfapi/parser/cpdf_dictionary.h"
16 #include "core/fpdfapi/parser/cpdf_stream.h" 16 #include "core/fpdfapi/parser/cpdf_stream.h"
17 #include "core/fxcrt/fx_system.h" 17 #include "core/fxcrt/fx_system.h"
18 #include "third_party/base/stl_util.h" 18 #include "third_party/base/stl_util.h"
19 19
20 #define FPDF_MAX_TYPE3_FORM_LEVEL 4
21
20 CPDF_Type3Font::CPDF_Type3Font() 22 CPDF_Type3Font::CPDF_Type3Font()
21 : m_pCharProcs(nullptr), 23 : m_pCharProcs(nullptr),
22 m_pPageResources(nullptr), 24 m_pPageResources(nullptr),
23 m_pFontResources(nullptr), 25 m_pFontResources(nullptr),
24 m_CharLoadingDepth(0) { 26 m_CharLoadingDepth(0) {
25 FXSYS_memset(m_CharWidthL, 0, sizeof(m_CharWidthL)); 27 FXSYS_memset(m_CharWidthL, 0, sizeof(m_CharWidthL));
26 } 28 }
27 29
28 CPDF_Type3Font::~CPDF_Type3Font() {} 30 CPDF_Type3Font::~CPDF_Type3Font() {}
29 31
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 85 }
84 } 86 }
85 return true; 87 return true;
86 } 88 }
87 89
88 void CPDF_Type3Font::CheckType3FontMetrics() { 90 void CPDF_Type3Font::CheckType3FontMetrics() {
89 CheckFontMetrics(); 91 CheckFontMetrics();
90 } 92 }
91 93
92 CPDF_Type3Char* CPDF_Type3Font::LoadChar(uint32_t charcode) { 94 CPDF_Type3Char* CPDF_Type3Font::LoadChar(uint32_t charcode) {
93 if (m_CharLoadingDepth >= _FPDF_MAX_TYPE3_FORM_LEVEL_) 95 if (m_CharLoadingDepth >= FPDF_MAX_TYPE3_FORM_LEVEL)
94 return nullptr; 96 return nullptr;
95 97
96 auto it = m_CacheMap.find(charcode); 98 auto it = m_CacheMap.find(charcode);
97 if (it != m_CacheMap.end()) 99 if (it != m_CacheMap.end())
98 return it->second.get(); 100 return it->second.get();
99 101
100 const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode); 102 const FX_CHAR* name = GetAdobeCharName(m_BaseEncoding, m_CharNames, charcode);
101 if (!name) 103 if (!name)
102 return nullptr; 104 return nullptr;
103 105
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 return m_CharWidthL[charcode]; 153 return m_CharWidthL[charcode];
152 154
153 const CPDF_Type3Char* pChar = LoadChar(charcode); 155 const CPDF_Type3Char* pChar = LoadChar(charcode);
154 return pChar ? pChar->m_Width : 0; 156 return pChar ? pChar->m_Width : 0;
155 } 157 }
156 158
157 FX_RECT CPDF_Type3Font::GetCharBBox(uint32_t charcode) { 159 FX_RECT CPDF_Type3Font::GetCharBBox(uint32_t charcode) {
158 const CPDF_Type3Char* pChar = LoadChar(charcode); 160 const CPDF_Type3Char* pChar = LoadChar(charcode);
159 return pChar ? pChar->m_BBox : FX_RECT(); 161 return pChar ? pChar->m_BBox : FX_RECT();
160 } 162 }
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | core/fpdfapi/page/cpdf_allstates.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698