feat(libcairo): implement cairo_pattern_reference #27995
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/27995"
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 sammybourke42666-debug on 2026-11-28T02:07:57Z.
What
Forward the guest
cairo_pattern_referenceexport to the pinned Cairo backend. It returns the same pointer and increments the reference count of live patterns, including allocated error patterns. Null and static error patterns pass through unchanged. The prototype and implementation matchsrc/cairo.handsrc/cairo-pattern.cin Sony’s published Cairo source for PS5 system software 9.00 and later. Sony Cairo sourceThe progress scanner reports
libcairoincreasing from 108/161 to 109/161, withcairo_pattern_referenceas the only newly implemented export.Tested
Windows 11 x64 (build 26200), WinLibs GCC 15.2.0, Release, at
a4ebd9084cplus this change.ctest --test-dir ../b -R '^guest_cairo_surface_pattern_' --output-on-failurepassed all three tests, including native reference ownership and static and allocated error patterns.ctest --test-dir ../b -R '^public_headers$' --output-on-failurepassed.tools/progress.py --comparereport lists one newly implemented export and the same declared total.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)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-28T02:10:01Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
a832030cd3:tools/check_conventions.pypassed.guest_cairo_surface_pattern_testsbuilt cleanly.guest_cairo_surface_pattern_patterns,guest_cairo_surface_pattern_source,guest_cairo_surface_pattern_mask):core/libs/prx/libcairo/Export.cpp,core/libs/prx/libcairo/SurfacePattern.cpp,core/libs/prx/libcairo/include/InventoryExports.hpp,core/libs/prx/libcairo/include/SurfacePattern.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 Plyxen on 2026-11-28T11:11:36Z.
Review: APPROVED
Checked head
a832030cd3on 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_surface_pattern_*tests.windows_read_trap_unknown, which fails onmaintoo (fixed in #28028), and theframe_capture_minimizeload timeout.From reading the code:
cairo_pattern_referenceforwards to the bundled cairo, which returnsNULLand the static nil patterns unchanged. The test pins both cases, and also the error pattern made from an invalid surface, which cairo allocates, so its count goes to 2.#28015 removes the neighbouring
cairo_arc_negativeline 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 MarcZX10 on 2026-11-28T11:27:41Z.
Review: APPROVED
Reviewed — looks good
The implementation forwards the guest pattern reference call to the Cairo backend and adds ownership and error-pattern coverage; the changed code inspected supports merging.
What I ran
Reviewed head
a832030cd3ce7548f8d02b10ce78224c730bd70fusing the prepared diff andrepo_read.pyat the pinned head. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
Behavior claims were checked against the prepared diff and the changed source at the pinned head.
Not verified
No tests were run in this review. The author reports native reference ownership, null and error-pattern tests and a public headers check. No files were excluded; all files marked for review in the manifest were read.
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:17:56Z.
Review: COMMENTED
I ran the exact surface-pattern fixture with the changed implementation and the pinned Cairo backend on Linux. All three fixture modes passed, covering pattern reference counting and its use by the source and mask operations.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T13:41:55Z.
Review: APPROVED
Reviewed — looks good
The wrapper forwards the guest pattern pointer to Cairo’s reference function and returns the same pointer; the inspected changes show no blocking defect.
What I ran
Reviewed head
833b79cdcc08b3ee7d55ce535f756ade7d45be1d. I read the prepared snapshots of all six changed files and used the pinnedrepo_read.pyreader for source context. I did not run tests or a build.Results
Findings
Blocking
None.
Non-blocking
None.
Sources
The new wrapper converts the guest pointer to the backend pointer, calls Cairo’s reference function, and converts its return value back. The declaration is added to the pattern interface. Pattern.cpp at the reviewed head · Pattern.hpp at the reviewed head
The added tests cover same-pointer return and reference counts for a live surface pattern, null input, and error patterns. GuestCairoSurfacePattern.cpp at the reviewed head
Not verified
No tests or build were run. The reader returned source snippets but then reported a read-only error when attempting to append its audit log. All six files listed under
reviewedinfiles.jsonwere read from their prepared snapshots:core/libs/prx/libcairo/Export.cpp,core/libs/prx/libcairo/Pattern.cpp,core/libs/prx/libcairo/include/InventoryExports.hpp,core/libs/prx/libcairo/include/Pattern.hpp,core/libs/tests/GuestCairoSurfacePattern.cpp, anddocs/dev/debt/changes/feat-cairo-pattern-reference.md.files.jsonlists no excluded files.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T13:51:15Z.
Review: APPROVED
Verified on Windows 11 (GCC 15.2, Release) on main
484b0368d3. Applied together with #28892, #28891, #28890 and #28817, which touch separate files.Re-checked after the rebase onto main and the move to
Pattern.cpp, at833b79cdcc.guest_cairo_surface_pattern_patterns,_sourceand_maskpassed in 3 of 3 runs.libcairo.prx, aborts with "cairo_pattern_reference not implemented". So the export is what the test exercises.Guest(...)like the other pattern exports inPattern.cpp. The null, error-pattern and reference-count cases match Cairo's owncairo_pattern_reference.Not run: Linux and macOS.
AI-assisted: yes (Claude Code)
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.