feat(libcairo): construct mesh pattern patches #15685

Closed
hyvvs wants to merge 8 commits from upstream-pr/15685 into main
hyvvs commented 2026-11-04 04:35:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hyvvs on 2026-11-04T04:35:30Z.


What

Implement seven new guest-callable libcairo mesh-pattern construction exports with typed APS5_VABI signatures: cairo_pattern_create_mesh, cairo_mesh_pattern_begin_patch, cairo_mesh_pattern_end_patch, cairo_mesh_pattern_move_to, cairo_mesh_pattern_line_to, cairo_mesh_pattern_curve_to, and cairo_mesh_pattern_set_corner_color_rgba.

They construct and own mesh patch perimeter curves, interpolate missing interior control points, close partial patches, retain/clamp corner RGBA, handle reference counts, and preserve Cairo's sticky invalid-construction and pattern-type error states. This branch is stacked on #15208, which provides eight separate gradient-pattern exports and the shared pattern lifecycle. Only the seven mesh exports are newly implemented here; #15208's eight are not double-counted. Source-pattern rendering, paint/fill/stroke, firmware validation and PS5 console tests remain unsupported/unverified.

Tested

  • Windows MinGW GCC 15.2 actual production CMake Release build and CTest guest_cairo_mesh plus guest_cairo_patterns: 2/2 pass on this exact commit 93020abdac.
  • WSL Linux GCC ASan+UBSan+leak checks passed, using Release-active checks and exact guest System V prototypes. The checked-in test source also compiles as native Cairo 1.18.0 oracle; the native and guest outputs match exactly for 1,435 output lines covering square, partial and curved patches, 64 seeded randomized cases, full perimeter/interior coordinates and colors, error cases, and ownership.
  • Public-header/ABI declaration audit: 405 libraries, 27,906 exports, all unique and covered.
  • git diff upstream/main...HEAD --check and current-upstream-main merge-tree clean; conventions validated against the full PR template. No actual PS5 hardware tests are claimed.

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 and retained third-party copyright notice
  • 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: #15208
  • Fixes: none
  • Unblocks: further mesh rendering; rendering not implemented in this PR
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5148930368 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15685). Originally posted by [hyvvs](https://github.com/hyvvs) on 2026-11-04T04:35:30Z. --- ### What Implement **seven new guest-callable `libcairo` mesh-pattern construction exports** with typed `APS5_VABI` signatures: `cairo_pattern_create_mesh`, `cairo_mesh_pattern_begin_patch`, `cairo_mesh_pattern_end_patch`, `cairo_mesh_pattern_move_to`, `cairo_mesh_pattern_line_to`, `cairo_mesh_pattern_curve_to`, and `cairo_mesh_pattern_set_corner_color_rgba`. They construct and own mesh patch perimeter curves, interpolate missing interior control points, close partial patches, retain/clamp corner RGBA, handle reference counts, and preserve Cairo's sticky invalid-construction and pattern-type error states. This branch is stacked on [#15208](https://github.com/boykopovar/AnyPS5/pull/15208), which provides eight separate gradient-pattern exports and the shared pattern lifecycle. **Only the seven mesh exports are newly implemented here**; #15208's eight are not double-counted. Source-pattern rendering, paint/fill/stroke, firmware validation and PS5 console tests remain unsupported/unverified. ### Tested - Windows MinGW GCC 15.2 actual production CMake Release build and CTest `guest_cairo_mesh` plus `guest_cairo_patterns`: **2/2 pass** on this exact commit `93020abdac`. - WSL Linux GCC ASan+UBSan+leak checks passed, using Release-active checks and exact guest System V prototypes. The checked-in test source also compiles as native Cairo 1.18.0 oracle; the native and guest outputs match exactly for **1,435 output lines** covering square, partial and curved patches, 64 seeded randomized cases, full perimeter/interior coordinates and colors, error cases, and ownership. - Public-header/ABI declaration audit: 405 libraries, 27,906 exports, all unique and covered. - `git diff upstream/main...HEAD --check` and current-upstream-main merge-tree clean; conventions validated against the full PR template. No actual PS5 hardware tests are claimed. ### 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) and retained third-party copyright notice - [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: #15208 - [x] Fixes: none - [x] Unblocks: further mesh rendering; rendering not implemented in this PR - [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!15685
No description provided.