Age | Commit message (Collapse) | Author |
|
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>
|
|
Use BGR instead of RGB in CGdiDeviceDriver::GDI_StretchBitMask(). Many
win32 GDI APIs take COLORREF as input, and COLORREF is BGR. In this
case, a win32 API was being called with RGB data.
BUG=chromium:821672
Change-Id: Ia530c7ef5582eed13ac7119935851cfe0ad57323
Reviewed-on: https://pdfium-review.googlesource.com/28573
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
- Make members const.
- Change some ints to enum classes.
- Add helper function to calculate pitch.
Change-Id: I32f94e1189d54a2c365530166fb5c9c0857b7c97
Reviewed-on: https://pdfium-review.googlesource.com/28571
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
When comparing L"a" vs L"ab", the return value should be -1 or 1, not 0
or 1. Add a regression test for this case.
BUG=chromium:821454
Change-Id: I38e2d7ca62319b7a62f8d8afeb231b8ed3bd9e86
Reviewed-on: https://pdfium-review.googlesource.com/28570
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
When adding an annotation, an appearance stream (AP) is generated.
According to the PDF spec, the Subtype, Type and BM entries it contains
should be names rather than strings. Type should be set to XObject.
BUG=pdfium:1038
Change-Id: I0131eec33c257ab3a3a48c7e0dfeac5ca8dfbe2b
Reviewed-on: https://pdfium-review.googlesource.com/28550
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
This replaces them with equivalent FXSYS_*wlower/upper methods, which
uses ICU to perform the correct Unicode operations.
BUG=pdfium:1035
Change-Id: I432db5bef9eda71762016b619d93155949d054db
Reviewed-on: https://pdfium-review.googlesource.com/28530
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
This replaces it with FXSYS_iswspace, which uses ICU to perform
correct Unicode space checking.
BUG=pdfium:1035
Change-Id: I7a4ed01a6b50f56a6f9d1434a7f0b01596fe42db
Reviewed-on: https://pdfium-review.googlesource.com/28510
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Bug: chromium:820885
Change-Id: I3886c636b91a8499924d95ad47f4c832db9f9754
Reviewed-on: https://pdfium-review.googlesource.com/28491
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
|
|
Instances are either replaced with FXSYS_iswalpha, which calls out to
the ICU library to do the proper Unicode operations, or have been
converted to a isascii && isalpha pair, if ASCII alpha is actually
what was wanted.
BUG=pdfium:1035
Change-Id: I971ff639ee1ff818ad08793a1900a8bcbb0a3e04
Reviewed-on: https://pdfium-review.googlesource.com/28450
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Instances are either replaced with FXSYS_iswalnum, which calls out to
the ICU library to do the proper Unicode operations, or have been
converted to a isascii && isalnum pair, if ASCII alnum is actually
what was wanted.
BUG=pdfium:1035
Change-Id: I959ec8739a4d020e61562180393ab8113a81577c
Reviewed-on: https://pdfium-review.googlesource.com/28430
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|