Skip to content

Sync S14: merge upstream PDFium up to 2b2d56c79 (Oct 26 2026) - #90

Merged
bobsingor merged 9 commits into
embedpdf/mainfrom
embedpdf/sync/2b2d56c79
Oct 28, 2026
Merged

bobsingor merged 9 commits into
embedpdf/mainfrom
embedpdf/sync/2b2d56c79

Conversation

@bobsingor

Copy link
Copy Markdown
Contributor

No description provided.

pdfium-autoroll@skia-public.iam.gserviceaccount.com and others added 9 commits October 25, 2026 21:38
https://chromium.googlesource.com/chromium/src/tools/code_coverage.git/+log/a81032f8d6f5..084f00efb99d

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/code-coverage-pdfium
Please CC andyphan@google.com,dhoss@chromium.org,thestig@chromium.org on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Bug: None
Change-Id: I6cf25d1d6635c5b2b9cac6160b92f45281e9d03d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/161990
Commit-Queue: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Bot-Commit: pdfium-autoroll@skia-public.iam.gserviceaccount.com <pdfium-autoroll@skia-public.iam.gserviceaccount.com>
Update AutoRestorer to accept a universal reference in its two-argument
constructor. Move the previous value out of the target location into
old_value_ and move new_value into the location. Upon destruction, move
old_value_ back into the target location.

For types with move semantics, this eliminates copy operations and
allows AutoRestorer to work with move-only types such as
std::unique_ptr, and with cheap-move expensive-copy types like
cppgc::Persitent. For copy-only types, std::move degrades to copy
operations.

-- Add [[maybe_unused, nodiscard]] to prevent foot-shooting should
   local name be omitted and lifetime ending at next semicolon (as
   does base::AutoReset<>).

Change-Id: Id0f97da4d651de5c8f4d87833ae3c09be580fc36
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/162090
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Avoid accidentally omitting a local variable name and having the
class go out-of-scope at the next semicolon.

Change-Id: If51c8766c38887cccf29b064a4cec918bbf6863f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/162110
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
When the starting and ending coordinates of an axial shading coincide,
the gradient axis has zero length. Return early to avoid division by
zero when calculating scanline coordinate scaling.

Add a pixel test based off axial_shading_point_at_border_no_extend.in
with coincident coordinates (/Coords [0 0 0 0]) in /DeviceCMYK and
/Extend [true true]. DeviceCMYK ensures DrawAxialShading() is exercised
across both AGG and Skia renderers, while /Extend [true true] triggers
un-extended index clamping without the early exit.

Bug: 42270903
Change-Id: I4153fe88334da1bda242562a5a20998919acd1e5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/162070
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
In DrawAxialShading(), the projected coordinate along horizontal
scanlines advances by a constant linear step because the inverse
transform is affine. Hoisting the step delta and anchoring at column 0
eliminates per-pixel 2D matrix transforms and simplifies dot product
computations.

Previously, each pixel required 14 floating-point operations: 6
multiplications, 7 additions/subtractions (including 4 mul and 4 add
from matrix transformation), and 1 division. With affine stepping and
hoisted division, the inner loop requires only 2 operations: 1
multiplication and 1 addition per pixel, reducing arithmetic by over
85%.

Benchmarking on shallow_gradient_linear.pdf with AGG on my device shows:
* Scale 1: 20.2 ms to 5.0 ms (4.0x speedup).
* Scale 2: 70.0 ms to 12.8 ms (5.5x speedup).
* Scale 3: 148.2 ms to 23.1 ms (6.4x speedup, up to 8.1x CPU time).
* Unrelated documents show zero regression.

* Hoist step delta and column 0 scale calculations out of inner loops.
* Anchor the initial scanline coordinate per row at column 0.
* Roll pdfium_tests to update expectations for exact math.

Paired with:
https://pdfium-review.googlesource.com/c/pdfium_tests/+/161850

Bug: 42270903
Change-Id: I0aca850965e90e454cad1799fce8df8d9ccff521
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/161830
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Add unit test coverage in CFX_AggClipRgnTest for empty clips, initial
mask adoption, sub-box clipping, mask intersection, and saved clip
preservation.

Bug: 550515869
Change-Id: If4e7011f02e593614a7d808baaa39372492fe032
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/162071
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
In CFX_AggClipRgn::IntersectMask(), every pixel executed three
pdfium::span bounds checks and index offset calculations.

Optimize the intersection loop by slicing rows into contiguous spans
before the inner column loop, eliminating per-pixel bounds checks. On
the bug's test PDF (page 227, 100 repeats), this reduces render CPU time
on my device from 4.73s to 2.83s (-40%).

Bug: 550515869
Change-Id: Id1bcda613f1fee3a8c3751982a6fce367b6e6f20
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/161870
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Andy Phan <andyphan@chromium.org>
Add CFXPath.MicroShearTransformTolerance and
CFXPath.FivePointRectFuzzyEndpoints to demonstrate that
CFX_Path::IsRect() and CFX_Path::GetRect() currently reject rectangles
with microscopic floating-point deviations.

Bug: 550515869
Change-Id: Ie25e215169c5bdbd8906dd2c6aaa36da178ed3a1
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/162170
Commit-Queue: Andy Phan <andyphan@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
@bobsingor
bobsingor merged commit 04ccaa4 into embedpdf/main Oct 28, 2026
1 check passed
@bobsingor
bobsingor deleted the embedpdf/sync/2b2d56c79 branch October 28, 2026 13:12
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.

2 participants