Age | Commit message (Collapse) | Author |
|
Change-Id: I92c7ba605bf95a9023ad046b8dddebe0a0592802
Reviewed-on: https://pdfium-review.googlesource.com/29992
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Change-Id: I1232e6c61cbe696d90d87f461ebed0a7aea40893
Reviewed-on: https://pdfium-review.googlesource.com/29973
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
It has no overrides and always returns the identity matrix. Many callers
that use the returned value can be simplified, because they are scaling
by 1 or concatenating an identity matrix.
Change-Id: I7afb7214be210d02638644dfb9b58404420c2ef2
Reviewed-on: https://pdfium-review.googlesource.com/29972
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
- Just return the rect directly and let the caller check for emptiness.
- Get rid of a boolean parameter with always false argument.
Change-Id: Ia33587db34c0a628047e59b7faa390c3ac57ec8a
Reviewed-on: https://pdfium-review.googlesource.com/29971
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Get bounds checks in parsers automatically when using spans.
Change-Id: I71fbe7b838435d455376db2f89817d807a9cdcfd
Reviewed-on: https://pdfium-review.googlesource.com/29830
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I13d3e462c86d035bbb992696aab523df5642533b
Reviewed-on: https://pdfium-review.googlesource.com/29811
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Because we can get the lifetime check for free if we do this. This
requires adding some "constexpr/noexcept" to UnownedPtr to make the
types line up with what span.h requires.
Change-Id: I45918f8723122082036eed959f769644ab4c509f
Reviewed-on: https://pdfium-review.googlesource.com/29672
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL removes the CFX_XMLParser from CXFA_SimpleParser and constructs
it in the CFX_XMLDoc.
Change-Id: Id69b396f091892170a4c4654ac1d0fd65d1efbb6
Reviewed-on: https://pdfium-review.googlesource.com/29970
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Allows indexing with better bounds-checking to occur. Some small
modifications are required to deal with PDFium being intentionally
held at C++11 compliance, not C++14.
Use in one place as check on correctness.
Change-Id: Id2875cf0a93980112bc536a93c4f9ec5306c0dac
Reviewed-on: https://pdfium-review.googlesource.com/29671
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
The two branches are very similar.
Change-Id: I2a9502858e9ce997f28b17bc1051b71fa058c2c4
Reviewed-on: https://pdfium-review.googlesource.com/24350
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Move some code into TranslateScanline24bppDefaultDecode().
Change-Id: I7e985c2abb9b2f9e41214531321f8f3846dd3a94
Reviewed-on: https://pdfium-review.googlesource.com/29857
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I4d7661716116969ae80fdac52f6b400a5ff68e50
Reviewed-on: https://pdfium-review.googlesource.com/29855
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: I3ee8f8e9eb33d251dc00336bcd31e578e7ce5143
Reviewed-on: https://pdfium-review.googlesource.com/29854
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: I7c639655c003527417255c134a4393d68cda3ef1
Reviewed-on: https://pdfium-review.googlesource.com/29852
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Currently this is being treated as a case of "data not available" which
leads to an infinite loop.
BUG=pdfium:1055
Change-Id: I2722a5b364d56a4ad5b7cca2a4b42e6b13a933f4
Reviewed-on: https://pdfium-review.googlesource.com/29831
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL decreases the m_iXMLPlaneSize in the CFX_XMLSyntaxParser from
32*1024 to 1024 bytes. This plane size is the size of the chunks we read
the XML file in. The issue with having a large plane size is inside the
CFX_SeekableStreamProxy::ReadString we allocate a vector of the
min(planeSize, remaining_bytes). This means, we could potentially be
allocating 32*1024 bytes to read in a single character.
For the test in the attached bug the runtime went from 12s to 25ms.
Bug: chromium:813195
Change-Id: Id57e619b7a118d45e3fed491ad81e86a4b1cacb8
Reviewed-on: https://pdfium-review.googlesource.com/29750
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL converts CPDF_DefaultAppearance to return
Optional<CFX_Color:Type> items instead of having a HasColor. This saves
the double parse of the appearance stream.
Change-Id: Ib3c136da6e2adfb559e495de1d299cce0b4ad25f
Reviewed-on: https://pdfium-review.googlesource.com/29630
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL changes the CPDF_DefaultAppearance code to remove the HasFont
method and change GetFont to return an Optional. This forces all the
call sites to verify a font was returned correctly and removes the need
for the duplicate appearance stream parsing.
Bug: chromium:827430
Change-Id: If09e0a7d3f7dd63ad77b97a5a388127e4a02da61
Reviewed-on: https://pdfium-review.googlesource.com/29610
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
This might make the memory tools more effective in finding OOBs.
Change-Id: Id093bb0a88c37954c80d612ac00b5a168e75bdbf
Reviewed-on: https://pdfium-review.googlesource.com/29550
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Limit the token to 255 bytes + NUL. Also, shuffle fields in
cpdf_streamparser to allow memory tools to better check this
inline array.
Bug: 828049
Change-Id: I444f2b4c6958167577d9cd76c06805baf7d5c26c
Reviewed-on: https://pdfium-review.googlesource.com/29530
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL converts the CPDF_DefaultAppearance::GetColor methods to return
instead of using reference parameters.
Change-Id: I9ba6bf060a536290a83d3c9ce6e115511f28664c
Reviewed-on: https://pdfium-review.googlesource.com/29410
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
This CL moves code over to using CPDF_DefaultAppearance instead of
calling the CPDF_SimpleParser directly. This means the code for finding
a specific tag start can move into CPDF_DefaultAppearance directly.
Change-Id: I1dc64e54aedd03d059b963121d466f3eb75c17db
Reviewed-on: https://pdfium-review.googlesource.com/28410
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL renames fsdk_common and fsdk_define to cpdfsdk_common and
cpdfsdk_helpers respectively.
Change-Id: I8ee7a308561f1ff2f510954444f953b0c8fed788
Reviewed-on: https://pdfium-review.googlesource.com/29371
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL converts the CPDF_SimpleParser to accept a ByteStringView.
Several of the callers of SimpleParser are also updated to use a
ByteStringView instead of <char*,size>.
Change-Id: Ic2df3a06f92e77b53745a0419b44368142f9d8e6
Reviewed-on: https://pdfium-review.googlesource.com/29351
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the ByteString version of PDF_NameDecode and forces the
callers to use the ByteStringView variant.
Change-Id: I5a955d8e909e2045ee45843af54b23e98abe00ed
Reviewed-on: https://pdfium-review.googlesource.com/29350
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: If816c4f532f03513ad06959182b0e0edfd688e39
Reviewed-on: https://pdfium-review.googlesource.com/29170
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Also fix nits in QuadPoints code in cpdf_annot.cpp.
Change-Id: I7852b673d3dca906e6d250cb3cfa305f8ea7e742
Reviewed-on: https://pdfium-review.googlesource.com/28893
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Transitively mark the same pointers as const in callers.
Change-Id: I1f9669b35c6d7f4b1a11c25163480bc687fbc7f8
Reviewed-on: https://pdfium-review.googlesource.com/28870
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: I94412dd183535c18f4421b465f64870b44ad230d
Reviewed-on: https://pdfium-review.googlesource.com/28971
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Destination variables usually have "dest" or "dst" as the prefix.
Change-Id: If5bb01a5eafe1e4b42d1a6d653abb1b444b1b2fa
Reviewed-on: https://pdfium-review.googlesource.com/28970
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Helper functions make getting the bpp and component count more readable.
Change-Id: Ie0f97d52136d11ef5251f6e22748e87aea289ae1
Reviewed-on: https://pdfium-review.googlesource.com/28572
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Change-Id: Ia6e9fe790065d0bfd288d425c10d1dd9e0cf8c31
Reviewed-on: https://pdfium-review.googlesource.com/28850
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Also change it from a macro to a constexpr function.
Change-Id: I8b2bb42c45a23da6db136abdaee24132db4471c6
Reviewed-on: https://pdfium-review.googlesource.com/28579
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Also change them from macros to constexpr functions.
Change-Id: I5ebec07487b7b7f59cc769debc95c730776d4613
Reviewed-on: https://pdfium-review.googlesource.com/28578
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Mark the other ArgbEncode() variant as constexpr.
Change-Id: I84207d805766e5efc669638bd8a15cfead356a41
Reviewed-on: https://pdfium-review.googlesource.com/28577
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I196e3148d680c9efeaf9609dd3ddbfe3f6635fa6
Reviewed-on: https://pdfium-review.googlesource.com/28576
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
- Augment/reuse existing NormalizeThreshold() function.
- Use std::min() / std::max().
Change-Id: I709e246c58bf8a69638e1d77dcc2a79ae8a27e77
Reviewed-on: https://pdfium-review.googlesource.com/28736
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Since that is what it really returns. Add a replacement ArgbToColorRef()
that only returns a FX_COLORREF, and remove a duplicate implementation.
Then update callers and only use ArgbToAlphaAndColorRef() where
appropriate.
Also update comments to explain what FX_COLORREF is.
Change-Id: I5ed3d71683898dc2b3a66395dea0ec2562c14a68
Reviewed-on: https://pdfium-review.googlesource.com/28575
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Currently, when constructing AP for multi-line markup annotations, we
only take into account the first set of quadpoints, resulting in only
the first line of the annotation being displayed if the annotation spans
multiple lines.
This CL, initially written by Jane Liu <janeliulwq@google.com>
(https://pdfium-review.googlesource.com/12010) takes into account all
the quadpoints, so multi-line annotations can be displayed correctly.
BUG=pdfium:876
Change-Id: I8be10ee38e01eb6525ddef556df1b727189455c7
Reviewed-on: https://pdfium-review.googlesource.com/28590
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Change-Id: Ia6cb19269ef93440669b68d76c3c378a5d4da7a5
Reviewed-on: https://pdfium-review.googlesource.com/28735
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
CountRects() calls GetRectArray(), which performs the same calculation.
Change-Id: I79dcd8e82f6d0fe7ed992da06237f31d0761a902
Reviewed-on: https://pdfium-review.googlesource.com/28734
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
BUG=chromium:821305
Change-Id: I371572f60ea3984ce044e25125d882b3c2d03115
Reviewed-on: https://pdfium-review.googlesource.com/28733
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
|
|
Treat values less than -1 as -1.
BUG=chromium:821305
Change-Id: Ieaced045473fa51097400e5af1286f0d3f4d0143
Reviewed-on: https://pdfium-review.googlesource.com/28732
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Found by ClangTidy.
BUG=pdfium:1039
Change-Id: I2bb9256a63d5459e959c1a3228418073245d7a86
Reviewed-on: https://pdfium-review.googlesource.com/28731
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Found by ClangTidy.
BUG=pdfium:1040
Change-Id: I6d7cb26ae2d12f5650f73596d0b991234b076f57
Reviewed-on: https://pdfium-review.googlesource.com/28712
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
One that takes a CFX_FloatRect instead of LBRT floats. Use it where
appropriate.
Change-Id: I8ba19e86c61c91d8b4ef685b5cb65c8fb717f013
Reviewed-on: https://pdfium-review.googlesource.com/28581
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This call removes a page object from a page. We currently offer an
API to insert these objects, but not to remove.
Bug: pdfium:1037
Change-Id: I35ff596f9e7c87a39051f0cb1de40a5bec40fee5
Reviewed-on: https://pdfium-review.googlesource.com/28492
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Per tspepez's drive by:
str, in theory, might not be terminated, and might have been allocated
right up to a guard page at the end of the heap, say, so that str[len]
could segv.
Change-Id: I6cba7b6d12b23f69e6f150c1b5296df65c2e0086
Reviewed-on: https://pdfium-review.googlesource.com/28610
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
FX_COLORREF should work like win32 COLORREF, which is BGR.
Change-Id: I9f8bb3e2d30a64dc822ac6b8c46130358a03678a
Reviewed-on: https://pdfium-review.googlesource.com/28574
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
Change-Id: I07f4363046be920816e8d0dae766c7af833284db
Reviewed-on: https://pdfium-review.googlesource.com/28582
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|