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

Side by Side Diff: core/fpdfapi/page/pageint.h

Issue 2416733002: split CPDF_StreamContentParser::AddImage() into 3 overloads. (Closed)
Patch Set: Created 4 years, 2 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 | « core/fpdfapi/page/fpdf_page_parser.cpp ('k') | core/fpdfapi/parser/cpdf_stream.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_FPDFAPI_PAGE_PAGEINT_H_ 7 #ifndef CORE_FPDFAPI_PAGE_PAGEINT_H_
8 #define CORE_FPDFAPI_PAGE_PAGEINT_H_ 8 #define CORE_FPDFAPI_PAGE_PAGEINT_H_
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <set> 12 #include <set>
13 #include <unordered_map> 13 #include <unordered_map>
14 #include <vector> 14 #include <vector>
15 15
16 #include "core/fpdfapi/page/cpdf_contentmark.h" 16 #include "core/fpdfapi/page/cpdf_contentmark.h"
17 #include "core/fpdfapi/page/cpdf_countedobject.h" 17 #include "core/fpdfapi/page/cpdf_countedobject.h"
18 #include "core/fpdfapi/page/cpdf_pageobjectholder.h" 18 #include "core/fpdfapi/page/cpdf_pageobjectholder.h"
19 #include "core/fpdfapi/parser/cpdf_stream.h"
19 #include "core/fxcrt/cfx_string_pool_template.h" 20 #include "core/fxcrt/cfx_string_pool_template.h"
20 #include "core/fxcrt/cfx_weak_ptr.h" 21 #include "core/fxcrt/cfx_weak_ptr.h"
21 #include "core/fxge/cfx_pathdata.h" 22 #include "core/fxge/cfx_pathdata.h"
22 #include "core/fxge/cfx_renderdevice.h" 23 #include "core/fxge/cfx_renderdevice.h"
23 24
24 class CPDF_AllStates; 25 class CPDF_AllStates;
25 class CPDF_ColorSpace; 26 class CPDF_ColorSpace;
26 class CPDF_ExpIntFunc; 27 class CPDF_ExpIntFunc;
27 class CPDF_Font; 28 class CPDF_Font;
28 class CPDF_FontEncoding; 29 class CPDF_FontEncoding;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 int count); 137 int count);
137 138
138 void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y); 139 void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y);
139 void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y); 140 void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y);
140 void OnChangeTextMatrix(); 141 void OnChangeTextMatrix();
141 uint32_t Parse(const uint8_t* pData, uint32_t dwSize, uint32_t max_cost); 142 uint32_t Parse(const uint8_t* pData, uint32_t dwSize, uint32_t max_cost);
142 void ParsePathObject(); 143 void ParsePathObject();
143 void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag); 144 void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag);
144 void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h); 145 void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h);
145 void AddPathObject(int FillType, bool bStroke); 146 void AddPathObject(int FillType, bool bStroke);
146 CPDF_ImageObject* AddImage(CPDF_Stream* pStream, 147 CPDF_ImageObject* AddImage(UniqueStream pStream);
147 CPDF_Image* pImage, 148 CPDF_ImageObject* AddImage(uint32_t streamObjNum);
148 bool bInline); 149 CPDF_ImageObject* AddImage(CPDF_Image* pImage);
150
149 void AddForm(CPDF_Stream* pStream); 151 void AddForm(CPDF_Stream* pStream);
150 void SetGraphicStates(CPDF_PageObject* pObj, 152 void SetGraphicStates(CPDF_PageObject* pObj,
151 bool bColor, 153 bool bColor,
152 bool bText, 154 bool bText,
153 bool bGraph); 155 bool bGraph);
154 CPDF_Font* FindFont(const CFX_ByteString& name); 156 CPDF_Font* FindFont(const CFX_ByteString& name);
155 CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name); 157 CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name);
156 CPDF_Pattern* FindPattern(const CFX_ByteString& name, bool bShading); 158 CPDF_Pattern* FindPattern(const CFX_ByteString& name, bool bShading);
157 CPDF_Object* FindResourceObj(const CFX_ByteString& type, 159 CPDF_Object* FindResourceObj(const CFX_ByteString& type,
158 const CFX_ByteString& name); 160 const CFX_ByteString& name);
159 161
160 private: 162 private:
161 using OpCodes = 163 using OpCodes =
162 std::unordered_map<uint32_t, void (CPDF_StreamContentParser::*)()>; 164 std::unordered_map<uint32_t, void (CPDF_StreamContentParser::*)()>;
163 static OpCodes InitializeOpCodes(); 165 static OpCodes InitializeOpCodes();
164 166
167 // Takes ownership of |pImageObj|, returns unowned pointer to it.
168 CPDF_ImageObject* AddImageObject(std::unique_ptr<CPDF_ImageObject> pImageObj);
169
165 void Handle_CloseFillStrokePath(); 170 void Handle_CloseFillStrokePath();
166 void Handle_FillStrokePath(); 171 void Handle_FillStrokePath();
167 void Handle_CloseEOFillStrokePath(); 172 void Handle_CloseEOFillStrokePath();
168 void Handle_EOFillStrokePath(); 173 void Handle_EOFillStrokePath();
169 void Handle_BeginMarkedContent_Dictionary(); 174 void Handle_BeginMarkedContent_Dictionary();
170 void Handle_BeginImage(); 175 void Handle_BeginImage();
171 void Handle_BeginMarkedContent(); 176 void Handle_BeginMarkedContent();
172 void Handle_BeginText(); 177 void Handle_BeginText();
173 void Handle_CurveTo_123(); 178 void Handle_CurveTo_123();
174 void Handle_ConcatMatrix(); 179 void Handle_ConcatMatrix();
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS]; 492 FX_FLOAT m_Comps[MAX_PATTERN_COLORCOMPS];
488 }; 493 };
489 494
490 CFX_ByteStringC PDF_FindKeyAbbreviationForTesting(const CFX_ByteStringC& abbr); 495 CFX_ByteStringC PDF_FindKeyAbbreviationForTesting(const CFX_ByteStringC& abbr);
491 CFX_ByteStringC PDF_FindValueAbbreviationForTesting( 496 CFX_ByteStringC PDF_FindValueAbbreviationForTesting(
492 const CFX_ByteStringC& abbr); 497 const CFX_ByteStringC& abbr);
493 498
494 void PDF_ReplaceAbbr(CPDF_Object* pObj); 499 void PDF_ReplaceAbbr(CPDF_Object* pObj);
495 500
496 #endif // CORE_FPDFAPI_PAGE_PAGEINT_H_ 501 #endif // CORE_FPDFAPI_PAGE_PAGEINT_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/page/fpdf_page_parser.cpp ('k') | core/fpdfapi/parser/cpdf_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698