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

Side by Side Diff: core/include/fpdfapi/fpdf_page.h

Issue 1700183002: Remove CFX_PtrList from renderer main loop. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Nits. Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | core/include/fpdfapi/fpdf_render.h » ('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 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_
8 #define CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_
9 9
10 #include <list>
10 #include <memory> 11 #include <memory>
11 12
12 #include "core/include/fpdfapi/fpdf_parser.h" 13 #include "core/include/fpdfapi/fpdf_parser.h"
13 #include "core/include/fpdfapi/fpdf_resource.h" 14 #include "core/include/fpdfapi/fpdf_resource.h"
14 #include "core/include/fxge/fx_dib.h" 15 #include "core/include/fxge/fx_dib.h"
15 16
16 class CPDF_Page; 17 class CPDF_Page;
17 class CPDF_Form; 18 class CPDF_Form;
18 class CPDF_ParseOptions; 19 class CPDF_ParseOptions;
19 class CPDF_PageObject; 20 class CPDF_PageObject;
20 class CPDF_PageRenderCache; 21 class CPDF_PageRenderCache;
21 class CPDF_StreamFilter; 22 class CPDF_StreamFilter;
22 class CPDF_AllStates; 23 class CPDF_AllStates;
23 class CPDF_ContentParser; 24 class CPDF_ContentParser;
24 class CPDF_StreamContentParser; 25 class CPDF_StreamContentParser;
25 26
26 #define PDFTRANS_GROUP 0x0100 27 #define PDFTRANS_GROUP 0x0100
27 #define PDFTRANS_ISOLATED 0x0200 28 #define PDFTRANS_ISOLATED 0x0200
28 #define PDFTRANS_KNOCKOUT 0x0400 29 #define PDFTRANS_KNOCKOUT 0x0400
29 30
30 class CPDF_PageObjectList : public CFX_PtrList { 31 class CPDF_PageObjectList : public std::list<std::unique_ptr<CPDF_PageObject>> {
31 public: 32 public:
32 explicit CPDF_PageObjectList(int nBlockSize) : CFX_PtrList(nBlockSize) {}
33
34 CPDF_PageObject* GetNextObject(FX_POSITION& pos) const {
35 return static_cast<CPDF_PageObject*>(GetNext(pos));
36 }
37
38 CPDF_PageObject* GetPrevObject(FX_POSITION& pos) const {
39 return static_cast<CPDF_PageObject*>(GetPrev(pos));
40 }
41
42 CPDF_PageObject* GetObjectAt(FX_POSITION pos) const {
43 return static_cast<CPDF_PageObject*>(GetAt(pos));
44 }
45
46 // Linear complexity, to be avoided except as needed by public APIs. 33 // Linear complexity, to be avoided except as needed by public APIs.
47 CPDF_PageObject* GetObjectByIndex(int index) const; 34 CPDF_PageObject* GetPageObjectByIndex(int index);
48
49 FX_POSITION InsertObject(FX_POSITION posInsertAfter,
50 CPDF_PageObject* pNewObject);
51 }; 35 };
52 36
53 class CPDF_PageObjectHolder { 37 class CPDF_PageObjectHolder {
54 public: 38 public:
55 CPDF_PageObjectHolder(); 39 CPDF_PageObjectHolder();
56 ~CPDF_PageObjectHolder();
57 40
58 void ContinueParse(IFX_Pause* pPause); 41 void ContinueParse(IFX_Pause* pPause);
59 FX_BOOL IsParsed() const { return m_ParseState == CONTENT_PARSED; } 42 FX_BOOL IsParsed() const { return m_ParseState == CONTENT_PARSED; }
60 43
61 CPDF_PageObjectList* GetPageObjectList() { return &m_PageObjectList; } 44 CPDF_PageObjectList* GetPageObjectList() { return &m_PageObjectList; }
62 const CPDF_PageObjectList* GetPageObjectList() const { 45 const CPDF_PageObjectList* GetPageObjectList() const {
63 return &m_PageObjectList; 46 return &m_PageObjectList;
64 } 47 }
65 48
66 FX_BOOL BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; } 49 FX_BOOL BackgroundAlphaNeeded() const { return m_bBackgroundAlphaNeeded; }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 void ParseContent(CPDF_AllStates* pGraphicStates, 141 void ParseContent(CPDF_AllStates* pGraphicStates,
159 CFX_Matrix* pParentMatrix, 142 CFX_Matrix* pParentMatrix,
160 CPDF_Type3Char* pType3Char, 143 CPDF_Type3Char* pType3Char,
161 CPDF_ParseOptions* pOptions, 144 CPDF_ParseOptions* pOptions,
162 int level = 0); 145 int level = 0);
163 146
164 CPDF_Form* Clone() const; 147 CPDF_Form* Clone() const;
165 }; 148 };
166 class CPDF_PageContentGenerator { 149 class CPDF_PageContentGenerator {
167 public: 150 public:
168 CPDF_PageContentGenerator(CPDF_Page* pPage); 151 explicit CPDF_PageContentGenerator(CPDF_Page* pPage);
169 ~CPDF_PageContentGenerator(); 152
170 FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject); 153 FX_BOOL InsertPageObject(CPDF_PageObject* pPageObject);
171 void GenerateContent(); 154 void GenerateContent();
172 void TransformContent(CFX_Matrix& matrix); 155 void TransformContent(CFX_Matrix& matrix);
173 156
174 private: 157 private:
175 void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj); 158 void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj);
176 void ProcessForm(CFX_ByteTextBuf& buf, 159 void ProcessForm(CFX_ByteTextBuf& buf,
177 const uint8_t* data, 160 const uint8_t* data,
178 FX_DWORD size, 161 FX_DWORD size,
179 CFX_Matrix& matrix); 162 CFX_Matrix& matrix);
180 CFX_ByteString RealizeResource(CPDF_Object* pResourceObj, 163 CFX_ByteString RealizeResource(CPDF_Object* pResourceObj,
181 const FX_CHAR* szType); 164 const FX_CHAR* szType);
182 165
183 CPDF_Page* m_pPage; 166 CPDF_Page* m_pPage;
184 CPDF_Document* m_pDocument; 167 CPDF_Document* m_pDocument;
185 CFX_ArrayTemplate<CPDF_PageObject*> m_pageObjects; 168 CFX_ArrayTemplate<CPDF_PageObject*> m_pageObjects;
186 }; 169 };
187 170
188 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_ 171 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PAGE_H_
OLDNEW
« no previous file with comments | « no previous file | core/include/fpdfapi/fpdf_render.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698