feat(libcairo): implement cairo_arc and cairo_arc_negative #18404
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18404"
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 simnJS on 2026-11-11T13:26:42Z.
What
Arc.cppportssrc/cairo-arc.cand the major-axis helper ofsrc/cairo-matrix.cfrom Cairo 1.18.0, as asked on #15679. It is a separate file with the full upstream notice and aDerived fromline.cairo_arcandcairo_arc_negativedo.cairo_set_tolerance.cairo_curve_tonow follows_cairo_path_fixed_curve_to:M L Cwhere Cairo givesM C.cairo_new_sub_pathand is the origin aftercairo_new_path. Before,curve_to(5,5,5,5,5,5)on an empty path gaveM Lwhere Cairo givesM C.Overlap: #18381 implements
cairo_rectangle, the operator state andcairo_path_extents. This PR implements none of those exports; it edits the sameExport.cpp,InventoryExports.hpp, CMake and debt lines, so whichever lands second needs a merge ofmain.Tested
guest_cairo_*tests pass.guest_cairo_arcalso passed under ASan and UBSan on an earlier stack of this change.guest_cairo_arccompares 17 arc cases and 9 degenerate-curve cases with the element streams the host's Cairo 1.18.0 gives for the same calls. The comparison is exact except for the non-dyadic scaled and the rotated CTMs (1e-12).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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-11T15:59:21Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
6f30ec3a22:tools/check_conventions.pypassed;git diff --checkclean.guest_cairo_arc_testsfailed to build.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T14:25:33Z.
Review: COMMENTED
Reviewed cairo_arc and cairo_arc_negative — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
6f30ec3a22a0. Read the run's description, commits, manifest, file list and the full diff. Repository files were read at the head with the reader only.guest_cairo_*tests passing on Ubuntu 24.04, GCC 13, Release; I did not reproduce that.Results
guest_cairo_arcFindings
Blocking
None.
Non-blocking
The stated cause of the dropped degenerate line does not match the code.
docs/dev/debt/libcairo.md:27says the drop is "a preceding degenerate line … which the start of an arc produces". The description says the same for arcs that start from no current point. As I readAppendLine(Context.cpp:176-179), aline_towith no current point becomes a move, so an arc from no current point givesM Cwith noL. The zero-lengthLappears when the arc's start equals the current point, for example after amove_toto that point. Suggest rewording both places to that case.The degenerate-line drop has no test.
Context.cpp:546-552removes a zero-length line before a curve.GuestCairoArc.cppCheckDegenerateCurveshas noM L Ccase with a zero-length line, and none of the 17 arc references starts at the current point. Suggest a case such asmove_to(5,5); line_to(5,5); curve_to(…)expectingMC.A stale sentence remains in the debt file.
docs/dev/debt/libcairo.md:25still says "arc/rectangle constructors remain pending" for the path-data entry. Arcs are now implemented, so drop "arc" from that sentence.Not verified
guest_cairo_arctest were not run here. The author's run on Ubuntu 24.04 is not a run I performed.cairo-arc.c,cairo-matrix.c) was not checked against the upstream sources. The comparison relies on the test's reference values.Arc.cppgetsCairoContextStatusandCairoMatrixthroughPath.hppandContext.hpp.cairo_new_path(Context.cpp, diff hunk at line 504) was not checked against the otherguest_cairo_*tests, which I did not read.files.jsonreviewedwere read through the diff.Context.cpp,Path.hppandExport.cppwere also read at the head where noted above. Nothing was excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-13T19:49:14Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0e740df2d9:tools/check_conventions.pypassed;git diff --checkclean.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/Context.hpp,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.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T01:15:40Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation and added cases support merging.
What I ran
Reviewed head
0e81b461c81f6514704fe1b223798cb503712914usingrepo_read.pyto inspect the prepared diff and targeted source ranges. No build or tests were run; the test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No build or tests were run in this review. Windows and physical-console behavior were not verified. Author reports Linux tests and Cairo comparisons in
description.md; those results were not independently confirmed. Read all changed files listed in the manifest:core/libs/prx/libcairo/Arc.cpp,core/libs/prx/libcairo/CMakeLists.txt,core/libs/prx/libcairo/Context.cpp,core/libs/prx/libcairo/Export.cpp,core/libs/prx/libcairo/include/Context.hpp,core/libs/prx/libcairo/include/InventoryExports.hpp,core/libs/prx/libcairo/include/Path.hpp,core/libs/tests/GuestCairoArc.cpp, anddocs/dev/debt/libcairo.md. No files were excluded by the manifest.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T01:46:52Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
0e81b461c8:tools/check_conventions.pypassed;git diff --checkclean.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/Context.hpp,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
Pull request closed