Age | Commit message (Collapse) | Author |
|
This CL replaces the array of path points with a vector. Cleaning up the usage
as required.
Change-Id: Ifa386a2c847005fef68af748ebe99c4e08961238
Reviewed-on: https://pdfium-review.googlesource.com/2710
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This CL fixes up the bits of the CPDF_MeshStream CL that depended on the Origin
CL and integrates the fixes for the Skia bots.
Change-Id: I470e49c35b809f00fecbaeb303de15c0db3fe590
Reviewed-on: https://pdfium-review.googlesource.com/2698
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
BUG=pdfium:667
Change-Id: I701719144127881ebdb5be01a51e833d1e576477
Reviewed-on: https://pdfium-review.googlesource.com/2691
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit da83d3a5cc09c4056310b3cf299dbbccd5c70d11.
Reason for revert: Reverting chain to see if fixes Chrome roll.
Original change's description:
> Convert Origins to points
>
> This CL converts various OriginX, OriginY pairs into CFX_PointF objects.
>
> Change-Id: I9141f7fc713c710b2014d4fdcdec7dc93501f844
> Reviewed-on: https://pdfium-review.googlesource.com/2575
> Commit-Queue: dsinclair <dsinclair@chromium.org>
> Reviewed-by: Nicolás Peña <npm@chromium.org>
>
TBR=tsepez@chromium.org,dsinclair@chromium.org,npm@chromium.org,pdfium-reviews@googlegroups.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=
Change-Id: I949fb4ec712e2587e7d0ef0191c34db198b61dcc
Reviewed-on: https://pdfium-review.googlesource.com/2696
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This reverts commit 9787a7441a905e582b10d9ffc425098b3233d36c.
Reason for revert: Reverting chain to see if fixes Chrome roll.
Original change's description:
> Cleanup CPDF_MeshStream
>
> This CL converts the MeshVertex to a point and the TransformPoint to the
> CFX_PointF override.
>
> Change-Id: I3faa5c14cedcf5af6aafca1c566acbc68577cca7
> Reviewed-on: https://pdfium-review.googlesource.com/2610
> Commit-Queue: dsinclair <dsinclair@chromium.org>
> Reviewed-by: Nicolás Peña <npm@chromium.org>
>
TBR=tsepez@chromium.org,dsinclair@chromium.org,npm@chromium.org,caryclark@google.com,pdfium-reviews@googlegroups.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Ie1b1dae3ede7581128a81cf7cd86a348c651233b
Reviewed-on: https://pdfium-review.googlesource.com/2695
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
Modernizing CPDF_TextObject a little bit, in preparation for the addition of
APIs for adding text to PDFs. m_pCharCodes, m_pCharPos are now vectors, this
caused some propagation to other classes. Also m_Pos is now a point. Note that
GetItemInfo is being changed in another CL, so did minimal changes there.
Change-Id: I6e5f19b5d45872e3e714a7cb587c81c92e640ea3
Reviewed-on: https://pdfium-review.googlesource.com/2614
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL converts the MeshVertex to a point and the TransformPoint to the
CFX_PointF override.
Change-Id: I3faa5c14cedcf5af6aafca1c566acbc68577cca7
Reviewed-on: https://pdfium-review.googlesource.com/2610
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This CL converts various OriginX, OriginY pairs into CFX_PointF objects.
Change-Id: I9141f7fc713c710b2014d4fdcdec7dc93501f844
Reviewed-on: https://pdfium-review.googlesource.com/2575
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
Found by Coverity when scanning the bundled pdfium-3004 in LibreOffice.
This fixes:
- CID 1400341: Uninitialized members (UNINIT_CTOR)
CFX_ImageRenderer::m_pIccTransform
- CID 1400340: Uninitialized members (UNINIT_CTOR)
CPDF_CharPosList::m_nChars
- CID 1400339: Uninitialized members (UNINIT_CTOR)
CPDF_StreamContentParser::m_PathStartX/Y
- CID 1400337: Uninitialized members (UNINIT_CTOR)
CFX_ScanlineCompositor::m_pIccTransform
Change-Id: Iab3862eb77be8bf379093a47f6c60ce987099982
Reviewed-on: https://pdfium-review.googlesource.com/2630
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
BUG=pdfium:661
Change-Id: Ie1dc82a1323a35ebbd63a5b7b8f8c95f9a5325fe
Reviewed-on: https://pdfium-review.googlesource.com/2613
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This CL removes unused CFX_Matrix methods and cleans up the implementaion
of others.
Change-Id: I72d1d10d4a45cc9341a980054df5225e52a0c4f2
Reviewed-on: https://pdfium-review.googlesource.com/2574
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This CL removes the two Transform() overrides from CFX_Matrix and calls the
TransformPoint methods directly. In the case of the 4 param version the
values were assigned to the out values before calling.
Change-Id: Id633826caec75b848774dcda6cfdcef2dbf5a7db
Reviewed-on: https://pdfium-review.googlesource.com/2573
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
|
|
This Cl removes the rect based transform method which internally just called
the matrix tranform method. The callers have been reversed to make it clearer
the matrix is transforming the rect.
Change-Id: I8ef57ccc2311e4e853b8180a6ff475f8eda2138e
Reviewed-on: https://pdfium-review.googlesource.com/2572
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This Cl changes several Get methods to return their values instead of using
out parameters.
Change-Id: Ie9a930a5c2d0e809f2d7181ca033d801945c1cf9
Reviewed-on: https://pdfium-review.googlesource.com/2556
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
|
|
This Cl fixes the naming of the size types to match their purpose. This makes
the code clearer.
Change-Id: I37a41ab0fe01782f4749054f1f8ab29ddf8d2790
Reviewed-on: https://pdfium-review.googlesource.com/2551
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
This Cl updates the code to use the constructors instead of creating an
empty object and calling Set(). It also removes the various memsets of
the CFX_Rect{F} classes.
Change-Id: I6e20cec00866a38372858dcba5a30d31103172e4
Reviewed-on: https://pdfium-review.googlesource.com/2550
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
Added methods to create paths, set their colors, determine whether they will be
stroked and/or filled. FPDFPage_InsertObject should be used to add a path to a
page.
BUG=pdfium:661
Change-Id: I8fd17b33a09c5126e517bfd1a69a893216c160e8
Reviewed-on: https://pdfium-review.googlesource.com/2534
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
This hopefully makes it less confusing what the description of a point is.
Currently we have defines for the types, which is confusing because a point
can only be one of the three. And it is mixed up with whether the point is
closing a figure or not.
Change-Id: Icd71355d69c77b3d52ca78e03bc379081ff87753
Reviewed-on: https://pdfium-review.googlesource.com/2552
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
If m_pFile is set, m_bMemoryBased is set to false. However, ReadRawData
incorrectly checks if m_bMemoryBased is TRUE before passing a read to
m_pFile. This fix changes things to correctly call m_pFile's ReadBlock.
Filed associated https://bugs.chromium.org/p/pdfium/issues/detail?id=662
BUG=pdfium:662
Change-Id: If58af9093e3de78261a4cf1eb0460b7c7c153e5a
Reviewed-on: https://pdfium-review.googlesource.com/2532
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
CPDF_PageObject is a CPDF_GraphicStates, which allows us to add graphics
information to the object itself. The RGB can be added easily in the stream.
The alpha parameter needs to be in a dictionary contained in the ExtGState,
which should be part of the page's resources.
BUG=pdfium:661
Change-Id: Id99b2ece7aa201e3550c765ac2b5eeff4b43fc48
Reviewed-on: https://pdfium-review.googlesource.com/2530
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Nicolás Peña <npm@chromium.org>
|
|
See Table 4.9 for path construction operators. Ignoring v, y, because those can
be replaced with the more powerful c operator. The code added will be called by
public methods that do not exist yet.
BUG=pdfium:661
Change-Id: I9a1ad3fd0a601e4e3a292b55f3e5708fe0c9c8fb
Reviewed-on: https://pdfium-review.googlesource.com/2495
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Avoids explicit deletes through CPDF_RenderOptions holding pointers
to it which may have been copy constructed. Ick.
Change-Id: Ic044b66d13bd7c5eaa53de995373858081e115ec
Reviewed-on: https://pdfium-review.googlesource.com/2451
Reviewed-by: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
|
|
Rename array members to plurals.
Use std::vectors rather than native arrays and counts.
Use std::set instead of map of key to itself.
Use unique_ptr inside vector to clean subtables.
Mark non-existent constructors() = delete.
Change-Id: Ifde189157e8affb5de654a44fac8b9358de7079b
Reviewed-on: https://pdfium-review.googlesource.com/2452
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
We currently only limit the array recursion levels. This recursion
level may also be reset when parsing. This is insufficient to protect
against stack overflows.
BUG=681920
Change-Id: I69bd0c912fb45c0e68b9b9fa961d43f0adc9bdd3
Reviewed-on: https://pdfium-review.googlesource.com/2434
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
These separate scalars are an anti-pattern given the ability to pass a single entity and later operate on it sensibly.
Review-Url: https://codereview.chromium.org/2652033002
|
|
Also fix an unsafe negation in same block.
BUG=641551
BUG=681091
Review-Url: https://codereview.chromium.org/2649283002
|
|
Fix callers conventions to avoid ambiguity.
Fix bad bounds check unmasked by change.
Directly include headers no longer pulled in by numerics itself.
Review-Url: https://codereview.chromium.org/2640143003
|
|
Also return CFX_MaybeOwned<> from functions so to make cleanup automatic,
avoiding a theoretical leak.
Review-Url: https://codereview.chromium.org/2641853004
|
|
Moving to std::vector from the more forgiving CFX_ArrayTemplate
revealed the dubious page tree traversal, which depends on the
correctness of the /Count entries to properly summarize the total
descendants under a given node.
The only "correct" thing to do is to throw away these counts as parsed,
and re-compute them, perhaps in CountPages(). But I'm not willing to do
that since it may break unknown documents in the wild.
Pass out-params as pointers while we're at it.
BUG=680376
Review-Url: https://codereview.chromium.org/2636403003
|
|
We should not fill out the m_Encoding for Type3 fonts. This way, we
stop getting garbage characters from text extraction. Guessing that
unicode == charcode (in the absence of ToUnicode) is our best bet.
BUG=pdfium:642
Review-Url: https://codereview.chromium.org/2643543002
|
|
Also use unique_ptr in one spot while we're at it.
Review-Url: https://codereview.chromium.org/2625483002
|
|
We should not have valid objects where the object number is
CPDF_Object::kInvalidObjNum.
BUG=pdfium:609
Review-Url: https://codereview.chromium.org/2610393004
|
|
Review-Url: https://codereview.chromium.org/2611413002
|
|
Review-Url: https://codereview.chromium.org/2617683003
|
|
GetCachedBitmap method is not being used. This removal
simplifies some of the code.
Change-Id: I075c245c3511e8a1b595c8ba148991f7c838f504
Reviewed-on: https://pdfium-review.googlesource.com/2154
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
CPDF_DIBSource was already in its own file, but files needed renaming.
Change-Id: Ib3ac787a0bb33d3f78ecdcdfcdbc938867857a14
Reviewed-on: https://pdfium-review.googlesource.com/2152
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
|
|
The previous implementation, FindPDFPage, was already doing this since
the recursive call was always with return. Currently, we were trying to
keep going even after reaching max level. The problem is that if the
page tree is not a tree, we might loop forever. This could also be
solved by keeping track of the dictionaries that have been visited, but
this solution takes much less space.
BUG=672172
Change-Id: Ia37aea58e92b6068de69f26736c612aa6a0ff4b3
Reviewed-on: https://pdfium-review.googlesource.com/2138
Commit-Queue: Nicolás Peña <npm@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
|
|
Also be sure that a loop terminates without relying on
specific behaviour of the callers.
Review-Url: https://codereview.chromium.org/2598473002
|
|
TBR=dsinclair@chromium.org
BUG=675752
Review-Url: https://codereview.chromium.org/2585113004
|
|
BUG=pdfium:644
Review-Url: https://codereview.chromium.org/2581873002
|
|
- Add unit tests for sha256 implementation.
- Remove void* types from API in favor of correct actual types.
Review-Url: https://codereview.chromium.org/2577223002
|
|
In turn, make CPDF_Stream() take an unique_ptr.
Review-Url: https://codereview.chromium.org/2584683002
|
|
Rename GetAlphaMask => CloneAlphaMask since it does more than get.
Rename CopyAlphaMask => SetAlphaMask, as it copies IN, not OUT.
ditto for CopyPalette => SetPalette.
BUG=
Review-Url: https://codereview.chromium.org/2572243002
|
|
Review-Url: https://codereview.chromium.org/2571313002
|
|
Allows JPEG data to be copied into the file rather than left in a
separate file. This is needed to allow rasterized PDFs to avoid saving
image files for each page. See Chromium issue 2524143003 for chromium
changes.
BUG=534945, 550205, 480628
Review-Url: https://codereview.chromium.org/2529543003
|
|
Be suspicious of |new|. This removes some of the
easy cases.
Review-Url: https://codereview.chromium.org/2571913002
|
|
Review-Url: https://codereview.chromium.org/2572843002
|
|
Review-Url: https://codereview.chromium.org/2558373002
|
|
We can remove a lot of "bOwnsStream" logic in the process.
Always pass these by const reference, in case the called method
wants to hang on to the stream (one exception is where we stick
a raw pointer into a void* slot in a context from another layer).
Review-Url: https://codereview.chromium.org/2451493002
|
|
This permits consecutive path drawing or text drawing to combine
if their graphics state matches. This speeds up rendering considerably
when PDFium draws in many small parts. It also allows discarding
changes to the clip state that have no effect from draw to draw.
All corpus tests draw equivalently with caching enabled or disabled.
Change the member order in CPDF_PageRenderContext so the device is
flushed before the referencing annotation is deleted.
Add more printf style debugging for test draws.
R=dsinclair@chromium.org
Review-Url: https://codereview.chromium.org/2546803003
|