Age | Commit message (Collapse) | Author |
|
Change-Id: I71417cc5b1bd00f77d42740198cc17487ebd686e
Reviewed-on: https://pdfium-review.googlesource.com/33330
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
|
|
Commit 2334660 changed the |dest_width| in CFX_Font::AdjustMMParams to
unsigned, but this means that dest_width - min_width becomes unsigned,
which is wrong because the subtraction could be negative. This CL fixes
this bug.
Bug: chromium:845697
Change-Id: I88fb2f3ee3837d80ff5fa70a08309d9e0fec50e0
Reviewed-on: https://pdfium-review.googlesource.com/33150
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
Currently the value passed in via the flag is ignored on Mac. This
implements the needed logic to use the given path instead of the
standard system font directories.
BUG=pdfium:1094
Change-Id: I2a0599ce8c784add75d36089dee5e4b5476c3d3d
Reviewed-on: https://pdfium-review.googlesource.com/33090
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
The callers always pass in a valid CFX_Matrix, so eliminate the
possibility of a nullptr.
Change-Id: Id7d8b731ed60d5f66517b50c56efeca343e897c4
Reviewed-on: https://pdfium-review.googlesource.com/33152
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
ArgbEncode() does the same thing.
Change-Id: Ibb05ed4aae720c0a5ba66771699c0d7e11230921
Reviewed-on: https://pdfium-review.googlesource.com/32230
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This is a manual revert of the CL at:
https://pdfium-review.googlesource.com/c/pdfium/+/32159
The only file manually changed was cpdf_renderstatus.cpp
Reason for revert: the bug below shows that sometimes the vector size
used is larger than the parameter given to CFX_FixedBufGrow. Thus, we
will revert, then add vectors using std::max unless it's clear from the
code that the code will never access indices outside.
Bug: chromium:847247
Change-Id: Iee54af023c8564824418a7d34a6385b0bc418ff0
Reviewed-on: https://pdfium-review.googlesource.com/33050
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
Abstract GetUserPermissions() differences via new virtual method.
Abstract GetPageCount() differences via existing virtual method.
Remove unused ReadHeader() form for non-xfa.
Remove unused FindSubstFontByUnicode() for xfa.
Remove unused FXFONT_EXACTMATCH
Change-Id: I0a3de01a9841db86fcbc96991d3fa2682393b9ad
Reviewed-on: https://pdfium-review.googlesource.com/32831
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
|
|
BUG=pdfium:234
Change-Id: I5c900aa0547afef0c60de35422b4ee489daa6cfb
Reviewed-on: https://pdfium-review.googlesource.com/32913
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: Id7bf252ebe25c92d26065d1138a445ebb2f78d0b
Reviewed-on: https://pdfium-review.googlesource.com/32187
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Replace it with CFX_BitStream.
Change-Id: Ib74657f888b8dec8b6fdad7b49e28d250991c590
Reviewed-on: https://pdfium-review.googlesource.com/32852
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Also make destructors private for RetainPtr sub-classes, and add missing
destructors.
Change-Id: I451bf0aae2dae943b1f450d0aa4ca5124dc578fd
Reviewed-on: https://pdfium-review.googlesource.com/32853
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Commit 10e1f05a incorrectly removed a font weight sanitizing step in the
font substitution code.
BUG=chromium:820345
Change-Id: I876f65a5649270648616f561eaad17ee333b9a9e
Reviewed-on: https://pdfium-review.googlesource.com/32832
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I06ca9eb7e8bb19f75ee75937a44e4ae548a7a92c
Reviewed-on: https://pdfium-review.googlesource.com/32791
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Doing this in the inner loops gets us another small performance
improvement.
Change-Id: I61fdf4bf8363a66123b3be3bc7ca9b5370f451fc
Reviewed-on: https://pdfium-review.googlesource.com/32710
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
This class is used heavily by CFX_ImageTransformer and fmodf()
calculations are expensive.
Change-Id: If2b9037eb2e90ae377ffb490483a7e7e4faf63b2
Reviewed-on: https://pdfium-review.googlesource.com/23176
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
Tested by running safetynet_compare.py on this patch vs master. The
results were 0 regressions and 0 improvements. The two remaining usages
cannot be replaced because they would cause a regression.
Bug: pdfium:177
Change-Id: I43eddf4ffaac2eb063f2004d6606bc3cd6e627ac
Reviewed-on: https://pdfium-review.googlesource.com/32159
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
|
|
This existing code has the potential for an integer overflow in it.
When overflow occurs in this function scaling may partially succeed.
This is due to how out of range values are being clamped, which
implicitly swallows the overflow.
This CL changes the calculation to be performed in a 64-bit space and
then attempts to down cast it back to 32-bit space at the end. Because
there are multiple steps it is possible for an intermediate value to
cause an overflow in 32 bit space, but the final value to be valid. If
the downcast is not possible then the stretch operation is failed.
An existing test case has been updated, since it encoded an incorrect
result.
BUG=chromium:839245
Change-Id: I637cc1e2d6c6c2d5394599104f76352c20ead021
Reviewed-on: https://pdfium-review.googlesource.com/32056
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
|
|
Rather than messing with actual inheritence, add type-checking wrappers
and just blatantly cast to incomplete types. Along the way, this points
out places where we would downcast without checking, which I fix.
Change-Id: Ieb303eb46ad8522dfe082454f1f10f247ffd52d5
Reviewed-on: https://pdfium-review.googlesource.com/32030
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
A subsequent patch will tackle the ad-hoc ref counting, but we
can tidy this before going down that hole.
Decouple CTTFontDesc creation from face setting.
Remove union and treat single-entry case as vector's first element.
Pass unique_ptr to prove memory ownership.
Change-Id: Ic427798da04f3afbb65a56ee10045b9f22457a73
Reviewed-on: https://pdfium-review.googlesource.com/31730
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Bug: pdfium:243
Change-Id: I36ebe64daa042b998878ffacfca9846b5303450b
Reviewed-on: https://pdfium-review.googlesource.com/31652
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
The existing PostScript modes write data into EMF comments. This
satisfies Chromium's use case, but other embedders want to write data
out via ExtEscape() in PASSTHROUGH mode.
BUG=pdfium:1068
Change-Id: I998035e99fbb84b16dcd244b750b476cecc3bd22
Reviewed-on: https://pdfium-review.googlesource.com/31299
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
|
|
Applies std::remove_ptr to the public API types so that we can
deduce a correct unique ptr type no matter how that API might
change away from void* usage.
Creates shorter names for std::unique_ptr<std::remove_pointer<>, ...>
Change-Id: I04a0ff43cb7d5a4d3867939a53a54c9cef00db86
Reviewed-on: https://pdfium-review.googlesource.com/31292
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Move WindowsPrintMode assertion into CPSPrinterDriver.
Change-Id: I570076b43751e052c5396e89a6674b83a4ad1a1e
Reviewed-on: https://pdfium-review.googlesource.com/31298
Reviewed-by: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
It is never used.
Change-Id: I09220eb16a4679c8499079c3c1375574f6fc0450
Reviewed-on: https://pdfium-review.googlesource.com/31300
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
When parsing UTF16-LE, the default trailing "\0" from a single-byte
character literal isn't suffucient.
Bug: 835184
Change-Id: Ie7db53262adbec0ebccb5d0b22752b8c9f5e6229
Reviewed-on: https://pdfium-review.googlesource.com/31191
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Get bounds checking "for free".
Change-Id: Ic60d63836f6c223e2ee1262649d47da54bb30ecc
Reviewed-on: https://pdfium-review.googlesource.com/30876
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
This reverts commit 3d523e3cf89440e2ffc6571b1c687ad5e3f0318f.
Fixes bounding errors now caught by tests.
Change-Id: I4d0f1791bdcc45a10615a62abf7a4d20e7e538f2
Reviewed-on: https://pdfium-review.googlesource.com/30799
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This CL changes CFX_DIBitmap::TransferBitmap so that the exception cases
are handled before, and early returns are used to reduce nesting.
Change-Id: I733adce5de15d345ee160a8b250133836e9d2873
Reviewed-on: https://pdfium-review.googlesource.com/30770
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit 80a6cbe0a427e155de8555bc867af745d10f9777.
Reason for revert: too many abrts in beta branch.
TBR: dsinclair@chromium.org
Bug: 832557, 832978, 832992, 833062, 833097
Change-Id: I7d511dbb224ddc644be96ea2f3770ad6f73debf5
Reviewed-on: https://pdfium-review.googlesource.com/30792
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Get bounds checking "for free".
Change-Id: I7b14cacbc7130ced7b5cb1869b82c96ccff8e642
Reviewed-on: https://pdfium-review.googlesource.com/30451
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Change-Id: I6643aaf66bf3e9d53d5afab5c99a5cb7deab3661
Reviewed-on: https://pdfium-review.googlesource.com/30054
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
- Pass matrices by const-ref instead of by pointers.
- Mark one SetClip_Rect() variant as XFA-only.
- Pass std::vector into DrawFillArea().
- Simplify the only DrawFillArea() caller.
Change-Id: I8f7497e4d46345d50ac4cc8f3e7eef135644e7a7
Reviewed-on: https://pdfium-review.googlesource.com/30131
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Make sure they match their win32 equivalent data types.
Change-Id: I395054ce5c5ae110c78dbae30dd985fc498045fb
Reviewed-on: https://pdfium-review.googlesource.com/30070
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
|
|
It currently takes const FX_RECT*, but the pointer is never nullptr.
Change-Id: I571e9e8dd04756bc4daa25a61a5af8d1f902914b
Reviewed-on: https://pdfium-review.googlesource.com/30052
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
|
|
They currently take const FX_RECT*, but the pointer is never nullptr.
Also add a comment to explain why FX_RECT is the way it is. It has the
same layout as a win32 RECT.
Change-Id: Icf0e4c3eb25fe03317590a736578e053b9dccf7a
Reviewed-on: https://pdfium-review.googlesource.com/30051
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>
|
|
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 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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|