7#include "core/fpdfapi/page/cpdf_streamcontentparser.h"
16#include "core/fpdfapi/font/cpdf_font.h"
17#include "core/fpdfapi/font/cpdf_type3font.h"
18#include "core/fpdfapi/page/cpdf_allstates.h"
19#include "core/fpdfapi/page/cpdf_docpagedata.h"
20#include "core/fpdfapi/page/cpdf_form.h"
21#include "core/fpdfapi/page/cpdf_formobject.h"
22#include "core/fpdfapi/page/cpdf_image.h"
23#include "core/fpdfapi/page/cpdf_imageobject.h"
24#include "core/fpdfapi/page/cpdf_meshstream.h"
25#include "core/fpdfapi/page/cpdf_pageobject.h"
26#include "core/fpdfapi/page/cpdf_pathobject.h"
27#include "core/fpdfapi/page/cpdf_shadingobject.h"
28#include "core/fpdfapi/page/cpdf_shadingpattern.h"
29#include "core/fpdfapi/page/cpdf_streamparser.h"
30#include "core/fpdfapi/page/cpdf_textobject.h"
31#include "core/fpdfapi/parser/cpdf_array.h"
32#include "core/fpdfapi/parser/cpdf_dictionary.h"
33#include "core/fpdfapi/parser/cpdf_document.h"
34#include "core/fpdfapi/parser/cpdf_name.h"
35#include "core/fpdfapi/parser/cpdf_number.h"
36#include "core/fpdfapi/parser/cpdf_reference.h"
37#include "core/fpdfapi/parser/cpdf_stream.h"
38#include "core/fpdfapi/parser/fpdf_parser_utility.h"
39#include "core/fxcrt/autonuller.h"
40#include "core/fxcrt/bytestring.h"
41#include "core/fxcrt/check.h"
42#include "core/fxcrt/compiler_specific.h"
43#include "core/fxcrt/containers/contains.h"
44#include "core/fxcrt/fx_safe_types.h"
45#include "core/fxcrt/notreached.h"
46#include "core/fxcrt/scoped_set_insertion.h"
47#include "core/fxcrt/span.h"
48#include "core/fxcrt/stl_util.h"
49#include "core/fxge/cfx_graphstate.h"
50#include "core/fxge/cfx_graphstatedata.h"
54constexpr int kMaxFormLevel = 40;
56constexpr int kSingleCoordinatePair = 1;
57constexpr int kTensorCoordinatePairs = 16;
58constexpr int kCoonsCoordinatePairs = 12;
59constexpr int kSingleColorPerPatch = 1;
60constexpr int kQuadColorsPerPatch = 4;
62const char kPathOperatorSubpath =
'm';
63const char kPathOperatorLine =
'l';
64const char kPathOperatorCubicBezier1 =
'c';
65const char kPathOperatorCubicBezier2 =
'v';
66const char kPathOperatorCubicBezier3 =
'y';
67const char kPathOperatorClosePath =
'h';
68const char kPathOperatorRectangle[] =
"re";
70using OpCodes = std::map<uint32_t,
void (CPDF_StreamContentParser::*)()>;
71OpCodes* g_opcodes =
nullptr;
76 RetainPtr<
const CPDF_Stream> pStream = ToStream(pShading->GetShadingObject());
87 bool update_rect =
false;
93 point_count = kTensorCoordinatePairs;
95 point_count = kCoonsCoordinatePairs;
97 point_count = kSingleCoordinatePair;
101 color_count = kQuadColorsPerPatch;
103 color_count = kSingleColorPerPatch;
113 if (!bGouraud && flag) {
118 for (
int i = 0; i < point_count; ++i) {
132 nBits *= color_count;
133 if (!nBits.IsValid())
145 const char* full_name;
148const AbbrPair kInlineKeyAbbr[] = {
149 {
"BPC",
"BitsPerComponent"}, {
"CS",
"ColorSpace"}, {
"D",
"Decode"},
150 {
"DP",
"DecodeParms"}, {
"F",
"Filter"}, {
"H",
"Height"},
151 {
"IM",
"ImageMask"}, {
"I",
"Interpolate"}, {
"W",
"Width"},
154const AbbrPair kInlineValueAbbr[] = {
155 {
"G",
"DeviceGray"}, {
"RGB",
"DeviceRGB"},
156 {
"CMYK",
"DeviceCMYK"}, {
"I",
"Indexed"},
157 {
"AHx",
"ASCIIHexDecode"}, {
"A85",
"ASCII85Decode"},
158 {
"LZW",
"LZWDecode"}, {
"Fl",
"FlateDecode"},
159 {
"RL",
"RunLengthDecode"}, {
"CCF",
"CCITTFaxDecode"},
160 {
"DCT",
"DCTDecode"},
163struct AbbrReplacementOp {
171 for (
const auto& pair : table) {
172 if (pair.abbr == abbr)
173 return ByteStringView(pair.full_name);
175 return ByteStringView();
181 std::vector<AbbrReplacementOp> replacements;
184 for (
const auto& it : locker) {
185 ByteString key = it.first;
186 ByteStringView fullname =
187 FindFullName(kInlineKeyAbbr, key.AsStringView());
188 if (!fullname.IsEmpty()) {
189 AbbrReplacementOp op;
190 op.is_replace_key =
true;
191 op.key = std::move(key);
192 op.replacement = fullname;
193 replacements.push_back(op);
196 RetainPtr<CPDF_Object> value = it.second;
197 if (value->IsName()) {
198 ByteString name = value->GetString();
199 fullname = FindFullName(kInlineValueAbbr, name.AsStringView());
200 if (!fullname.IsEmpty()) {
201 AbbrReplacementOp op;
202 op.is_replace_key =
false;
204 op.replacement = fullname;
205 replacements.push_back(op);
208 ReplaceAbbr(std::move(value));
212 for (
const auto& op : replacements) {
213 if (op.is_replace_key)
214 pDict->ReplaceKey(op.key, ByteString(op.replacement));
216 pDict->SetNewFor<CPDF_Name>(op.key, ByteString(op.replacement));
221 for (size_t i = 0; i < pArray->size(); ++i) {
223 if (pElement->IsName()) {
226 FindFullName(kInlineValueAbbr, name.AsStringView());
227 if (!fullname.IsEmpty())
228 pArray->SetNewAt<CPDF_Name>(i,
ByteString(fullname));
230 ReplaceAbbr(
std::move(pElement));
238 ReplaceAbbrInDictionary(pDict);
244 ReplaceAbbrInArray(pArray);
252 g_opcodes =
new OpCodes({
253 {FXBSTR_ID(
'"', 0, 0, 0),
254 &CPDF_StreamContentParser::Handle_NextLineShowText_Space},
255 {FXBSTR_ID(
'\'', 0, 0, 0),
256 &CPDF_StreamContentParser::Handle_NextLineShowText},
257 {FXBSTR_ID(
'B', 0, 0, 0),
258 &CPDF_StreamContentParser::Handle_FillStrokePath},
259 {FXBSTR_ID(
'B',
'*', 0, 0),
260 &CPDF_StreamContentParser::Handle_EOFillStrokePath},
261 {FXBSTR_ID(
'B',
'D',
'C', 0),
262 &CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary},
263 {FXBSTR_ID(
'B',
'I', 0, 0), &CPDF_StreamContentParser::Handle_BeginImage},
264 {FXBSTR_ID(
'B',
'M',
'C', 0),
265 &CPDF_StreamContentParser::Handle_BeginMarkedContent},
266 {FXBSTR_ID(
'B',
'T', 0, 0), &CPDF_StreamContentParser::Handle_BeginText},
267 {FXBSTR_ID(
'C',
'S', 0, 0),
268 &CPDF_StreamContentParser::Handle_SetColorSpace_Stroke},
269 {FXBSTR_ID(
'D',
'P', 0, 0),
270 &CPDF_StreamContentParser::Handle_MarkPlace_Dictionary},
271 {FXBSTR_ID(
'D',
'o', 0, 0),
272 &CPDF_StreamContentParser::Handle_ExecuteXObject},
273 {FXBSTR_ID(
'E',
'I', 0, 0), &CPDF_StreamContentParser::Handle_EndImage},
274 {FXBSTR_ID(
'E',
'M',
'C', 0),
275 &CPDF_StreamContentParser::Handle_EndMarkedContent},
276 {FXBSTR_ID(
'E',
'T', 0, 0), &CPDF_StreamContentParser::Handle_EndText},
277 {FXBSTR_ID(
'F', 0, 0, 0), &CPDF_StreamContentParser::Handle_FillPathOld},
278 {FXBSTR_ID(
'G', 0, 0, 0),
279 &CPDF_StreamContentParser::Handle_SetGray_Stroke},
280 {FXBSTR_ID(
'I',
'D', 0, 0),
281 &CPDF_StreamContentParser::Handle_BeginImageData},
282 {FXBSTR_ID(
'J', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineCap},
283 {FXBSTR_ID(
'K', 0, 0, 0),
284 &CPDF_StreamContentParser::Handle_SetCMYKColor_Stroke},
285 {FXBSTR_ID(
'M', 0, 0, 0),
286 &CPDF_StreamContentParser::Handle_SetMiterLimit},
287 {FXBSTR_ID(
'M',
'P', 0, 0), &CPDF_StreamContentParser::Handle_MarkPlace},
288 {FXBSTR_ID(
'Q', 0, 0, 0),
289 &CPDF_StreamContentParser::Handle_RestoreGraphState},
290 {FXBSTR_ID(
'R',
'G', 0, 0),
291 &CPDF_StreamContentParser::Handle_SetRGBColor_Stroke},
292 {FXBSTR_ID(
'S', 0, 0, 0), &CPDF_StreamContentParser::Handle_StrokePath},
293 {FXBSTR_ID(
'S',
'C', 0, 0),
294 &CPDF_StreamContentParser::Handle_SetColor_Stroke},
295 {FXBSTR_ID(
'S',
'C',
'N', 0),
296 &CPDF_StreamContentParser::Handle_SetColorPS_Stroke},
297 {FXBSTR_ID(
'T',
'*', 0, 0),
298 &CPDF_StreamContentParser::Handle_MoveToNextLine},
299 {FXBSTR_ID(
'T',
'D', 0, 0),
300 &CPDF_StreamContentParser::Handle_MoveTextPoint_SetLeading},
301 {FXBSTR_ID(
'T',
'J', 0, 0),
302 &CPDF_StreamContentParser::Handle_ShowText_Positioning},
303 {FXBSTR_ID(
'T',
'L', 0, 0),
304 &CPDF_StreamContentParser::Handle_SetTextLeading},
305 {FXBSTR_ID(
'T',
'c', 0, 0),
306 &CPDF_StreamContentParser::Handle_SetCharSpace},
307 {FXBSTR_ID(
'T',
'd', 0, 0),
308 &CPDF_StreamContentParser::Handle_MoveTextPoint},
309 {FXBSTR_ID(
'T',
'f', 0, 0), &CPDF_StreamContentParser::Handle_SetFont},
310 {FXBSTR_ID(
'T',
'j', 0, 0), &CPDF_StreamContentParser::Handle_ShowText},
311 {FXBSTR_ID(
'T',
'm', 0, 0),
312 &CPDF_StreamContentParser::Handle_SetTextMatrix},
313 {FXBSTR_ID(
'T',
'r', 0, 0),
314 &CPDF_StreamContentParser::Handle_SetTextRenderMode},
315 {FXBSTR_ID(
'T',
's', 0, 0),
316 &CPDF_StreamContentParser::Handle_SetTextRise},
317 {FXBSTR_ID(
'T',
'w', 0, 0),
318 &CPDF_StreamContentParser::Handle_SetWordSpace},
319 {FXBSTR_ID(
'T',
'z', 0, 0),
320 &CPDF_StreamContentParser::Handle_SetHorzScale},
321 {FXBSTR_ID(
'W', 0, 0, 0), &CPDF_StreamContentParser::Handle_Clip},
322 {FXBSTR_ID(
'W',
'*', 0, 0), &CPDF_StreamContentParser::Handle_EOClip},
323 {FXBSTR_ID(
'b', 0, 0, 0),
324 &CPDF_StreamContentParser::Handle_CloseFillStrokePath},
325 {FXBSTR_ID(
'b',
'*', 0, 0),
326 &CPDF_StreamContentParser::Handle_CloseEOFillStrokePath},
327 {FXBSTR_ID(
'c', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_123},
328 {FXBSTR_ID(
'c',
'm', 0, 0),
329 &CPDF_StreamContentParser::Handle_ConcatMatrix},
330 {FXBSTR_ID(
'c',
's', 0, 0),
331 &CPDF_StreamContentParser::Handle_SetColorSpace_Fill},
332 {FXBSTR_ID(
'd', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetDash},
333 {FXBSTR_ID(
'd',
'0', 0, 0),
334 &CPDF_StreamContentParser::Handle_SetCharWidth},
335 {FXBSTR_ID(
'd',
'1', 0, 0),
336 &CPDF_StreamContentParser::Handle_SetCachedDevice},
337 {FXBSTR_ID(
'f', 0, 0, 0), &CPDF_StreamContentParser::Handle_FillPath},
338 {FXBSTR_ID(
'f',
'*', 0, 0), &CPDF_StreamContentParser::Handle_EOFillPath},
339 {FXBSTR_ID(
'g', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetGray_Fill},
340 {FXBSTR_ID(
'g',
's', 0, 0),
341 &CPDF_StreamContentParser::Handle_SetExtendGraphState},
342 {FXBSTR_ID(
'h', 0, 0, 0), &CPDF_StreamContentParser::Handle_ClosePath},
343 {FXBSTR_ID(
'i', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetFlat},
344 {FXBSTR_ID(
'j', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineJoin},
345 {FXBSTR_ID(
'k', 0, 0, 0),
346 &CPDF_StreamContentParser::Handle_SetCMYKColor_Fill},
347 {FXBSTR_ID(
'l', 0, 0, 0), &CPDF_StreamContentParser::Handle_LineTo},
348 {FXBSTR_ID(
'm', 0, 0, 0), &CPDF_StreamContentParser::Handle_MoveTo},
349 {FXBSTR_ID(
'n', 0, 0, 0), &CPDF_StreamContentParser::Handle_EndPath},
350 {FXBSTR_ID(
'q', 0, 0, 0),
351 &CPDF_StreamContentParser::Handle_SaveGraphState},
352 {FXBSTR_ID(
'r',
'e', 0, 0), &CPDF_StreamContentParser::Handle_Rectangle},
353 {FXBSTR_ID(
'r',
'g', 0, 0),
354 &CPDF_StreamContentParser::Handle_SetRGBColor_Fill},
355 {FXBSTR_ID(
'r',
'i', 0, 0),
356 &CPDF_StreamContentParser::Handle_SetRenderIntent},
357 {FXBSTR_ID(
's', 0, 0, 0),
358 &CPDF_StreamContentParser::Handle_CloseStrokePath},
359 {FXBSTR_ID(
's',
'c', 0, 0),
360 &CPDF_StreamContentParser::Handle_SetColor_Fill},
361 {FXBSTR_ID(
's',
'c',
'n', 0),
362 &CPDF_StreamContentParser::Handle_SetColorPS_Fill},
363 {FXBSTR_ID(
's',
'h', 0, 0), &CPDF_StreamContentParser::Handle_ShadeFill},
364 {FXBSTR_ID(
'v', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_23},
365 {FXBSTR_ID(
'w', 0, 0, 0), &CPDF_StreamContentParser::Handle_SetLineWidth},
366 {FXBSTR_ID(
'y', 0, 0, 0), &CPDF_StreamContentParser::Handle_CurveTo_13},
396 if (pmtContentToUser)
397 m_mtContentToUser
= *pmtContentToUser;
399 *m_pCurStates = *pStates;
401 m_pCurStates->mutable_general_state().Emplace();
402 m_pCurStates->mutable_graph_state().Emplace();
403 m_pCurStates->mutable_text_state().Emplace();
404 m_pCurStates->mutable_color_state().Emplace();
408 m_ContentMarksStack.push(std::make_unique<CPDF_ContentMarks>());
412 m_AllCTMs[0] = m_pCurStates->current_transformation_matrix();
420 if (m_ParamCount == kParamBufSize) {
422 if (m_ParamStartPos == kParamBufSize) {
425 if (m_ParamBuf[m_ParamStartPos].m_Type == ContentParam::Type::kObject)
426 m_ParamBuf[m_ParamStartPos].m_pObject.Reset();
428 return m_ParamStartPos;
430 int index = m_ParamStartPos + m_ParamCount;
431 if (index >= kParamBufSize) {
432 index -= kParamBufSize;
439 ContentParam& param = m_ParamBuf[GetNextParamPos()];
440 param.m_Type = ContentParam::Type::kName;
441 param.m_Name = PDF_NameDecode(bsName);
445 ContentParam& param = m_ParamBuf[GetNextParamPos()];
446 param.m_Type = ContentParam::Type::kNumber;
451 ContentParam& param = m_ParamBuf[GetNextParamPos()];
452 param.m_Type = ContentParam::Type::kObject;
453 param.m_pObject =
std::move(pObj);
457 uint32_t index = m_ParamStartPos;
458 for (uint32_t i = 0; i < m_ParamCount; i++) {
459 if (m_ParamBuf[index].m_Type == ContentParam::Type::kObject)
460 m_ParamBuf[index].m_pObject.Reset();
462 if (index == kParamBufSize)
470 if (index >= m_ParamCount) {
473 int real_index = m_ParamStartPos + m_ParamCount - index - 1;
474 if (real_index >= kParamBufSize) {
475 real_index -= kParamBufSize;
477 ContentParam& param = m_ParamBuf[real_index];
478 if (param.m_Type == ContentParam::Type::kNumber) {
479 param.m_Type = ContentParam::Type::kObject;
481 param.m_Number.IsInteger()
482 ?
pdfium::MakeRetain<CPDF_Number>(param.m_Number.GetSigned())
483 :
pdfium::MakeRetain<CPDF_Number>(param.m_Number.GetFloat());
484 return param.m_pObject;
486 if (param.m_Type == ContentParam::Type::kName) {
487 param.m_Type = ContentParam::Type::kObject;
488 param.m_pObject = m_pDocument->New<CPDF_Name>(param.m_Name);
489 return param.m_pObject;
491 if (param.m_Type == ContentParam::Type::kObject)
492 return param.m_pObject;
498 if (index >= m_ParamCount)
501 int real_index = m_ParamStartPos + m_ParamCount - index - 1;
502 if (real_index >= kParamBufSize)
503 real_index -= kParamBufSize;
505 const ContentParam& param = m_ParamBuf[real_index];
506 if (param.m_Type == ContentParam::Type::kName)
509 if (param.m_Type == ContentParam::Type::kObject && param.m_pObject)
510 return param.m_pObject->GetString();
516 if (index >= m_ParamCount)
519 int real_index = m_ParamStartPos + m_ParamCount - index - 1;
520 if (real_index >= kParamBufSize)
521 real_index -= kParamBufSize;
523 const ContentParam& param = m_ParamBuf[real_index];
524 if (param.m_Type == ContentParam::Type::kNumber)
525 return param.m_Number.GetFloat();
527 if (param.m_Type == ContentParam::Type::kObject && param.m_pObject)
528 return param.m_pObject->GetNumber();
534 std::vector<
float> values(count);
535 for (size_t i = 0; i < count; ++i)
536 values[i] = GetNumber(count - i - 1);
541 return CFX_PointF(GetNumber(index + 1), GetNumber(index));
545 return CFX_Matrix(GetNumber(5)
, GetNumber(4)
, GetNumber(3)
, GetNumber(2)
,
546 GetNumber(1)
, GetNumber(0)
);
553 pObj->mutable_general_state() = m_pCurStates->general_state();
554 pObj->mutable_clip_path() = m_pCurStates->clip_path();
555 pObj->SetContentMarks(*m_ContentMarksStack.top());
557 pObj->mutable_color_state() = m_pCurStates->color_state();
560 pObj->mutable_graph_state() = m_pCurStates->graph_state();
563 pObj->mutable_text_state() = m_pCurStates->text_state();
568 auto it = g_opcodes->find(op.GetID());
569 if (it != g_opcodes->end()) {
570 (
this->*it->second)();
584 AddPathPointAndClose(m_PathStart, CFX_Path::Point::Type::kLine);
598 std::unique_ptr<CPDF_ContentMarks> new_marks =
599 m_ContentMarksStack.top()->Clone();
601 if (pProperty->IsName()) {
602 ByteString property_name = pProperty->GetString();
604 if (!pHolder || !pHolder->GetDictFor(property_name))
606 new_marks->AddMarkWithPropertiesHolder(tag,
std::move(pHolder),
608 }
else if (pProperty->IsDictionary()) {
609 new_marks->AddMarkWithDirectDict(tag, ToDictionary(pProperty));
613 m_ContentMarksStack.push(std::move(new_marks));
618 auto pDict = m_pDocument->New<CPDF_Dictionary>();
622 if (m_pSyntax->GetWord() !=
"ID") {
623 m_pSyntax->SetPos(savePos);
630 auto word = m_pSyntax->GetWord();
631 ByteString key(word.Last(word.GetLength() - 1));
632 auto pObj = m_pSyntax->ReadNextObject(
false,
false, 0);
633 if (pObj && !pObj->IsInline()) {
634 pDict->SetNewFor<CPDF_Reference>(key, m_pDocument, pObj->GetObjNum());
636 pDict->SetFor(key,
std::move(pObj));
641 if (pDict->KeyExist(
"ColorSpace")) {
642 pCSObj = pDict->GetDirectObjectFor(
"ColorSpace");
643 if (pCSObj->IsName()) {
645 if (name
!= "DeviceRGB" && name
!= "DeviceGray" && name
!= "DeviceCMYK") {
646 pCSObj = FindResourceObj(
"ColorSpace", name);
647 if (pCSObj && pCSObj->IsInline())
648 pDict->SetFor(
"ColorSpace", pCSObj->Clone());
652 pDict->SetNewFor<CPDF_Name>(
"Subtype",
"Image");
654 m_pSyntax->ReadInlineStream(m_pDocument, std::move(pDict), pCSObj.Get());
663 if (m_pSyntax->GetWord() ==
"EI")
666 CPDF_ImageObject* pObj = AddImageFromStream(
std::move(pStream),
"");
669 if (pObj && pObj->GetImage()->IsMask())
670 m_pObjectHolder->AddImageMaskBoundingBox(pObj->GetRect());
674 std::unique_ptr<CPDF_ContentMarks> new_marks =
675 m_ContentMarksStack.top()->Clone();
676 new_marks->AddMark(GetString(0));
677 m_ContentMarksStack.push(std::move(new_marks));
681 m_pCurStates->set_text_matrix(CFX_Matrix());
682 OnChangeTextMatrix();
683 m_pCurStates->ResetTextPosition();
687 AddPathPoint(GetPoint(4), CFX_Path::Point::Type::kBezier);
688 AddPathPoint(GetPoint(2), CFX_Path::Point::Type::kBezier);
689 AddPathPoint(GetPoint(0), CFX_Path::Point::Type::kBezier);
693 m_pCurStates->prepend_to_current_transformation_matrix(GetMatrix());
694 m_AllCTMs[GetCurrentStreamIndex()] =
695 m_pCurStates->current_transformation_matrix();
696 OnChangeTextMatrix();
704 m_pCurStates->mutable_color_state().GetMutableFillColor()->SetColorSpace(
713 m_pCurStates->mutable_color_state().GetMutableStrokeColor()->SetColorSpace(
722 m_pCurStates->SetLineDash(pArray.Get(), GetNumber(0), 1.0f);
726 m_Type3Data[0] = GetNumber(1);
727 m_Type3Data[1] = GetNumber(0);
732 for (
int i = 0; i < 6; i++) {
733 m_Type3Data[i] = GetNumber(5 - i);
740 if (name == m_LastImageName && m_pLastImage && m_pLastImage->GetStream() &&
741 m_pLastImage->GetStream()->GetObjNum()) {
742 CPDF_ImageObject* pObj = AddLastImage();
745 if (pObj && pObj->GetImage()->IsMask())
746 m_pObjectHolder->AddImageMaskBoundingBox(pObj->GetRect());
750 RetainPtr<CPDF_Stream> pXObject(ToStream(FindResourceObj(
"XObject", name)));
754 const ByteString type = pXObject->GetDict()->GetByteStringFor(
"Subtype");
755 if (type
== "Form") {
756 AddForm(
std::move(pXObject), name);
760 if (type
== "Image") {
761 CPDF_ImageObject* pObj =
763 ? AddImageFromStream(ToStream(pXObject->Clone()), name)
764 : AddImageFromStreamObjNum(pXObject->GetObjNum(), name);
766 m_LastImageName = std::move(name);
768 m_pLastImage = pObj->GetImage();
769 if (m_pLastImage->IsMask())
770 m_pObjectHolder->AddImageMaskBoundingBox(pObj->GetRect());
778 status.mutable_general_state() = m_pCurStates->general_state();
779 status.mutable_graph_state() = m_pCurStates->graph_state();
780 status.mutable_color_state() = m_pCurStates->color_state();
781 status.mutable_text_state() = m_pCurStates->text_state();
782 auto form = std::make_unique<CPDF_Form>(
783 m_pDocument, m_pPageResources, std::move(pStream), m_pResources.Get());
784 form->ParseContent(&status,
nullptr, m_RecursionState);
787 m_pCurStates->current_transformation_matrix() * m_mtContentToUser;
788 auto pFormObj =
std::make_unique<CPDF_FormObject>(GetCurrentStreamIndex(),
789 std::move(form), matrix);
790 pFormObj->SetResourceName(name);
791 if (!m_pObjectHolder->BackgroundAlphaNeeded() &&
792 pFormObj->form()->BackgroundAlphaNeeded()) {
793 m_pObjectHolder->SetBackgroundAlphaNeeded(
true);
795 pFormObj->CalcBoundingBox();
796 SetGraphicStates(pFormObj.get(),
true,
true,
true);
797 m_pObjectHolder->AppendPageObject(std::move(pFormObj));
806 auto pImageObj =
std::make_unique<CPDF_ImageObject>(GetCurrentStreamIndex());
807 pImageObj->SetResourceName(name);
809 pdfium::MakeRetain<CPDF_Image>(m_pDocument, std::move(pStream)));
811 return AddImageObject(std::move(pImageObj));
815 uint32_t stream_obj_num,
817 auto pImageObj =
std::make_unique<CPDF_ImageObject>(GetCurrentStreamIndex());
818 pImageObj->SetResourceName(name);
820 CPDF_DocPageData::FromDocument(m_pDocument)->GetImage(stream_obj_num));
822 return AddImageObject(std::move(pImageObj));
828 auto pImageObj =
std::make_unique<CPDF_ImageObject>(GetCurrentStreamIndex());
829 pImageObj->SetResourceName(m_LastImageName);
830 pImageObj->SetImage(CPDF_DocPageData::FromDocument(m_pDocument)
831 ->GetImage(m_pLastImage->GetStream()->GetObjNum()));
833 return AddImageObject(std::move(pImageObj));
837 std::unique_ptr<CPDF_ImageObject> pImageObj) {
838 SetGraphicStates(pImageObj.get(), pImageObj->GetImage()->IsMask(),
false,
842 m_pCurStates->current_transformation_matrix() * m_mtContentToUser;
843 pImageObj->SetImageMatrix(ImageMatrix);
845 CPDF_ImageObject* pRet = pImageObj.get();
846 m_pObjectHolder->AppendPageObject(std::move(pImageObj));
852 return GetNumbers(m_ParamCount);
857 const uint32_t nvalues = m_ParamCount - 1;
858 std::vector<
float> values(nvalues);
859 for (size_t i = 0; i < nvalues; ++i)
860 values[i] = GetNumber(m_ParamCount - i - 1);
871 if (m_ContentMarksStack.size() > 1)
872 m_ContentMarksStack.pop();
876 if (m_ClipTextList.empty())
879 if (TextRenderingModeIsClipMode(m_pCurStates->text_state().GetTextMode())) {
880 m_pCurStates->mutable_clip_path().AppendTexts(&m_ClipTextList);
883 m_ClipTextList.clear();
899 m_pCurStates->mutable_color_state().SetFillColor(
900 CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceGray),
905 m_pCurStates->mutable_color_state().SetStrokeColor(
906 CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceGray),
913 ToDictionary(FindResourceObj(
"ExtGState", name));
917 CHECK(!name.IsEmpty());
918 m_pCurStates->mutable_general_state().AppendGraphicsResourceName(
920 m_pCurStates->ProcessExtGS(pGS.Get(),
this);
924 if (m_PathPoints.empty())
927 if (m_PathStart.x != m_PathCurrent.x || m_PathStart.y != m_PathCurrent.y) {
928 AddPathPointAndClose(m_PathStart, CFX_Path::Point::Type::kLine);
930 m_PathPoints.back().m_CloseFigure =
true;
935 m_pCurStates->mutable_general_state().SetFlatness(GetNumber(0));
941 m_pCurStates->mutable_graph_state().SetLineJoin(
942 static_cast<CFX_GraphStateData::LineJoin>(GetInteger(0)));
946 m_pCurStates->mutable_graph_state().SetLineCap(
947 static_cast<CFX_GraphStateData::LineCap>(GetInteger(0)));
951 if (m_ParamCount != 4)
954 m_pCurStates->mutable_color_state().SetFillColor(
955 CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceCMYK),
960 if (m_ParamCount != 4)
963 m_pCurStates->mutable_color_state().SetStrokeColor(
964 CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceCMYK),
969 if (m_ParamCount != 2)
972 AddPathPoint(GetPoint(0), CFX_Path::Point::Type::kLine);
976 if (m_ParamCount != 2)
979 AddPathPoint(GetPoint(0), CFX_Path::Point::Type::kMove);
984 m_pCurStates->mutable_graph_state().SetMiterLimit(GetNumber(0));
994 m_StateStack.push_back(std::make_unique<CPDF_AllStates>(*m_pCurStates));
998 if (m_StateStack.empty()) {
1002 *m_pCurStates = *m_StateStack.back();
1003 m_StateStack.pop_back();
1004 m_AllCTMs[GetCurrentStreamIndex()] =
1005 m_pCurStates->current_transformation_matrix();
1009 float x = GetNumber(3);
1010 float y = GetNumber(2);
1011 float w = GetNumber(1);
1012 float h = GetNumber(0);
1013 AddPathRect(x, y, w, h);
1025 if (m_ParamCount != 3)
1028 m_pCurStates->mutable_color_state().SetFillColor(
1029 CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceRGB),
1034 if (m_ParamCount != 3)
1037 m_pCurStates->mutable_color_state().SetStrokeColor(
1038 CPDF_ColorSpace::GetStockCS(CPDF_ColorSpace::Family::kDeviceRGB),
1054 int nargs =
std::min(m_ParamCount, 4U);
1055 m_pCurStates->mutable_color_state().SetFillColor(
nullptr, GetNumbers(nargs));
1059 int nargs =
std::min(m_ParamCount, 4U);
1060 m_pCurStates->mutable_color_state().SetStrokeColor(
nullptr,
1069 if (!pLastParam->IsName()) {
1070 m_pCurStates->mutable_color_state().SetFillColor(
nullptr, GetColors());
1080 std::vector<
float> values = GetNamedColors();
1081 m_pCurStates->mutable_color_state().SetFillPattern(std::move(pPattern),
1090 if (!pLastParam->IsName()) {
1091 m_pCurStates->mutable_color_state().SetStrokeColor(
nullptr, GetColors());
1101 std::vector<
float> values = GetNamedColors();
1102 m_pCurStates->mutable_color_state().SetStrokePattern(std::move(pPattern),
1107 RetainPtr<CPDF_ShadingPattern> pShading = FindShading(GetString(0));
1111 if (!pShading->IsShadingObject() || !pShading->Load())
1115 m_pCurStates->current_transformation_matrix() * m_mtContentToUser;
1116 auto pObj =
std::make_unique<CPDF_ShadingObject>(GetCurrentStreamIndex(),
1118 SetGraphicStates(pObj.get(),
false,
false,
false);
1120 pObj->clip_path().HasRef() ? pObj->clip_path().GetClipBox() : m_BBox;
1121 if (pShading->IsMeshShading())
1122 bbox
.Intersect(GetShadingBBox(pShading.Get(), pObj->matrix())
);
1123 pObj->SetRect(bbox);
1124 m_pObjectHolder->AppendPageObject(std::move(pObj));
1128 m_pCurStates->mutable_text_state().SetCharSpace(GetNumber(0));
1132 m_pCurStates->MoveTextPoint(GetPoint(0));
1136 Handle_MoveTextPoint();
1137 m_pCurStates->set_text_leading(-GetNumber(0));
1141 m_pCurStates->mutable_text_state().SetFontSize(GetNumber(0));
1144 m_pCurStates->mutable_text_state().SetFont(std::move(pFont));
1156 if (m_pResources == m_pPageResources || !m_pPageResources)
1159 return m_pPageResources->GetMutableDictFor(type);
1166 return pHolder ? pHolder->GetMutableDirectObjectFor(name) :
nullptr;
1172 ToDictionary(FindResourceObj(
"Font", name)));
1174 return CPDF_Font::GetStockFont(m_pDocument, CFX_Font::kDefaultAnsiFontName);
1177 ->GetFont(std::move(pFontDict));
1181 pFont->SetResourceName(name);
1182 if (pFont->IsType3Font()) {
1183 pFont->AsType3Font()->SetPageResources(m_pResources.Get());
1184 pFont->AsType3Font()->CheckType3FontMetrics();
1191 CPDF_PageObjectHolder::CTMMap all_ctms;
1192 all_ctms.swap(m_AllCTMs);
1198 if (name
== "Pattern")
1201 if (name
== "DeviceGray" || name
== "DeviceCMYK" || name
== "DeviceRGB") {
1203 defname += name.Last(name.GetLength() - 7);
1205 FindResourceObj(
"ColorSpace", defname);
1207 if (name
== "DeviceGray") {
1211 if (name
== "DeviceRGB")
1216 return CPDF_DocPageData::FromDocument(m_pDocument)
1217 ->GetColorSpace(pDefObj.Get(),
nullptr);
1222 return CPDF_DocPageData::FromDocument(m_pDocument)
1223 ->GetColorSpace(pCSObj.Get(),
nullptr);
1229 if (!pPattern || (!pPattern->IsDictionary() && !pPattern->IsStream()))
1231 return CPDF_DocPageData::FromDocument(m_pDocument)
1232 ->GetPattern(std::move(pPattern), m_pCurStates->parent_matrix());
1238 if (!pPattern || (!pPattern->IsDictionary() && !pPattern->IsStream()))
1240 return CPDF_DocPageData::FromDocument(m_pDocument)
1241 ->GetShading(std::move(pPattern), m_pCurStates->parent_matrix());
1245 pdfium::span<
const ByteString> strings,
1246 pdfium::span<
const float> kernings,
1247 float initial_kerning) {
1252 if (initial_kerning != 0) {
1253 if (pFont->IsVertWriting()) {
1254 m_pCurStates->IncrementTextPositionY(
1255 -GetVerticalTextSize(initial_kerning));
1257 m_pCurStates->IncrementTextPositionX(
1258 -GetHorizontalTextSize(initial_kerning));
1261 if (strings.empty()) {
1265 pFont->IsType3Font() ? TextRenderingMode::MODE_FILL
1266 : m_pCurStates->text_state().GetTextMode();
1268 auto pText =
std::make_unique<CPDF_TextObject>(GetCurrentStreamIndex());
1269 pText->SetResourceName(pFont->GetResourceName());
1270 SetGraphicStates(pText.get(),
true,
true,
true);
1272 const CFX_Matrix& ctm = m_pCurStates->current_transformation_matrix();
1273 pdfium::span<
float> text_ctm =
1274 pText->mutable_text_state().GetMutableCTM();
1275 text_ctm[0] = ctm
.a;
1276 text_ctm[1] = ctm
.c;
1277 text_ctm[2] = ctm
.b;
1278 text_ctm[3] = ctm
.d;
1280 pText->SetSegments(strings, kernings);
1281 pText->SetPosition(m_mtContentToUser.Transform(
1282 m_pCurStates->GetTransformedTextPosition()));
1285 pText->CalcPositionData(m_pCurStates->text_horz_scale());
1286 m_pCurStates->IncrementTextPositionX(position.x);
1287 m_pCurStates->IncrementTextPositionY(position.y);
1288 if (TextRenderingModeIsClipMode(text_mode))
1289 m_ClipTextList.push_back(pText->Clone());
1290 m_pObjectHolder->AppendPageObject(std::move(pText));
1292 if (!kernings.empty() && kernings.back() != 0) {
1293 if (pFont->IsVertWriting())
1294 m_pCurStates->IncrementTextPositionY(
1295 -GetVerticalTextSize(kernings.back()));
1297 m_pCurStates->IncrementTextPositionX(
1298 -GetHorizontalTextSize(kernings.back()));
1303 return GetVerticalTextSize(fKerning) * m_pCurStates->text_horz_scale();
1307 return fKerning * m_pCurStates->text_state().GetFontSize() / 1000;
1312 std::upper_bound(m_StreamStartOffsets.begin(), m_StreamStartOffsets.end(),
1313 m_pSyntax->GetPos() + m_StartParseOffset);
1314 return (it - m_StreamStartOffsets.begin()) - 1;
1319 if (!str.IsEmpty()) {
1320 AddTextObject(pdfium::span_from_ref(str), pdfium::span<
float>(), 0.0f);
1329 size_t n = pArray->size();
1331 for (size_t i = 0; i < n; i++) {
1333 if (pDirectObject && pDirectObject->IsString())
1337 for (size_t i = 0; i < n; i++) {
1338 float fKerning = pArray->GetFloatAt(i);
1340 m_pCurStates->IncrementTextPositionX(-GetHorizontalTextSize(fKerning));
1344 std::vector<ByteString> strs(nsegs);
1345 std::vector<
float> kernings(nsegs);
1346 size_t iSegment = 0;
1347 float fInitKerning = 0;
1348 for (size_t i = 0; i < n; i++) {
1353 if (pObj->IsString()) {
1357 strs[iSegment] =
std::move(str);
1358 kernings[iSegment++] = 0;
1360 float num = pObj->GetNumber();
1362 fInitKerning += num;
1364 kernings[iSegment - 1] += num;
1367 AddTextObject(pdfium::make_span(strs).first(iSegment), kernings,
1372 m_pCurStates->set_text_leading(GetNumber(0));
1376 m_pCurStates->set_text_matrix(GetMatrix());
1377 OnChangeTextMatrix();
1378 m_pCurStates->ResetTextPosition();
1382 CFX_Matrix text_matrix(m_pCurStates->text_horz_scale(), 0.0f, 0.0f, 1.0f,
1384 text_matrix.Concat(m_pCurStates->text_matrix());
1385 text_matrix.Concat(m_pCurStates->current_transformation_matrix());
1387 pdfium::span<
float> pTextMatrix =
1388 m_pCurStates->mutable_text_state().GetMutableMatrix();
1389 pTextMatrix[0] = text_matrix
.a;
1390 pTextMatrix[1] = text_matrix
.c;
1391 pTextMatrix[2] = text_matrix
.b;
1392 pTextMatrix[3] = text_matrix
.d;
1397 if (SetTextRenderingModeFromInt(GetInteger(0), &mode))
1398 m_pCurStates->mutable_text_state().SetTextMode(mode);
1402 m_pCurStates->set_text_rise(GetNumber(0));
1406 m_pCurStates->mutable_text_state().SetWordSpace(GetNumber(0));
1410 if (m_ParamCount != 1) {
1413 m_pCurStates->set_text_horz_scale(GetNumber(0) / 100);
1414 OnChangeTextMatrix();
1418 m_pCurStates->MoveTextToNextLine();
1422 AddPathPoint(m_PathCurrent, CFX_Path::Point::Type::kBezier);
1423 AddPathPoint(GetPoint(2), CFX_Path::Point::Type::kBezier);
1424 AddPathPoint(GetPoint(0), CFX_Path::Point::Type::kBezier);
1428 m_pCurStates->mutable_graph_state().SetLineWidth(GetNumber(0));
1440 AddPathPoint(GetPoint(2), CFX_Path::Point::Type::kBezier);
1441 AddPathPoint(GetPoint(0), CFX_Path::Point::Type::kBezier);
1442 AddPathPoint(GetPoint(0), CFX_Path::Point::Type::kBezier);
1446 Handle_MoveToNextLine();
1451 m_pCurStates->mutable_text_state().SetWordSpace(GetNumber(2));
1452 m_pCurStates->mutable_text_state().SetCharSpace(GetNumber(1));
1453 Handle_NextLineShowText();
1462 if (type == CFX_Path::Point::Type::kMove && !m_PathPoints.empty() &&
1463 !m_PathPoints.back().m_CloseFigure &&
1464 m_PathPoints.back().m_Type == type && m_PathCurrent == point) {
1468 m_PathCurrent = point;
1470 m_PathStart = point;
1471 if (!m_PathPoints.empty() &&
1472 m_PathPoints.back().IsTypeAndOpen(CFX_Path::Point::Type::kMove)) {
1473 m_PathPoints.back().m_Point = point;
1476 }
else if (m_PathPoints.empty()) {
1479 m_PathPoints.emplace_back(point, type,
false);
1485 m_PathCurrent = point;
1486 if (m_PathPoints.empty())
1489 m_PathPoints.emplace_back(point, type,
true);
1494 RenderType render_type) {
1495 std::vector<CFX_Path::Point> path_points;
1496 path_points.swap(m_PathPoints);
1500 if (path_points.empty())
1503 if (path_points.size() == 1) {
1507 m_pCurStates->mutable_clip_path().AppendPathWithAutoMerge(
1508 path, CFX_FillRenderOptions::FillType::kWinding);
1513 if (point.m_Type != CFX_Path::Point::Type::kMove || !point.m_CloseFigure ||
1514 m_pCurStates->graph_state().GetLineCap() !=
1515 CFX_GraphStateData::LineCap::kRound) {
1529 path_points.pop_back();
1532 for (
const auto& point : path_points) {
1533 if (point.m_CloseFigure)
1534 path.AppendPointAndClose(point.m_Point, point.m_Type);
1536 path.AppendPoint(point.m_Point, point.m_Type);
1540 m_pCurStates->current_transformation_matrix() * m_mtContentToUser;
1541 bool bStroke = render_type == RenderType::kStroke;
1543 auto pPathObj =
std::make_unique<CPDF_PathObject>(GetCurrentStreamIndex());
1544 pPathObj->set_stroke(bStroke);
1545 pPathObj->set_filltype(fill_type);
1546 pPathObj->path() = path;
1547 SetGraphicStates(pPathObj.get(),
true,
false,
true);
1548 pPathObj->SetPathMatrix(matrix);
1549 m_pObjectHolder->AppendPageObject(std::move(pPathObj));
1554 m_pCurStates->mutable_clip_path().AppendPathWithAutoMerge(path,
1560 pdfium::span<
const uint8_t> pData,
1561 uint32_t start_offset,
1563 const std::vector<uint32_t>& stream_start_offsets) {
1564 DCHECK(start_offset < pData.size());
1567 pdfium::span<
const uint8_t> pDataStart = pData.subspan(start_offset);
1568 m_StartParseOffset = start_offset;
1569 if (m_RecursionState->parsed_set.size() > kMaxFormLevel ||
1570 pdfium::Contains(m_RecursionState->parsed_set, pDataStart.data())) {
1571 return fxcrt::CollectionSize<uint32_t>(pDataStart);
1574 m_StreamStartOffsets = stream_start_offsets;
1577 &m_RecursionState->parsed_set, pDataStart.data());
1579 uint32_t init_obj_count = m_pObjectHolder->GetPageObjectCount();
1580 AutoNuller<std::unique_ptr<CPDF_StreamParser>> auto_clearer(&m_pSyntax);
1581 m_pSyntax = std::make_unique<CPDF_StreamParser>(
1582 pDataStart, m_pDocument->GetByteStringPool());
1585 uint32_t cost = m_pObjectHolder->GetPageObjectCount() - init_obj_count;
1586 if (max_cost && cost >= max_cost) {
1589 switch (m_pSyntax->ParseNextElement()) {
1590 case CPDF_StreamParser::ElementType::kEndOfData:
1591 return m_pSyntax->GetPos();
1592 case CPDF_StreamParser::ElementType::kKeyword:
1593 OnOperator(m_pSyntax->GetWord());
1596 case CPDF_StreamParser::ElementType::kNumber:
1597 AddNumberParam(m_pSyntax->GetWord());
1600 auto word = m_pSyntax->GetWord();
1601 AddNameParam(word.Last(word.GetLength() - 1));
1605 AddObjectParam(m_pSyntax->GetObject());
1608 return m_pSyntax->GetPos();
1612 std::array<
float, 6> params = {};
1614 int last_pos = m_pSyntax->GetPos();
1617 bool bProcessed =
true;
1623 int len = strc.GetLength();
1626 case kPathOperatorSubpath:
1627 AddPathPoint({params[0], params[1]},
1631 case kPathOperatorLine:
1632 AddPathPoint({params[0], params[1]},
1636 case kPathOperatorCubicBezier1:
1637 AddPathPoint({params[0], params[1]},
1639 AddPathPoint({params[2], params[3]},
1641 AddPathPoint({params[4], params[5]},
1645 case kPathOperatorCubicBezier2:
1646 AddPathPoint(m_PathCurrent, CFX_Path::Point::Type::kBezier);
1647 AddPathPoint({params[0], params[1]},
1649 AddPathPoint({params[2], params[3]},
1653 case kPathOperatorCubicBezier3:
1654 AddPathPoint({params[0], params[1]},
1656 AddPathPoint({params[2], params[3]},
1658 AddPathPoint({params[2], params[3]},
1662 case kPathOperatorClosePath:
1670 }
else if (len == 2) {
1671 if (strc[0] == kPathOperatorRectangle[0] &&
1672 strc[1] == kPathOperatorRectangle[1]) {
1673 AddPathRect(params[0], params[1], params[2], params[3]);
1682 last_pos = m_pSyntax->GetPos();
1698 m_pSyntax->SetPos(last_pos);
1707 return FindFullName(kInlineKeyAbbr, abbr);
1713 return FindFullName(kInlineValueAbbr, abbr);
fxcrt::ByteString ByteString
CFX_FloatRect(const CFX_FloatRect &that)=default
constexpr CFX_FloatRect()=default
void UpdateRect(const CFX_PointF &point)
void Intersect(const CFX_FloatRect &other_rect)
CFX_FloatRect & operator=(const CFX_FloatRect &that)=default
CFX_Matrix & operator=(const CFX_Matrix &other)=default
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
constexpr CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
void Concat(const CFX_Matrix &right)
std::vector< RetainPtr< CPDF_Object > >::const_iterator const_iterator
static RetainPtr< CPDF_ColorSpace > GetStockCS(Family family)
CPDF_DictionaryLocker(const CPDF_Dictionary *pDictionary)
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
uint32_t ComponentBits() const
uint32_t ReadFlag() const
bool CanReadCoords() const
void SkipBits(uint32_t nbits)
void AppendRect(float left, float bottom, float right, float top)
void Transform(const CFX_Matrix &matrix)
ShadingType GetShadingType() const
CPDF_StreamContentParser(CPDF_Document *pDoc, RetainPtr< CPDF_Dictionary > pPageResources, RetainPtr< CPDF_Dictionary > pParentResources, const CFX_Matrix *pmtContentToUser, CPDF_PageObjectHolder *pObjHolder, RetainPtr< CPDF_Dictionary > pResources, const CFX_FloatRect &rcBBox, const CPDF_AllStates *pStates, CPDF_Form::RecursionState *parse_state)
CPDF_PageObjectHolder::CTMMap TakeAllCTMs()
uint32_t Parse(pdfium::span< const uint8_t > pData, uint32_t start_offset, uint32_t max_cost, const std::vector< uint32_t > &stream_start_offsets)
~CPDF_StreamContentParser()
static void DestroyGlobals()
static ByteStringView FindValueAbbreviationForTesting(ByteStringView abbr)
RetainPtr< CPDF_Font > FindFont(const ByteString &name)
static ByteStringView FindKeyAbbreviationForTesting(ByteStringView abbr)
static void InitializeGlobals()
bool operator==(const char *ptr) const
bool operator!=(const char *ptr) const
@ kTensorProductPatchMeshShading
@ kLatticeFormGouraudTriangleMeshShading
@ kFreeFormGouraudTriangleMeshShading
bool TextRenderingModeIsStrokeMode(const TextRenderingMode &mode)
CFX_PTemplate< float > CFX_PointF
pdfium::CheckedNumeric< uint32_t > FX_SAFE_UINT32
#define NOTREACHED_NORETURN()
fxcrt::ByteStringView ByteStringView