feat(libcairo): construct positive and negative arc paths #15679

Closed
hyvvs wants to merge 24 commits from upstream-pr/15679 into main
hyvvs commented 2026-11-04 03:45:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hyvvs on 2026-11-04T03:45:47Z.


What

Implement two previously throwing libcairo exports, cairo_arc and cairo_arc_negative, with typed guest System V ABI and geometrically correct cubic Bezier path segments. Positive/negative sweeps, wrapping, joins to existing paths, degenerate and negative radii, scaled ellipse output, the default 0.1 tolerance and 24.8 Cairo device quantization are covered. The implementation builds on the quantized path/extents state in #15675. It does not claim rendering or console-verified firmware fidelity; unimplemented paint/fill/stroke remain throwing. This adds two genuinely callable exports atop #15675, not the cumulative stacked total.

Tested

  • Windows MinGW GCC 15.2 real CMake build and CTest target guest_cairo_arc pass. Twelve checked-in path fixtures verify exact 24.8 Cairo commands/points, including quarter, half and full circles, clockwise/counterclockwise arcs, wrapped angles, zero and negative radius, NaN, scaled ellipse and anisotropic matrix cases.
  • Worker native-Cairo 1.18.0 differential: 1,500 seeded randomized arcs with matching path headers and full double coordinates; WSL ASan/UBSan/leak checks passed on this commit. A native PS5 console has not been tested.
  • git diff upstream/main...HEAD --check, merge-tree and strict conventions verified locally before publishing. This branch adds 2 callable exports and removes 2 throwing placeholders.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #15675
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5148496672 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15679). Originally posted by [hyvvs](https://github.com/hyvvs) on 2026-11-04T03:45:47Z. --- ### What Implement two previously throwing `libcairo` exports, `cairo_arc` and `cairo_arc_negative`, with typed guest System V ABI and geometrically correct cubic Bezier path segments. Positive/negative sweeps, wrapping, joins to existing paths, degenerate and negative radii, scaled ellipse output, the default 0.1 tolerance and 24.8 Cairo device quantization are covered. The implementation builds on the quantized path/extents state in #15675. It does not claim rendering or console-verified firmware fidelity; unimplemented paint/fill/stroke remain throwing. This adds **two** genuinely callable exports atop #15675, not the cumulative stacked total. ### Tested - Windows MinGW GCC 15.2 real CMake build and CTest target `guest_cairo_arc` pass. Twelve checked-in path fixtures verify exact 24.8 Cairo commands/points, including quarter, half and full circles, clockwise/counterclockwise arcs, wrapped angles, zero and negative radius, NaN, scaled ellipse and anisotropic matrix cases. - Worker native-Cairo 1.18.0 differential: 1,500 seeded randomized arcs with matching path headers and full double coordinates; WSL ASan/UBSan/leak checks passed on this commit. A native PS5 console has **not** been tested. - `git diff upstream/main...HEAD --check`, merge-tree and strict conventions verified locally before publishing. This branch adds 2 callable exports and removes 2 throwing placeholders. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #15675 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!15679
No description provided.