Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
23dc93d
Update siso_version to efbbe7f1892211b5e9512576843a3c247b6a6d7c
Sep 1, 2026
32b941f
Update android_ndk_version to 2@30.0.16138531
Sep 1, 2026
92afb56
Support windowed MSE and custom parameters in image differ
tsepez Sep 1, 2026
a4f9c3c
Introduce DiffOptions aggregate struct for pixel comparisons
tsepez Sep 2, 2026
d2a51d2
Consolidate pixel comparison loop into CalculatePixelsDifferent
tsepez Sep 2, 2026
addccaa
Add windowed MSE verification to EmbedderTest
tsepez Sep 2, 2026
047ef29
Bound the run length in FaxGet1DLine()
leizleiz Sep 2, 2026
a75db0d
Enable large window mode for Brotli decoding
LearnPRG-py Sep 2, 2026
a4a480f
Decouple Fontations from Skia to support standalone AGG builds
tsepez Sep 2, 2026
5f5ad2c
Roll back blanket fuzziness in light of better image comparison tools
tsepez Sep 2, 2026
91d9efc
Fix typo that prevented LargeImageDoesNotRenderBlank from being disabled
tsepez Sep 3, 2026
d6ac256
Bound run lengths in FaxG4GetRow()
leizleiz Sep 3, 2026
764f7f9
Return std::optional<uint16_t> from FaxGetRun()
leizleiz Sep 3, 2026
f03fe61
Rename Format::kRgb to Format::kBgr in progressive decoder
tsepez Sep 3, 2026
c60c84f
Fix leap year calculation in fx_date_helpers
Sep 3, 2026
b39aa63
Fix weekday formatting in CJS_Util::printd()
Sep 3, 2026
017295a
Implement 50-year pivot for two-digit year parsing
Sep 3, 2026
8794e9c
Clamp transfer function sample values to [0, 255]
Sep 3, 2026
2621636
Fix reversed channel order when loading transfer function array
Sep 3, 2026
a043bed
Replace Skia JPEG decoder with direct Rust FFI (zune-jpeg)
tsepez Sep 4, 2026
871067e
Speed up PngPredictLine: hoist row boundaries, carry Sub in registers
jerbob92 Sep 4, 2026
272ef36
Refactor FX_ParseDateUsingFormat() (1/2)
Sep 4, 2026
a491436
Refactor FX_ParseDateUsingFormat() (2/2)
Sep 4, 2026
d13ede8
Remove one duplicated jbig2 huffman code reading loop
nico Sep 5, 2026
f91ca5a
Roll Zlib from c5cc9edf8992 to 285e94b8fa95 (4 revisions)
Sep 7, 2026
4a36628
Ignore re-entrant form calls during passive FFI callbacks
tsepez Sep 8, 2026
a0a39c3
Remove PDF_ENABLE_SKIA_TYPEFACE_CHECKS and dead parity assertions
tsepez Sep 8, 2026
cae4b1b
Copy MCC record count in OpenJPEG tile setup
tsepez Sep 8, 2026
2329b18
Revert "Remove PDF_ENABLE_SKIA_TYPEFACE_CHECKS and dead parity assert…
tsepez Sep 8, 2026
0edc2c5
Improve error handling in libjpeg encoding
tsepez Sep 8, 2026
91f5419
Reject unsupported component counts in JPEG progressive decoder
tsepez Sep 8, 2026
482ed62
Add FPDFPageObj_GetRenderedStrokePattern() API
Sep 8, 2026
af688e0
Rename confusing bSkipImageTypeCheck argument.
tsepez Sep 9, 2026
742b9d0
Move Flate predictor functions to standalone files
LearnPRG-py Sep 9, 2026
435dbc5
Remove another duplicated jbig2 huffman code reading loop
nico Sep 9, 2026
99cdcff
Avoid compiling libjpeg when pdf_enable_rust_jpeg is true
tsepez Sep 9, 2026
9ce259a
Rename SBHUFFRDX to SBHUFFRDXRDY
nico Sep 9, 2026
d00fbeb
Several minor huffman-related cleanups
nico Sep 9, 2026
0615b15
Extract and validate decode parameters using a helper function
LearnPRG-py Sep 9, 2026
f0118f1
Add tests for Brotli /DecodeParms
LearnPRG-py Sep 9, 2026
32d5e1d
Decode 3-component JPEGs straight to BGR when the DIB wants BGR
jerbob92 Sep 9, 2026
dbe0a5f
Extend the JPEG BGR decode to ICCBased color spaces with sRGB profiles
jerbob92 Sep 9, 2026
b080021
Extract a CeilLog2() helper, use it in jbig2 code
nico Sep 9, 2026
f67ab27
Remove Skia typeface checks in CFX_Face while keeping Fontations
tsepez Sep 9, 2026
9af929a
Move default global object template into CFXJS_PerIsolateData
tsepez Sep 10, 2026
937a50f
Use readNBits to read N bits in CJBig2_SDDProc::DecodeHuffman
nico Sep 10, 2026
6ef0085
Add test cases for 12-hour time parsing in FX_ParseDateUsingFormat()
Sep 10, 2026
551d27e
Fix 12-hour time parsing in FX_ParseDateUsingFormat()
Sep 10, 2026
b2dd3c4
Fix strict deps violation for pdfium.
matts1 Sep 10, 2026
4902697
Add m_IsolatePerDocument to FPDF_LIBRARY_CONFIG for version 7
tsepez Sep 10, 2026
96fade8
Use CFX_Point in CFX_GlyphBitmap
leizleiz Sep 11, 2026
9026141
Move engine refcount from global state into CFXJS_PerIsolateData
tsepez Sep 11, 2026
83cc016
Better document FPDF_GetMetaText() behavior
leizleiz Sep 11, 2026
25a20ec
Consolidate predictor switching into image_predictors
LearnPRG-py Sep 11, 2026
44742cb
Make FXJS object definition IDs constexpr constants.
tsepez Sep 11, 2026
eca6654
Provide shared CFX_V8ArrayBufferAllocator instance
tsepez Sep 11, 2026
a5a7089
Add unit test for CFX_PSRenderer::SetClip_PathFill()
leizleiz Sep 11, 2026
2e017ed
Fix clip box calculation in CFX_PSRenderer::SetClip_PathFill()
leizleiz Sep 11, 2026
7720c8b
Convert much of CFXJS_Engine to use google_style local names
tsepez Sep 11, 2026
a32bca6
Demonstrate CPVT_Section line breaking bug with prefix currency symbols
leizleiz Sep 12, 2026
e30162a
Fix punctuation check in CPVT_Section
leizleiz Sep 12, 2026
88c6035
Add FXGC_Heap wrapper and CppHeap support for per-document heap
tsepez Sep 12, 2026
93466ec
Add FPDFAttachment_GetAFRelationship() API
RMainzer7 Sep 12, 2026
6c8196a
Make later ToUnicode mappings supersede earlier ones
jerbob92 Sep 12, 2026
8943614
Roll Instrumented Libraries from d15c278eed5d to 51898bc68243 (1 revi…
Sep 14, 2026
379fa92
Roll libpng from 6d5341764ef4 to 0179a807421c (1 revision)
Sep 14, 2026
506c994
Revert "Roll Instrumented Libraries from d15c278eed5d to 51898bc68243…
LearnPRG-py Sep 14, 2026
5266b2b
Roll Depot Tools from 732902ab86f8 to 36a8df4ad006 (122 revisions)
Sep 14, 2026
c707159
Roll Memory Tools from 8d3182bb3c86 to 0732f7097d06 (2 revisions)
Sep 14, 2026
96d91c2
Ignore control characters typed with unhandled modifier chords
clicelee Sep 14, 2026
5fcdcb8
Fix dangling span in ~RustJpegScanlineDecoder()
tsepez Sep 14, 2026
72fca01
Fix BrotliDecode buffer expansion check
LearnPRG-py Sep 14, 2026
5f6ecb0
Reduce JBIG2 Huffman reading work per bit from O(n) to O(1)
nico Sep 15, 2026
9bd9ac2
Plumb FXGC_Heap through XFA in place of cppgc::Heap
tsepez Sep 15, 2026
c929c94
Support DecodeParams in BrotliDecoder
LearnPRG-py Sep 15, 2026
9270224
[sbom-quality] Switch to abs file paths for License File paths
anneredulla Sep 15, 2026
f8ad3e8
Revert "Fix clip box calculation in CFX_PSRenderer::SetClip_PathFill()"
leizleiz Sep 15, 2026
5fe6c25
Update BrotliDecoder::Decode() to return FX_INVALID_OFFSET on failure
LearnPRG-py Sep 15, 2026
7a19043
Remove usage of checkout_wpr_archives gclient var
Sep 15, 2026
f3635dd
Fix O(n^2) behavior when decoding G4 fax data
nico Sep 15, 2026
bc80bbd
Increase jbig2 limits and roll jbig2 testing corpus
nico Sep 15, 2026
ac60fa3
Move core/fpdfapi/edit/cpdf_contentstream_write_utils.cpp to fxcrt.
tsepez Sep 15, 2026
8dff61f
Remove unused variable in pdfium_test.cc
nico Sep 15, 2026
862f692
Add font engine and action columns to the suppression files
tsepez Sep 15, 2026
4ef1e1b
Use a standalone cppgc heap for the XFA fuzzer process state
tsepez Sep 15, 2026
ecbfc06
Consolidate the three suppression files into one
tsepez Sep 15, 2026
3f86f87
Expand 1bpp rows to bytes before stretching them horizontally
nico Sep 15, 2026
fa2e5fc
Process 4 bytes at once in the fax codec's FindBit() routine
nico Sep 16, 2026
3bd3091
In fax decoder, replace kOneLeadPos with countl_zero
nico Sep 16, 2026
13817c3
Add operator<< for FX_RECT in fx_coordinates_test_support.h
leizleiz Sep 16, 2026
a0ad2ce
Remove redundant size check in FindBit() in faxmodule.cpp
leizleiz Sep 16, 2026
6da3530
Add unit tests for PostScript EMF DC clip box clamping
leizleiz Sep 16, 2026
80bccb8
Add FPDFTextEmbedderTest.Arabic regression test
leizleiz Sep 17, 2026
644461c
Convert named action test to embedder test
tsepez Sep 17, 2026
39f22bc
Update license field in third_party/llvm-libc/README.pdfium
leizleiz Sep 17, 2026
3e9b2c2
Add FPDFPageObj_GetRenderedFillPattern() API
Sep 17, 2026
17cf94b
Revert "Fix mixed-direction line extraction"
leizleiz Sep 17, 2026
67e8995
Add some JavaScript tests for textboxes
leizleiz Sep 17, 2026
48af8b6
Fix JS triggered on load bypassing user gesture requirement
leizleiz Sep 18, 2026
3dd328a
Delete duplicate test expectations in testing/resources
leizleiz Sep 18, 2026
221fc40
Look up the JS runtime in CFXJSE_Engine rather than caching it
tsepez Sep 18, 2026
fc46361
Remove core/fxge dependency from core/fxcrt/css
tsepez Sep 18, 2026
bb1f9f7
Remove stale suppressions format_custom_format.pdf
tsepez Sep 18, 2026
b79f4d5
Add --metrics mode to pdfium_diff and shadow-validate in pngdiffer
tsepez Sep 18, 2026
1d3371a
Remove the pdfium_diff --metrics parity check
tsepez Sep 18, 2026
a5e00c6
Remove the pdfium_diff --fuzzy option and its tolerance parameters
tsepez Sep 18, 2026
d793a0d
Create a per-document v8::Isolate for XFA documents
tsepez Sep 18, 2026
1442e4f
Add disabled embeddertests for form fill environment lifecycle crashes
tsepez Sep 18, 2026
3f30d5d
Enable isolate-per-document mode in pdfium_test when XFA is enabled
tsepez Sep 19, 2026
4a9b3d6
Run XFA embedder tests in isolate-per-document mode
tsepez Sep 19, 2026
b60996c
Roll Instrumented Libraries from d15c278eed5d to 423262e4438b (2 revi…
Sep 21, 2026
c2dfc74
Roll goldctl from c7c91b4c709a to 63df9e9df52e
Sep 21, 2026
c109201
Improve test runner suppression handling and failure reporting
tsepez Sep 22, 2026
43b6ec2
Remove stale mac_x86 Skia diff suppressions
tsepez Sep 22, 2026
e66f900
Narrow GDI diff suppressions to gdi_skia for surprise passes
tsepez Sep 22, 2026
716607c
Add find_performance_steps.py to detect CI performance step functions
tsepez Sep 22, 2026
da9d8c4
Fix form fill environment lifecycle crashes in XFA
tsepez Sep 22, 2026
f36ba93
Add and use fxcrt::CeilDiv()
nico Sep 22, 2026
554fa44
Premultiply alpha when comparing BGRA bitmaps in EmbedderTest
tsepez Sep 22, 2026
7dfadb9
Add Fontations glyph rendering pipeline using Skrifa hinted outlines
tsepez Sep 22, 2026
db6d975
Add fallback for fonts without SkTypeface in CFX_SkiaDeviceDriver
tsepez Sep 23, 2026
2409128
Implement stateless outline rasterization in CFX_Face::RenderGlyph
tsepez Sep 23, 2026
981ffcd
Turn on normal font hinting in Skia
leizleiz Sep 24, 2026
58d357a
Further improve RTL /ActualText handling in CPDF_TextPage
leizleiz Sep 24, 2026
40ecb4f
Add static CFX_GEModule::IsFontations() and IsSkiaRenderer() helpers
tsepez Sep 25, 2026
7a8bed4
Update test expectations for Intel Macs with macOS 15
leizleiz Sep 25, 2026
926f032
Fix a typo in fx_coordinates.h
leizleiz Sep 25, 2026
124abbc
Add Skrifa support for Type 1 fonts in CFX_Face
tsepez Sep 25, 2026
41d4b34
Add LCD padding and 5-tap filter to stateless CFX_Face::RenderGlyph()
tsepez Sep 25, 2026
be5ba31
Add a GetCachedTTCFace() test case with a large TTC size
leizleiz Sep 26, 2026
1ab0e0f
Fix uninitialized memory read in GetChecksumFromTT()
leizleiz Sep 26, 2026
8ca5b73
Rank matching fuzzy suppressions by predicate specificity
tsepez Sep 26, 2026
5c4d9e7
Roll Code Coverage from e1878fbb1ff7 to a81032f8d6f5 (5 revisions)
Sep 28, 2026
db1b784
Roll Catapult from 50c971fc0958 to 7cce2c2359d9 (12 revisions)
Sep 28, 2026
232c797
Revert "Roll Catapult from 50c971fc0958 to 7cce2c2359d9 (12 revisions)"
LearnPRG-py Sep 28, 2026
cce5c5e
Construct array at once in CJS_Global::EnumProperties
tsepez Sep 28, 2026
8e99133
fxcrt: fix building against system dragonbox in stream_write_utils
Sep 28, 2026
aa6cc57
Update LCD glyph width expectation in TestType1Face
tsepez Sep 28, 2026
05ea56c
Remove FreeType dependency from fx_skrifa_unittest.cpp
tsepez Sep 28, 2026
425098b
[vpython] Migrate .vpython3 to vpython.toml
AlexOvsienko Sep 29, 2026
33395f5
Add Fontations branches to four CFX_Face metadata getters
tsepez Sep 29, 2026
18e2d35
Add Fontations branch in CFX_Face::GetCharBBox()
tsepez Sep 29, 2026
e0f8a16
Add unsafe_buffers_paths.txt to inputs=[] for pdfium_public_config
tsepez Sep 29, 2026
9108f05
Remove npm@ from OWNERS and assign TODOs to bugs
npm1 Sep 29, 2026
bcaca53
Update OWNERS files for Freetype and Skia
leizleiz Sep 29, 2026
8a39943
Implement CFX_Face::GetSfntTable() via Skrifa
tsepez Sep 29, 2026
772643d
Enable Brotli support by default in pdfium_test
LearnPRG-py Sep 30, 2026
18a18ed
Use pdfium::saturated_cast<int> in UniqueKeyGen.
a-googler Sep 30, 2026
4150fb5
Avoid const_cast when repairing malformed JPEG input data
tsepez Sep 30, 2026
f90e92e
Add fxcrt::ToDataVector() helper and adopt it across codebase
tsepez Sep 30, 2026
9c3e35f
Add FPDF_StructElement_GetRawType() API
LearnPRG-py Sep 30, 2026
3610fd2
Add fxcrt::ToVector<>() helper and adopt across codebase
tsepez Oct 1, 2026
994c2b1
Adopt ToDataVector<>() in CPDF_ObjectStream tests.
tsepez Oct 1, 2026
3c9748b
Use copy-on-write instead of const_cast in RustJpegScanlineDecoder
tsepez Oct 1, 2026
c41fec2
Merge commit '3c9748bd6' into embedpdf/sync/3c9748bd6
bobsingor Oct 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/workflows/release-libpdfium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ jobs:
throw "rc.exe not found in $rcPath"
}
$rcPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# build/ pins a Windows SDK the runner may not have; build with the
# newest one it does have (patches/embedpdf-runtime/win/build.patch).
"EMBEDPDF_WIN_SDK_VERSION=$($sdk.Name)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Build target
shell: bash
run: scripts/embedpdf-runtime/build-target.sh "${{ matrix.target }}"
Expand Down
53 changes: 0 additions & 53 deletions .vpython3

This file was deleted.

2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Huy Ngo <huyna89@gmail.com>
Ivan Odulo <ivanodulo@gmail.com>
Jeroen Bobbeldijk <jerbob92@gmail.com>
Jiang Jiang <jiangj@opera.com>
Jimin Lee <cliceleee@gmail.com>
Justin Pierce <brkfstmnchr@gmail.com>
Ke Liu <stackexploit@gmail.com>
Luật Nguyễn <manhluat93.php@gmail.com>
Expand All @@ -55,6 +56,7 @@ Tyler Denniston <denniston.t@gmail.com>
Wang Chuan <jdyaomo@gmail.com>
Wang Qing <wangqing-hf@loongson.cn>
Wang Yongjie <tycket033@gmail.com>
Xonaman <xonaman738@gmail.com>
Zhuo Qingliang <zhuo.dev@gmail.com>
# END individuals section.

Expand Down
9 changes: 3 additions & 6 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ config("pdfium_common_config") {
cflags_cc = []
ldflags = []
include_dirs = [ "." ]
inputs = [ "unsafe_buffers_paths.txt" ]
defines = []

if (!use_system_libopenjpeg2) {
Expand All @@ -39,19 +40,15 @@ config("pdfium_common_config") {
defines += [ "PDF_ENABLE_CLICK_LOGGING" ]
}

if (pdf_use_skia && pdf_enable_fontations) {
if (pdf_enable_fontations) {
defines += [ "PDF_ENABLE_FONTATIONS" ]
}

if (pdf_use_skia && pdf_enable_skia_typeface_checks) {
defines += [ "PDF_ENABLE_SKIA_TYPEFACE_CHECKS" ]
}

if (pdf_enable_rust_bmp) {
defines += [ "PDF_ENABLE_RUST_BMP" ]
}

if (pdf_use_skia && pdf_enable_rust_jpeg) {
if (pdf_enable_rust_jpeg) {
defines += [ "PDF_ENABLE_RUST_JPEG" ]
}

Expand Down
26 changes: 14 additions & 12 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling android_ndk
# and whatever else without interference from each other.
'android_ndk_version': Str('2@30.0.15729638'),
'android_ndk_version': Str('2@30.0.16138531'),
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling brotli
# and whatever else without interference from each other.
Expand Down Expand Up @@ -118,7 +118,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling code_coverage
# and whatever else without interference from each other.
'code_coverage_revision': 'e1878fbb1ff79de75d54b6b57caa19a92b90079b',
'code_coverage_revision': 'a81032f8d6f57774af865e502c5661cf24780ca2',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling cpu_features
# and whatever else without interference from each other.
Expand All @@ -130,7 +130,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling depot_tools
# and whatever else without interference from each other.
'depot_tools_revision': '732902ab86f8bd629bee00af102d5aa2d9336166',
'depot_tools_revision': '36a8df4ad006eaa0572fb446edb8145fe5403592',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling dragonbox
# and whatever else without interference from each other.
Expand All @@ -154,7 +154,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling goldctl CIPD package version
# and whatever else without interference from each other.
'goldctl_version': 'git_revision:9379dad302e027bb42a09c353bfbac0166c8c845',
'goldctl_version': 'git_revision:63df9e9df52e8edfd3cd86b642ba79f440e96ecd',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling gtest
# and whatever else without interference from each other.
Expand All @@ -174,7 +174,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling instrumented_lib
# and whatever else without interference from each other.
'instrumented_lib_revision': 'd15c278eed5d38d9acf2d8054cf37baba93cef8e',
'instrumented_lib_revision': '423262e4438b032c0ba5ea61f78a85ac3690298c',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling jinja2
# and whatever else without interference from each other.
Expand All @@ -196,7 +196,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling libpng
# and whatever else without interference from each other.
'libpng_revision': '6d5341764ef4e38cbc07d35514a8aa73de50de8a',
'libpng_revision': '0179a807421cf96731cdfa10008bba04fda243c1',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling libunwind
# and whatever else without interference from each other.
Expand Down Expand Up @@ -224,7 +224,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling pdfium_tests
# and whatever else without interference from each other.
'pdfium_tests_revision': 'd4ec3e1987a094b1eae612943b57782d3b0038ff',
'pdfium_tests_revision': '6a4136071608f159f45e274fed1b7d5f4272ca8f',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling result_adapter_revision
# and whatever else without interference from each other.
Expand All @@ -240,7 +240,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling siso
# and whatever else without interference from each other.
'siso_version': 'git_revision:bc45e8f67ae0f37d337190ad64aa8bb440c791eb',
'siso_version': 'git_revision:efbbe7f1892211b5e9512576843a3c247b6a6d7c',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling skia
# and whatever else without interference from each other.
Expand All @@ -256,7 +256,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling tools_memory
# and whatever else without interference from each other.
'tools_memory_revision': '8d3182bb3c86948e9e27fbfe11d2134c7e29c898',
'tools_memory_revision': '0732f7097d066a81e673f90862994f76886fc638',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling tools_rust
# and whatever else without interference from each other.
Expand All @@ -272,7 +272,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling zlib
# and whatever else without interference from each other.
'zlib_revision': 'c5cc9edf8992ff36dfca3c2c4f6c8327a66b6782',
'zlib_revision': '285e94b8fa95ad3b7d16b80798ec8dce6febb8c8',
}

# Only these hosts are allowed for dependencies in this DEPS file.
Expand Down Expand Up @@ -361,11 +361,13 @@ deps = {
'third_party/android_toolchain/ndk': {
'packages': [
{
'package': 'chromium/third_party/android_toolchain/android_toolchain',
'package': 'chromium/third_party/android_toolchain/android_toolchain/${{platform}}',
'version': 'version:' + Var('android_ndk_version'),
},
],
'condition': 'checkout_android_native_support',
'condition': 'checkout_android_native_support and '
'((host_os == "linux" and host_cpu == "x64") or '
'(host_os == "mac" and host_cpu == "arm64"))',
'dep_type': 'cipd',
},

Expand Down
1 change: 0 additions & 1 deletion OWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
npm@chromium.org
thestig@chromium.org
tsepez@chromium.org

Expand Down
5 changes: 5 additions & 0 deletions build_overrides/build.gni
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ asan_suppressions_file = "//build/sanitizers/asan_suppressions.cc"
lsan_suppressions_file = "//build/sanitizers/lsan_suppressions.cc"
tsan_suppressions_file = "//build/sanitizers/tsan_suppressions.cc"

vpython_spec_files = [
"//vpython.toml",
"//vpython.toml.uv.lock",
]

declare_args() {
# Android 32-bit non-component, non-clang builds cannot have symbol_level=2
# due to 4GiB file size limit, see https://crbug.com/648948.
Expand Down
19 changes: 1 addition & 18 deletions core/fpdfapi/edit/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ source_set("edit") {
"../../../:pdfium_noshorten_config",
]
deps = [
":contentstream_write_utils",
"../../../constants",
"../../fxcrt",
"../font",
Expand All @@ -67,24 +66,8 @@ source_set("edit") {
visibility = [ "../../../*" ]
}

source_set("contentstream_write_utils") {
sources = [
"cpdf_contentstream_write_utils.cpp",
"cpdf_contentstream_write_utils.h",
]
configs += [
"../../../:pdfium_strict_config",
"../../../:pdfium_noshorten_config",
]
deps = [
"../../fxcrt",
"//third_party/dragonbox",
]
}

pdfium_unittest_source_set("unittests") {
sources = [
"cpdf_contentstream_write_utils_unittest.cpp",
"cpdf_creator_unittest.cpp",
"cpdf_npagetooneexporter_unittest.cpp",
"cpdf_pagecontentgenerator_unittest.cpp",
Expand All @@ -95,8 +78,8 @@ pdfium_unittest_source_set("unittests") {
"cpdf_tounicodecmap_unittest.cpp",
]
deps = [
":contentstream_write_utils",
":edit",
"../../fxcrt",
"../../fxge",
"../font",
"../page",
Expand Down
5 changes: 0 additions & 5 deletions core/fpdfapi/edit/DEPS

This file was deleted.

2 changes: 1 addition & 1 deletion core/fpdfapi/edit/cpdf_npagetooneexporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <utility>

#include "constants/page_object.h"
#include "core/fpdfapi/edit/cpdf_contentstream_write_utils.h"
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
Expand All @@ -27,6 +26,7 @@
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/fx_string_wrappers.h"
#include "core/fxcrt/span.h"
#include "core/fxcrt/stream_write_utils.h"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion core/fpdfapi/edit/cpdf_pagecontentgenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <vector>

#include "constants/page_object.h"
#include "core/fpdfapi/edit/cpdf_contentstream_write_utils.h"
#include "core/fpdfapi/edit/cpdf_pagecontentmanager.h"
#include "core/fpdfapi/edit/cpdf_resourceuse.h"
#include "core/fpdfapi/edit/cpdf_stringarchivestream.h"
Expand Down Expand Up @@ -57,6 +56,7 @@
#include "core/fxcrt/notreached.h"
#include "core/fxcrt/numerics/safe_conversions.h"
#include "core/fxcrt/span.h"
#include "core/fxcrt/stream_write_utils.h"
#include "core/fxcrt/zip.h"
#include "core/fxge/cfx_graphstate.h"

Expand Down
2 changes: 1 addition & 1 deletion core/fpdfapi/edit/cpdf_text_redactor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <vector>
#include <algorithm>

#include "core/fpdfapi/edit/cpdf_contentstream_write_utils.h"
#include "core/fxcrt/stream_write_utils.h"
#include "core/fpdfapi/edit/cpdf_image_redactor.h"
#include "core/fpdfapi/edit/cpdf_path_redactor.h"
#include "core/fpdfapi/edit/cpdf_pagecontentgenerator.h"
Expand Down
3 changes: 2 additions & 1 deletion core/fpdfapi/font/cpdf_cmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "core/fpdfapi/font/cpdf_fontglobals.h"
#include "core/fpdfapi/parser/cpdf_simple_parser.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/fx_ceil_div.h"
#include "core/fxcrt/notreached.h"

namespace {
Expand Down Expand Up @@ -421,7 +422,7 @@ size_t CPDF_CMap::CountChar(ByteStringView pString) const {
case OneByte:
return pString.GetLength();
case TwoBytes:
return (pString.GetLength() + 1) / 2;
return fxcrt::CeilDiv(pString.GetLength(), 2);
case MixedTwoBytes: {
size_t count = 0;
for (size_t i = 0; i < pString.GetLength(); i++) {
Expand Down
37 changes: 28 additions & 9 deletions core/fpdfapi/font/cpdf_tounicodemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,32 @@ void CPDF_ToUnicodeMap::SetCode(uint32_t srccode, WideString destcode) {
}

void CPDF_ToUnicodeMap::InsertIntoMaps(uint32_t code, uint32_t destcode) {
auto [it, inserted] = map_.insert({code, destcode});
if (!inserted) {
it->second = std::min(it->second, destcode);
}

auto [reverse_it, reverse_inserted] = reverse_map_.insert({destcode, code});
if (!reverse_inserted) {
reverse_it->second = std::min(reverse_it->second, code);
}
// Adobe TN #5014, "Adobe CMap and CIDFont Files Specification": "Code
// mappings (unlike codespace ranges) may overlap, but succeeding maps
// superceded preceding maps." A later bfchar or bfrange entry therefore
// replaces an earlier mapping for the same code, which subset fonts rely on
// when a catch-all bfrange is followed by overrides for individual codes.
map_[code] = destcode;
reverse_map_[destcode] = code;

// TODO(crbug.com/554790604): Two rough edges remain here.
//
// A superseded mapping leaves an orphaned entry behind in `reverse_map_`:
// after InsertIntoMaps(1, 2) and then InsertIntoMaps(1, 3), `map_` holds
// {1: 3} but `reverse_map_` holds {2: 1, 3: 1}, so ReverseLookup(2) still
// answers 1 for a mapping that no longer exists. Rebuilding `reverse_map_`
// from the finished `map_` removes those, but it changes which charcode
// font subsetting picks, so it needs its own change.
//
// Also, last-wins is only meaningful for a CMap that a producer authored.
// LoadCompositeFont() collects a font's cmap into a multimap keyed by glyph,
// so a glyph that several unicodes reach contributes several entries, and
// LoadUnicode() then emits overlapping bfranges for it. Which of those wins
// comes down to the order they were emitted in rather than to the font, and
// no ordering is right for all of them. Among the pairs
// FPDFSaveWithFontSubsetEmbedderTest covers, last-wins picks U+4E00 over
// U+2F00, which is the better answer, but also U+F906 over U+53E5 and
// U+00A0 over U+0020, which are worse; lowest-wins gets those same three
// the other way round. Making that CMap map each charcode once is the real
// fix.
}
Loading
Loading