feat(libcairo): implement cairo_arc and cairo_arc_negative #28015
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28015"
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 Ducengarth on 2026-11-28T04:31:20Z.
What
Implements
cairo_arc(NIDR0TePTSHd2k) andcairo_arc_negative(NID2w5H3b3yPqw) in libcairo.aps5_cairo_arc,aps5_cairo_arc_negative), likecairo_move_to,cairo_line_toandcairo_curve_toinContext.cpp.cmake/Cairo.cmakealready generates theaps5_names for everycairo.hfunction, andcairo-arc.cis already part ofcairo_backend.cairo_arcraisesangle2by whole turns until it is not belowangle1, andcairo_arc_negativelowers it until it is not above. A radius of 0 or less adds twoline_tocalls to the center. Otherwise the arc first lines to its start point, which becomes amove_towhen there is no current point. A context already in error is left unchanged.Path.hppdeclares both next to the other path operations. The stubs and their inventory declarations are removed, and a debt fragment removes the two rows from the callable exports table. The path operations have no entry of their own: the existingContext.cppentries already cover running Cairo 1.18.0 without Sony's patches, none of which touches arcs, and the unmeasured console behaviour.Tested
Windows 11 Pro, WinLibs GCC 15.2.0 UCRT, Release,
BUILD_TESTING=ON, on8b2baa04b84(currentmainplus this commit):guest_cairo_arc(new),guest_cairo_path,guest_cairo_path_extentsandguest_cairo_contextpass, 3 of 3 runs.guest_cairo_arccompares the copied path, path status,cairo_has_current_pointand the current point exactly with direct calls to the bundled Cairo on a separate native context. It covers both functions, three starting states (no path, aftermove_to, afterline_to), three transforms (identity, translate plus scale, singular scale that puts the context in error) and ten arcs:move_toto the arc start with no current point,line_toto it after one);cairo_arcadds only curves after the start;move_to/line_toelements at the center.cairo_arcforwarding toaps5_cairo_arc_negative;cairo_arcswapping the angles;cairo_arc_negativeforwarding toaps5_cairo_arc.python3 tools/check_conventions.pypasses, as docore/libs/tests/test_public_headers.py --audit-onlyandtools/debt_fold.py --check.python3 tools/pr_overlap.py --branchreports no shared exports.cairo_pattern_reference) removes the neighbouring line ininclude/InventoryExports.hpp, so whichever merges second needs a one-line rebase.cairo_in_fill) sharesContext.cpp,Path.hppand the CMake file.git merge-treeshows that its conflicts with this branch are the same four files it already conflicts in againstmain.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)🤖 Generated with Claude Code
Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-28T04:34:09Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
8b2baa04b8:tools/check_conventions.pypassed.guest_cairo_arc_testsbuilt cleanly.guest_cairo_arc):core/libs/prx/libcairo/Context.cpp,core/libs/prx/libcairo/Export.cpp,core/libs/prx/libcairo/include/InventoryExports.hpp,core/libs/prx/libcairo/include/Path.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T08:13:06Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the reviewed code forwards both arc functions to the bundled Cairo backend and includes focused behavioral tests.
What I ran
Reviewed head
8b2baa04b844469062fc9cba0d58f9c7d5ee0d96. I usedrepo_read.pyto inspect the prepared diff and the relevant code at that head. No build or tests were run during this review; the Windows test results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No runtime behavior, build, or tests were independently verified. The author reports the new arc test and related checks pass on Windows 11 with GCC 15.2.0. No changed files were excluded from review.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-11-28T11:11:33Z.
Review: APPROVED
Checked head
8b2baa04b8on Windows 11 with WinLibs GCC 15.2 (Release), onmainc6331cc61b.tools/check_conventions.py --headandtools/debt_fold.py --checkpass, and the full build succeeds.guest_cairo_arcandguest_cairo_scaled_font.windows_read_trap_unknown, which fails onmaintoo (fixed in #28028), and theframe_capture_minimizeload timeout.From reading the code: both exports forward to the bundled cairo, and
CheckMatchesNativecompares the copied path, its status and the current point with native cairo. It covers both directions, three path prefixes, a singular matrix, zero and negative radii, and angle spans past 2π. The prototypes match thecairo_arcsignature through thestatic_asserts.#27995 removes the neighbouring
cairo_pattern_referenceline ininclude/InventoryExports.hpp, so the two don't apply together. Whichever merges second needs a one-line rebase.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:17:58Z.
Review: COMMENTED
The Linux arc fixture passed. It checks clockwise and counterclockwise arcs, current-point updates, and transformed and singular inputs against the pinned Cairo backend.
I compiled the changed translation unit together with the fixture and linked the existing Linux guest libraries.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T14:19:57Z.
Review: APPROVED
Reviewed — looks good
The reviewed change at
46f95bc26e1bfc3570ac1cb4880ac602e1a03ec8forwards both arc functions to the bundled Cairo backend, and I found no blocking defects in the changed code.What I ran
Static review only; no build or tests were run. The prepared diff and file snapshots were inspected, and the pinned reader search found the two forwarding calls.
All seven files listed under
reviewedinfiles.jsonwere read;files.jsonlists no excluded files. The reader’s additionalcatrequest could not run because its logging attempted to write to the read-only review folder.Results
Negative control
The PR description reports three forwarding and angle mutations failed the new test, with restored code passing. I did not run those mutations.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
I did not independently run the test suite or verify behavior on a physical console. The PR’s test and convention-check results are author-reported.
To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.