summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_contentparser.h
AgeCommit message (Collapse)Author
2018-06-12Fill m_ContentStream field in CPDF_PageObject.Henrique Nakashima
From the comment of CPDF_PageObject::GetContentStream(): """ Get what content stream the object was parsed from in its page. This number is the index of the content stream in the "Contents" array, or 0 if there is a single content stream. If the object is newly created, -1 is returned. If the object is spread among more than one content stream, this is the index of the last one. """ Bug: pdfium:1051 Change-Id: I9f7804af4f263dda0422e9542e025e3320ff7c31 Reviewed-on: https://pdfium-review.googlesource.com/34250 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2018-06-05Revert "Do not merge content streams to parse them."Henrique Nakashima
This reverts commit 9d3fb11a985a8f2aefbf361c0030c7bce2248b8e. Reason for revert: Break rendering of http://www.flbb.lu/bio_files/BIO_25_2005.pdf Original change's description: > Do not merge content streams to parse them. > > Removed the PrepareContent() step in CPDF_ContentParser, as its goal > was to merge these streams. > > In Parse(), now loop through the m_StreamArray and parse each stream > separately. > > Bug: pdfium:1051 > Change-Id: Id07f3efe766828081c8cf8601bf69c4f37e20e13 > Reviewed-on: https://pdfium-review.googlesource.com/33595 > Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> > Reviewed-by: Ryan Harrison <rharrison@chromium.org> TBR=thestig@chromium.org,hnakashima@chromium.org,rharrison@chromium.org Change-Id: I8186b2dac8538ca477302bb91e22dcc54124461a Bug: pdfium:1051 Reviewed-on: https://pdfium-review.googlesource.com/33991 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-06-04Do not merge content streams to parse them.Henrique Nakashima
Removed the PrepareContent() step in CPDF_ContentParser, as its goal was to merge these streams. In Parse(), now loop through the m_StreamArray and parse each stream separately. Bug: pdfium:1051 Change-Id: Id07f3efe766828081c8cf8601bf69c4f37e20e13 Reviewed-on: https://pdfium-review.googlesource.com/33595 Commit-Queue: Henrique Nakashima <hnakashima@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
2018-05-16Cleanup CPDF_ContentParserDan Sinclair
This CL cleans up the CPDF_ContentParser code. The m_bIsDone flag has been removed and a kComplete stage added. Each of the processing methods returns the next stage instead of setting the internal flag automatically. The infinite loop is removed for simpler straight line code. Change-Id: Id817a5fa054e28c331c68c63ec2c12b369cb0233 Reviewed-on: https://pdfium-review.googlesource.com/32611 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
2018-05-15Break CPDF_CotnentParser::Continue into piecesDan Sinclair
This CL separates the parts of CPDF_ContentParser::Continue into three distinct methods. It clarifes when and what is returned from Continue. Change-Id: Id7a9bf1aa16f366f567cce74006c27c452cb5dcc Reviewed-on: https://pdfium-review.googlesource.com/32531 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2018-03-06Rename core/fxcrt IFX files to IfaceDan Sinclair
This CL renames the 3 IFX files in core/fxcrt to Iface instead. Change-Id: I7cee6836650b71bc5c5729a8147fda62f0910fe3 Reviewed-on: https://pdfium-review.googlesource.com/27970 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-11-08Use MaybeOwned in CPDF_ContentParserNicolas Pena
Change-Id: I7e5daeafd70ef29bcc9bdebbae004fa4b946b83d Reviewed-on: https://pdfium-review.googlesource.com/18019 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
2017-11-07Simplify CPDF_ContentParser.Lei Zhang
Do more work in the ctor instead of a separate Start() method. Adjust callers and member variables accordingly. Change-Id: I310f27b3102a89e8e7b7ad31affd174f1fbbe500 Reviewed-on: https://pdfium-review.googlesource.com/17793 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-09-21Move CFX_UnownedPtr to UnownedPtrDan Sinclair
This CL moves CFX_UnownedPtr to UnownedPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I6d1fa463f365e5cb3aafa8c8a7a5f7eff62ed8e0 Reviewed-on: https://pdfium-review.googlesource.com/14620 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-09-21Rename CFX_RetainPtr to RetainPtrDan Sinclair
This CL renames CFX_RetainPtr to RetainPtr and places in the fxcrt namespace. Bug: pdfium:898 Change-Id: I8798a9f79cb0840d3f037e8d04937cedd742914e Reviewed-on: https://pdfium-review.googlesource.com/14616 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-08-31Prevent duplicate parses of same data, in the same recursive descentRyan Harrison
When parsing if there is a loop in the data being parsed, the recursions will just keep cycling until it exhausts memory and crashes. This CL introduces a parsed set, which a reference to is passed down the descent. If the data being parsed at a specific stage of the descent is already in the parsed set, then the parse returns at that point. BUG=chromium:759224 Change-Id: I1dca73d81020099dec03fd49aaa44cdcdf38e17e Reviewed-on: https://pdfium-review.googlesource.com/12470 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
2017-08-31Split IFX_Pause out of fx_basicDan Sinclair
This CL moves IFX_Pause out to its own class from fx_basic and updates includes as needed. Change-Id: Iebdd183d8c85aa17570f190f1a7d1602c0af3c8b Reviewed-on: https://pdfium-review.googlesource.com/12491 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-07-12Nits in CFX_RenderDevice and CPDF_ContentParserNicolas Pena
Change-Id: I29f1c4f68356e335cd55e38014699780bf658249 Reviewed-on: https://pdfium-review.googlesource.com/7610 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
2017-06-28Set default graphics before generating page contentsNicolas Pena
In this CL, the content generator sets some default graphics states before processing the page objects. In particular, a default ExtGState is now set before processing, and the last CTM is now stored right after parsing finishes: the only command to change matrix is ctm, and it concatenates, so inverting requires knowing the current value. Bug: pdfium:779 Change-Id: I35b1c07550ce91839fb0e20fbf717e3e80c9b9d6 Reviewed-on: https://pdfium-review.googlesource.com/7070 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
2017-05-22Convert more c-style pointers to CFX_UnownedPtrTom Sepez
Change-Id: I551b4210c95db0b916e9fe6cddf11e6c3d015c50 Reviewed-on: https://pdfium-review.googlesource.com/5790 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
2017-04-04RefCount CPDF_StreamAcc all the time.Tom Sepez
Pass stream argument to constructor; it feels like a stream accessor should always be made from a stream rather than passing one in after the fact. Change-Id: Iaa46cb37677b81f0170f5d39bab76ad38ea4af44 Reviewed-on: https://pdfium-review.googlesource.com/3620 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
2016-11-22Continue splitting pageint.h into per-class filestsepez
Add cpdf_streamparser.h and cpdf_contentparser.h since there are already corresponding .cpp files with the same name. Review-Url: https://codereview.chromium.org/2521123003