feat(libcairo): implement eight cairo_pattern gradient state exports #15208
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15208"
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-02T20:42:26Z.
What
Implements eight
cairo_pattern_*state exports inPatterns.cpp:cairo_pattern_create_linear,cairo_pattern_create_radial,cairo_pattern_add_color_stop_rgba,cairo_pattern_reference,cairo_pattern_destroy,cairo_pattern_set_extend,cairo_pattern_set_filterandcairo_pattern_set_matrix. Patterns are refcounted objects holding their color stops, extend, filter and matrix, following the public Cairo pattern documentation.Rendering is out of scope.
cairo_pattern_create_for_surface,cairo_pattern_create_meshand the mesh functions stayNotImplemented_nid_no_patch; the debt file records it.Tested
Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release:
guest_cairo_patternspasses (reference counts, status codes, values read back). Only this test was run, not the full suite. Not run on Linux or on a title.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 MarcZX10 on 2026-11-22T13:04:01Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge:
cairo_pattern_set_matrixleaves the pattern matrix changed when the supplied matrix is non-invertible.What I ran
2be61e76e8abafdecb3f38a31331006aa5515987usingrepo_read.pyreader tools.guest_cairo_patterns; this was not independently verified.Results
Findings
Blocking
core/libs/prx/libcairo/Patterns.cpp:138stores the requested matrix before checking whether it can be inverted. When inversion fails, Cairo sets the pattern status to an error and retains the prior matrix; here the pattern becomes errored but keeps the invalid matrix. The test atcore/libs/tests/GuestCairoPatterns.cpp:533currently codifies this divergent behavior. Validate/invert first and only assign the new matrix if inversion succeeds.Non-blocking
None.
Not verified
core/libs/prx/libcairo/CMakeLists.txt,core/libs/prx/libcairo/Export.cpp,core/libs/prx/libcairo/Patterns.cpp,core/libs/prx/libcairo/include/InventoryExports.hpp,core/libs/prx/libcairo/include/Pattern.hpp,core/libs/tests/GuestCairoPatterns.cpp, anddocs/dev/debt/libcairo.md.files.jsonwas not available through the reader, so the completereviewedset and excluded files could not be confirmed. The only visible manifest marks those seven files as included.To get this to a good state
guest_cairo_patternson the new head.Pull request closed