feat(libcairo): compute quantized path extents #15675
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15675"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hyvvs on 2026-11-04T03:17:54Z.
What
Implement one additional, previously throwing
libcairoexport,cairo_path_extents, with its typed guest System V ABI, using the existing path-storage implementation of #15430. The function ignores isolated moves, includes the endpoints of actual line segments, finds interior cubic Bezier extrema by solving the derivative quadratics, and reports path bounds in current user coordinates after device 24.8 quantization, CTM inversion and surface-device scaling. It does not pretend to rasterize; stroke/fill/arc exports remain unimplemented. The technical debt reflects one fewer throwing NID (85 on this stacked branch). The PS5 library's actual implementation has not been verified on hardware.This branch is explicitly built on #15430 (whose ancestry includes #15324); it adds one new functional export, not 76 newly implemented exports versus main.
Tested
-O2 -DNDEBUG -Wall -Wextra -Werror -pedantic: source-linked GuestCairoPathExtents, GuestCairoGeometry, GuestCairoPath and GuestCairoContext all pass.detect_leaks=1and halt-on-error.libcairo.so.2): matches ten fixed expected path-bounds scenarios, including empty/move-only, move-and-close, negative line, cubic extrema with fractional 24.8 rounding, open/closed polyline and rotated CTM. Additional seeded differential: 1,500 randomized path sequences across mixed translate/rotate/scale, rectangle, negative lines, cubic curves, close path and device-scale cases, with zero mismatches at relative tolerance 1e-5 after the fixed-point and move-close corrections.AddCubicRangeto omit interior extrema, build and run the checked-in test; it fails becausecurvemaximum y becomes 0 instead of 75.python tools/progress.py --module libcairo: 76/161 callable on this branch vs 75/161 on parent #15430. Strict conventions and diff checks run on the exact commit. A complete project-integrated CMake/CTest build and a console run were not performed locally.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Pull request closed