Skip to content

Sync S9: merge upstream PDFium up to 06fbf69b3 (Oct 10 2026) - #72

Merged
bobsingor merged 73 commits into
embedpdf/mainfrom
embedpdf/sync/06fbf69b3
Oct 13, 2026
Merged

bobsingor merged 73 commits into
embedpdf/mainfrom
embedpdf/sync/06fbf69b3

Conversation

@bobsingor

Copy link
Copy Markdown
Contributor

No description provided.

tsepez and others added 30 commits October 1, 2026 14:01
Track CFFL_FormField lifetime using ObservedPtr during focus
transitions and PWL window updates. Return early if the form field
is destroyed while handling these events.

Fixed: 567936263
Change-Id: I992b06f6bfde5cc839e9d11b90a098b8affcf5f6
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159451
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/fc1897a2c12a..09351f6ec00c

Created with:
  roll-dep third_party/libc++abi/src

Change-Id: I11104651dc89cade173200076ece221b65b98b6a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159392
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Add named constants for OpenType and TrueType platform IDs and encoding
IDs in core/fxge/fx_font.h. Use these symbols in CFX_Face and
CPDF_TrueTypeFont.

Introduce CharMapIdToFontEncoding() in core/fxge/cfx_face.cpp to map
platform and encoding IDs to fxge::FontEncoding, replacing
ToFontEncoding() and unifying font charmap classification.

Fontations requires this functionality because Skrifa exposes raw
platform and encoding IDs directly from OpenType 'cmap' records without
FreeType's internal translation layer. Unifying charmap classification
under CharMapIdToFontEncoding() allows both backends to share identical
logic and paves the way for Fontations non-Unicode SFNT charmap support.

-- Rename CharMapID to CharMapIdPair - since it is a pair.
-- use uint16_t members to match FT value size.
-- use designated initializers to avoid accidental swapping of IDs.
-- Deprecate use of FT_ENCODING_OLD_LATIN_2 per freetype header.

Bug: 42271123
Change-Id: Ia6c0e32b4c55077ec7ca633312d13f578b3e18eb
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159350
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Change-Id: Ic040658c96e46e30e96521e488b2d806bf37ff13
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159370
Auto-Submit: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
When rendering or loading glyph paths for built-in generic substitute
fonts (FoxitSansMM and FoxitSerifMM), adjust horizontal scaling by
dest_width / EmAdjust(outline.advance_width) if dest_width is set.
Also return dest_width in CFX_Face::GetGlyphWidth() for built-in generic
fonts when dest_width > 0. This matches substituted glyph widths to PDF
/Widths dictionaries without using FreeType's Multiple-Master API.

Bug: 42271123
Change-Id: I62d90493e12675cae461f2e99f0df8230ed4993a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159290
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libc.git/+log/320824188c37..14e51fd2cd7e

Created with:
  roll-dep third_party/llvm-libc/src

Change-Id: I6643e2fb3ba5d620bb524445771d90f3752a97e6
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159470
Commit-Queue: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git/+log/45120ee23311..eb1ca4993b53

Created with:
  roll-dep third_party/libunwind/src

Change-Id: Id3f17835d1f9489437aa966c769d62556b1935ce
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159412
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/chromium/src/testing/scripts/rust.git/+log/ead1c91bc31e..9c16e2f4c17e

Created with:
  roll-dep testing/scripts/rust

Change-Id: I626bab33f65845a2331da841a6e98081e190232a
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159371
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/chromium/src/tools/win.git/+log/13cb6e5d223d..ae34cdd9867c

Created with:
  roll-dep tools/win

Change-Id: Iab867e88fdaf1e4a27211ffcef8fa3a8ddfeb064
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159450
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/chromium/src/third_party/rust/+log/4dec6f65bcb3..b8c38a533c84

Created with:
  roll-dep third_party/rust

Change-Id: I7d458102151436fd27fa7666538ce54467edf5d4
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159452
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/chromium/src/buildtools.git/+log/6f6a5dbf04b7..64e87f9fbdaf

Created with:
  roll-dep buildtools

Change-Id: Icbd902c1560d0d6752751c05ea2f81101d67d4c8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159393
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
llvmorg-24-init-3796-g20e97c4b-4:llvmorg-24-init-7747-g62397f8b-57

https://chromium.googlesource.com/chromium/src/tools/clang/+log/450d823868ea..52b22f34fa14

Created with:
  roll-dep tools/clang

Change-Id: I7a6c8a039ce0c0795b6c7f1faf1dbab9856225bd
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159490
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git/+log/70510081984c..9f796802e5d6

Created with:
  roll-dep third_party/clang-format/script

Change-Id: I8a2a719bd0f562a126987764c18c6f34ee55948c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159411
Auto-Submit: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Change-Id: Ie2e4f2995f3bb24839bf1411947445ade9579775
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159410
Auto-Submit: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Change-Id: I7a65e74ee8572cf3cf8dd659daf492527068db58
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159390
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/external/github.com/fastfloat/fast_float.git/+log/34164f547b7d..b0ab987b3dfd

Created with:
  roll-dep third_party/fast_float/src

Change-Id: I7e835aacfadbc0008123637e4535e0a89297f07c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159391
Auto-Submit: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/chromium/deps/icu.git/+log/8cc91d9b6ab9..5aa526207171

Created with:
  roll-dep third_party/icu

Change-Id: Ia6292fea7453c157024fb93ad002488e6279e1bb
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159430
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
… rolls)

https://skia.googlesource.com/skia.git/+log/5549c93c9a1c..5b1a7f7c0644

Created with:
  roll-dep third_party/skia

Change-Id: I73e56b18a098af0fbe71349e268ff1f5f2084a55
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159550
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git/+log/886fc1e64538..ff36703b9501

Created with:
  roll-dep third_party/harfbuzz/src

Change-Id: I64cccba6cf41995941a56999125dc48efbdef68e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159532
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
https://chromium.googlesource.com/v8/v8.git/+log/df65d5c8f293..e110f6a9dff3

Version 15.5.19

Created with:
  roll-dep v8

Change-Id: Ic479da3dff7dfe69e84fda3ff468f07534df9511
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159533
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Roll clang+rust llvmorg-24-init-3796-g20e97c4b-4:llvmorg-24-init-7747-g62397f8b-57

Roll build/ 2cd94c0ab..ebdaeefa6 (166 commits)

https://chromium.googlesource.com/chromium/src/build.git/+log/2cd94c0abead..ebdaeefa62db

Created with:
  roll-dep build

Roll tools/rust/ 54d114869..e61a63fae (22 commits)

https://chromium.googlesource.com/chromium/src/tools/rust/+log/54d1148695db..e61a63fae238

Created with:
  roll-dep tools/rust

Change-Id: I92c4d66c7081865df63f5f5e5fdb4b29088a587c
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159510
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git/+log/435e7d977fb3..a00d74bb55b3

Created with:
  roll-dep third_party/abseil-cpp

Change-Id: I00ec81b79e7665fb5e95b495b79c7678a4253277
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159530
Auto-Submit: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
…mits)

https://chromium.googlesource.com/chromium/src/base/allocator/partition_allocator.git/+log/89615a645f02..dc6144ac93b2

Created with:
  roll-dep base/allocator/partition_allocator

Change-Id: Ibfdba6ca2e64397bfcaacaf279b3c559ddb90cba
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159531
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
TranslateScanline24bppDefaultDecode() walked both the source and the
destination scanline with raw pointers, each of its three arms inside
UNSAFE_TODO().

The 8 bpc arm is a per-pixel RGB-to-BGR byte swap, which is exactly what
fxcodec::ReverseRGB() does on spans, and its disjoint-copy loop is
written so the compiler vectorizes it; call that instead. The
destination scanline buffer never overlaps the decoder's source
scanline, and ReverseRGB() falls back to an in-place swap if the two are
ever the same buffer.

The other two arms now write through a destination pixel-struct span.
The 16 bpc arm reads its source through a struct that names the
big-endian sample layout, so keeping each component's high byte no
longer looks like an unexplained stride-6 index. The sub-8 bpc arm
already read its components out of the bit stream through a span; only
its stores needed converting.

Bug: 553155247
Change-Id: I55048b4a84179bd7f7a58802126788aa391d5ca1
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/155971
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
ContinueStretchHorz()'s kManyBpptoManyBpp arm unrolls its one- and
two-tap cases, since at those trip counts the loop is all overhead. The
kManyBpptoManyBppWithAlpha arm computes the same thing, differing only
in the per-tap alpha premultiply and in writing a fourth channel, but
still runs the generic loop for every destination column.

Give it the same treatment. The terms are summed in tap order, so the
result is identical, and columns with three or more taps keep the
existing loop.

Bug: 553937496
Change-Id: Ib9206eb8b4a56d4fe2bfd18843e4ebe725618f61
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/156110
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Replace the separate value members in CJS_DelayData with a single
std::variant member `data`, since each CJS_DelayData instance only
stores one property value. Also remove the unused `widestring` and
`color` fields.

Update CJS_Field::DoDelay() and the CJS_Field::AddDelay_*() methods in
fxjs/cjs_field.cpp to read and write `CJS_DelayData::data`.

TAG=agy
CONV=d7374919-0adf-44a3-8c57-4bc07cdb5cea

Change-Id: I0e2cddfd1e0af2afe24d8c73207c14446a4606d7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159690
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Add FFI methods to SkrifaFont to query SFNT charmap encoding records
(platform ID and encoding ID) and map character codes to glyph IDs
using subtable-specific lookups. Update CFX_Face charmap enumeration,
selection, and character-to-glyph mapping to use these methods under
Fontations.

Bug: 42271123
Change-Id: I75e0eef3a8c50debe7363e5c184e0dac9b64388e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159211
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
…_DIB.

In CPDF_DIB::TranslateScanline24bpp(), stores through dest_scan
(uint8_t) and the virtual call color_space_->GetRGBOrZerosOnError()
may alias any object in memory under C++ strict aliasing rules,
preventing the compiler from hoisting GetWidth() out of the per-pixel
loop and forcing a memory reload on every iteration. Cache GetWidth()
in a local width variable before the loop.

In CPDF_DIB::TranslateScanline24bppDefaultDecode(), load the 16-bpc
src channels into local uint8_t variables before writing to dest
(matching fxcodec::ReverseRGB()), avoiding interleaved loads and
stores when the compiler cannot prove src and dest do not overlap.

Co-authored-by: Richard Winterton <rrwinterton@intel.com>
Change-Id: Ie605d688918b73054c7601a7373e480486859872
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159571
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
V8 added third_party/llvm-libclang in https://crrev.com/c/8219268 for
tools/metagen (https://crrev.com/c/7864481), which was enabled by
default in https://crrev.com/c/8365609.

Change-Id: Ibddd0e7a0ff8b24046fa19fa4ba1e3b7a810be54
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159534
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
https://chromium.googlesource.com/v8/v8.git/+log/e110f6a9dff3..0d546234ecf0

Version 15.7.21

Created with:
  roll-dep v8

Change-Id: I3e3c046748be729561b68dc3405694e84ea021f8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159551
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
tsepez and others added 29 commits October 6, 2026 16:48
Allow pdf_enable_freetype=false when pdf_enable_fontations=true
and pdf_enable_skia=true.

Guard FreeType specific paths across core/fxge, testing environments,
and fpdfsdk behind defined(PDF_ENABLE_FREETYPE).

Populate font_data_ in CFX_Font::LoadFaceFromSpanStream() so that
Skia device drivers can render fonts loaded from span streams instead
of falling back to FT for this one case.

Update Skia + Fontations text rendering test checksums in
cfde_textout_unittest.cpp.

Bug: 42271123
Change-Id: I403fb18c50fc39962843b410ae745856af8dbd96
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159552
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
V8 deprecated FunctionCallbackInfo::Data() and
PropertyCallbackInfo::Data() in favor of DataV2(), which returns
Local<Data>.

This does not change callback behavior.

Bug: 559925519
Change-Id: I0f16a5437d76a4acfe6c71d3dff36ef53cc6de49
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159990
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Deepak Mohan (Robo) <hop2deep@gmail.com>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/b76738eff2f3..891f904e2e7b

Created with:
  roll-dep third_party/freetype/src

Then update test expectations to match the latest FreeType behavior.

See https://pdfium-review.googlesource.com/159770 for corpus test
expectation updates.

Change-Id: Id4538089434ea8f7ee3b3981865b323b566992b2
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159790
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/6f5bcbbad52e..891f904e2e7b

Created with:
  roll-dep third_party/freetype/src

Also skip drawing zero-sized text in CFX_RenderDevice::DrawNormalText(),
as FreeType's FT_Set_Matrix() now rejects zero matrices and falls back
to the identity matrix, which would otherwise cause zero-sized text to
be rendered visibly.

Change-Id: Ibe1857897484916871f06d6c2b931bcb36c6ff89
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159950
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
This is now being DEPS'd into the tree.

Change-Id: I3941eef2036970beaf39ab5f5b30db33c48f1b13
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160130
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Unify macro usage to follow the convention where USE_ is for backend
choices (e.g., Skia) and ENABLE_ is for additive features (e.g., XFA).

- Remove PDF_USE_XFA from public/fpdfview.h as it was redundant
  with PDF_ENABLE_XFA and is unused throughout the chromium codebase.
- Replace PDF_ENABLE_SKIA with PDF_USE_SKIA in the testing directory
  and BUILD.gn, as this was one oddball usage.
- Remove redundant #define block for PDF_USE_SKIA in pdfium_test.cc.
- More accurately name pdfium_test_config.

Change-Id: I1de149cd743bd24b1cb99d493e199524d9655144
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160170
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
This CL implements CalculateSSIM in pixel_diff_util, modifies
image_diff.cpp to output mean_ssim and min_window_ssim, and
updates pngdiffer.py to parse them without taking any new action.

Eventually, these can be used to provide another sanity check
on Fontations/Skia results that would have large MSE issues
otherwise and would have to their diffs ignored for the moment.

A short-circuit is provided in image_diff.cpp to avoid SSIM calculation
if the images are exactly identical.

Change-Id: I40e1e4e9b2cbc3b9f8862fdae5820d846b076e05
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160150
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Simplify PaethPredictor() algebraically (pa = abs(b - c),
pb = abs(a - c), pc = abs((a - c) + (b - c))) and use branchless
conditional selection.

Extend the per-pixel register-carry fast path (previously used only for
3- and 4-byte Sub rows) to Bpp = 1, 2, 3, and 4 across Sub, Average,
and Paeth rows, and reuse PredictSubRow() on the first row of Paeth.
Carrying the running left and upper_left pixel state in local registers
eliminates per-byte store-to-load forwarding stalls on
dest_span[i - bpp], redundant loads of last_span[i - bpp], and per-byte
span bounds checks via fxcrt::Zip().

On a 2048x200 image, PngPredictLine() with Paeth is 3.72x faster for
4-Bpp (5911.4 us -> 1588.9 us) and 2.33x faster for 3-Bpp (5553.3 us ->
2386.0 us), while remaining bit-exact for all filter tags and inputs.

Bug: 549230311
Change-Id: I45ed513938044b868cb7ef526706948501b567ca
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160071
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Note: public_deps should now be used iff a public header includes the
dependency. This is because public_deps no longer exposes headers from
dependencies, so the advice to avoid public_deps is no longer relevant.

This is a part of the LSC https://docs.google.com/document/d/1zYUC_zuFrZozo9ogFHcf0Rzkiw9W7RVnaY-1fzfQ0AM/edit?tab=t.0

Bug: 556959580
Change-Id: Id9954ce4c8685204030e22a7a23891eb6a6a6964
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160112
Auto-Submit: Matt Stark <msta@google.com>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
- In core/fxge, mark code as NOTREACHED() for the case when AGG is
  disabled at build time, yet somehow Skia is not available.
- Compile FPDFViewEmbedderTest.Bug2087 only for builds that have both
  AGG and Skia. Otherwise the test does not make sense to run.

Change-Id: If0f93635ca1a2859db4065e0c3740e4d092ac4d6
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160190
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
FPDF_CountNamedDests() counts every key in the catalog's old-style
/Dests dictionary, and FPDF_GetNamedDest() falls back to that dictionary
for indices past the /Dests name tree. The fallback used the raw
dictionary value, so when the value was an indirect reference, which is
valid PDF, it was neither an array nor a dictionary. FPDF_GetNamedDest()
then returned nullptr without reporting the name, and a document could
report named destinations that it could not return by index.

All other named destination lookups already dereference the value: the
/Dests name tree lookups by name and by index, and the old-style lookup
by name. As a result, FPDF_GetNamedDestByName() found indirect old-style
destinations that FPDF_GetNamedDest() dropped.

Dereference only the value of the matching key, so that the loop does
not parse the objects behind the keys it walks past. Direct values are
unaffected, and a dangling reference resolves to nothing, so
FPDF_GetNamedDest() returns nullptr for it.

Add a named_dests_old_style_indirect.pdf fixture whose old-style /Dests
values are all indirect: a destination array, a destination dictionary
with a /D array, and a dangling reference. The new embedder test checks
that FPDF_GetNamedDest() returns the same destinations as
FPDF_GetNamedDestByName() along with their names, that those
destinations are for the expected pages, and that the dangling entry
gives neither a destination nor a name.

An alternative would be to expose GetNamedDestFromObject() from
cpdf_nametree.cpp through a new CPDF_NameTree static for the old-style
lookup by index. This change keeps the fix local instead.

Found while working on the pdfium-native Node.js binding.

Change-Id: I380f9b07dbe1bbc680e3c5ae4a21f161a1d554fa
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159090
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Avoid hitting a check when initializing a library by providing the
correct default based upon what is linked into the binary.

Do the same for the embedder_test_environment.cc.

-- No need to provide designated-initializer for 0s.

Change-Id: I82745b19cc8c8e7b5b058cd2aee1338be44fb3af
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160131
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
As seen when running buildtools/checkdeps/checkdeps.py.

Change-Id: Icc6fe0267e30706a9f899e181ec70378deddf876
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160132
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Revert a tiny portion of https://pdfium-review.googlesource.com/c/160112
so Chromium can successfully roll PDFium and build the fuzzers.

Bug: 556959580
Change-Id: Ic002f56f0eb5a9fff4d7eebaa2a398fc7d19bde2
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160250
Commit-Queue: Andy Phan <andyphan@chromium.org>
Auto-Submit: Lei Zhang <thestig@chromium.org>
Reviewed-by: Andy Phan <andyphan@chromium.org>
Just use third_party/rust/chromium_crates_io/vendor/cxx-v1/include/cxx.h
directly.

Bug: 396397336
Change-Id: Icbc6afb2ff91d7c46fd54da932afa10ef6c47d0f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159930
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Tests should test one thing. In this case, that the Brotli filter
correctly decodes an image stream using DecodeParms predictor
parameters.

Previously, brotli_decodeparms.in was derived from bug_1015233.in,
a test originally created to demonstrate a tiling pattern bug.
Consequently, it included fractional pattern matrices
([.202488 0 0 -.449947 0 791.999]), subpixel path strokes (0.24 pt),
and pattern tiling.

Those extraneous rendering operations made the test non-portable. AGG
and Skia rasterized the patterns and subpixel strokes differently,
causing 120,196 out of 120,200 image bytes to diverge. That divergence
required separate brotli_decode_parms_agg.png and
brotli_decode_parms_skia.png expectation files.

Simplify brotli_decodeparms.in to render the 4x4 Brotli image directly
to the page without patterns or strokes. The resulting output is
bit-for-bit identical between AGG and Skia, allowing replacement of the
backend-specific PNGs with a single brotli_decode_parms.png and
switching the test to CompareBitmap().

Change-Id: I172f21b04b43494ca3e5d1906ae7a217c6c05a5b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160090
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
First step towards simplifying the number of different forms of
device class constructors. Group knockout is fundamentally a piece
of rendering state - it only matters when blending a new primitive
onto the canvas. Pass as an argument when needed.

Change-Id: I0e187f79d1f975ece739c0ba788c89dc07e04e1d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160290
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Prevents CFX_RenderDevice from being a driver/bitmap factory, and
allow extension for test-only drivers.

-- Add CFX_RenderDevice::CreateWithDriver() static method.
-- Make GetDeviceDriver() public.
-- Rewrite CreateForWindowsDC() using CreateWithDriver().
-- Rewrite CreateForSkiaCanvas() using CreateWithDriver().
-- Remove CFX_RenderDevice::CreateForNewBitmap*()
-- C++23: need complete types for defaulted arguments.
-- Add FakeDeviceDriver for testing.

Change-Id: I4bb2b31519546c92a6bee82ad068ae56717eb5ca
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159910
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
The change at https://pdfium-review.googlesource.com/150952
eliminated two-stage initialization of CFX_RenderDevice and
routed FPDF_FFLDrawSkia() to CFX_RenderDevice::CreateForSkiaCanvas().
Consequently, AttachSkiaImpl() is no longer invoked with a null bitmap
pointer during canvas recording.

Replace the dead null-check in AttachSkiaImpl() with a CHECK(pBitmap),
matching AttachAggImpl(). Remove the now-obsolete comments regarding
null bitmaps in both AttachSkiaImpl() and AttachAggImpl().

Change-Id: Ib213880b0d231b95b0e13758722f1b549581205b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160361
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Stop attempting to scale down CPDF_ScaledRenderBuffer dimensions once
both width and height reach 1. Subsequent scalings cannot reduce the
integer bounds further and cause the loop to spin until floating-point
underflow eventually collapses dimensions to 0.0 exactly. Then,
termination via CFX_DIBitmap::CalculatePitchAndSize() failure is an
incidental quirk of its implementation.

Change-Id: I9676e5ffe57ed3fe1aef6309fd1ee32c8517c320
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160410
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Replace calls to ByteString::Format() that only perform string
substitution with the ByteString constructor taking an initializer
list of ByteStringViews.

Change-Id: I3a21c18693df2cacff37d679061c55cb95d081da
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160310
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Bug: 570068745
Change-Id: I2aed2f81118f78a47f3266d9275d3c80ebdb5a41
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160430
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Introduce DisplayListDeviceDriver, an implementation of
RenderDeviceDriverIface for testing that accumulates semantic drawing
commands directly into a string display list without pixel
rasterization. The intent is to avoid needing platform-specific .png
files when some higher level function is all that is being tested.

Add Render*ToDisplayList methods to EmbedderTest to render pages and
forms to display lists for semantic verification. Add a test in
fpdf_view_embeddertest.cpp verifying output on rectangles.pdf.

-- Add --dump flag to pdfium_test.
-- Retire the fake driver.

Change-Id: Ibc77e853f7fe97bc3d8258f85f11d38144c1869b
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/159394
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
This CL updates library initialisation in fpdf_view.cpp to disable
Brotli when the configuration version is less than 6 or when
m_BrotliEnabled is not set to true by the embedder.

Change-Id: I9ebe03a91d0f8b7d292cc7d44e98de394b9f57bb
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/158910
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Change some signed integer math operations to use FX_SAFE_INT32 and
avoid UB.

Bug: 570876470
Change-Id: I9ecc7b1520420424d2d8f7bb5d62dfb967387c3f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160390
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
GetNormalizedPoints() only drops points that repeat the previous point,
so a rectangle with an extra vertex in the middle of an edge, such as:

  x1 y1 m
  x2 y1 l
  x2 y2 l
  xm y2 l
  x1 y2 l
  h

is not a rectangle to CFX_Path::IsRect() and GetRect(). Some PDF
generators (seen in Amyuni PDF Converter output) clip every image strip
of a rasterized page with such a page-sized rectangle.
CFX_AggDeviceDriver::SetClip_PathFill() then rasterizes a full clip mask
for each strip instead of intersecting a rectangle. A page with 10,000
such clips takes 9.1 s to render at 200 DPI with pdfium_test, and 0.3 s
with this change.

Also skip a line point that lies strictly between the previous point
and the next point on a horizontal or vertical line. Removing it does
not change the shape of the path, for either fill rule. The "re" writers
already handle such rectangles since
https://pdfium-review.googlesource.com/160011.

Filled rectangles with such points now take the FillRect() fast path in
CFX_RenderDevice::DrawPathWithBlend(), just like the same rectangles
written without the extra points. This changes the rendering of the tiny
rectangles in the 1751_1 corpus test, so also roll DEPS to pick up the
new corpus test expectations in
https://pdfium-review.googlesource.com/c/pdfium_tests/+/160230 and
https://pdfium-review.googlesource.com/c/pdfium_tests/+/160270.

Bug: 570363704
Change-Id: I7d0c57c8137331bd1fc4068bfe215e557622012d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160010
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Ensure the rectangle coordinates of page objects are finite before
processing them, avoiding potential issues when clamping and converting
non-finite float values to integers. Also reuse the retrieved rectangle
to avoid redundant calls to GetRect().

Fixes UBSan `float-cast-overflow` bug:

```
CRASH LOG: SUMMARY: UndefinedBehaviorSanitizer: float-cast-overflow
third_party/pdfium/HEAD/core/fpdftext/cpdf_textpage.cpp:674:9 (REDACTED)
```

PiperOrigin-RevId: 995805511
Change-Id: I1bff4d6a9019bcd337d3707616b1efb6dc893292
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/160330
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
The linuxmusl-arm64 target was failing because libyuv arm64 sources require dot-product, SVE2, and SME instructions that the musl GCC toolchain rejects. This disables libyuv for that target by setting pdf_use_libyuv=false in build-target.sh and documents the reason in the sync notes alongside the related build findings.
@bobsingor
bobsingor merged commit 7ac3db8 into embedpdf/main Oct 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.