Repository navigation
feat(libSceNKWebKit): implement WebCore::Path and the path DisplayList items - #24965
momgaroganuchi-crypto wants to merge 3 commits into
Conversation
Progress report (b7d463d → a649713)📈 System libraries: 45.71% (+0.12%, +47 implemented functions) ✅ 47 implemented
Changed libraries (implemented exports)
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: fix path copy/clear handling so empty paths enter the element-list mode before subsequent edits.
What I ran
Reviewed head eaefbb1da3d957c2859385b7f30698fb98a61958 against base main. No commands or tests were run in this review; the test results in the PR description are author-reported. Read all changed source and test files listed as included in the review manifest, plus the changed Export.cpp locations relevant to the removed stubs. Export.cpp was excluded from the review folder because it is too large; only targeted lines were read. The review folder’s files.json was not available through the reader.
Results
| Check | Result | Note |
|---|---|---|
| Source review | failed | Empty-path state bug |
| Tests in this review | not run | PR reports tests passed |
| Console comparison | not run | PR reports no console comparison |
Negative control
Not run.
Findings
Blocking
CopyPathleavesm_elementsEngagedfalse when copying a null/empty path, andClearreturns without engaging the element list whenm_pathis null. Thus a copied empty path remains disengaged afterclear(), and later path edits update cairo whileelementCount()reports zero because the disengaged element list is empty. This also affectsFillPathand other items constructed from an empty path. Initialize the empty path as engaged or makeclear()engage the element list even when no cairo context exists. Evidence:core/libs/prx/libSceNKWebKit/src/Path.cpp:145andcore/libs/prx/libSceNKWebKit/src/Path.cpp:183.
Non-blocking
None.
Sources
Not verified
The full Export.cpp was not read; only the unchanged Path::isNull stub location was checked. No build, tests, conventions checks, or PS5 console comparison were run by this reviewer.
To get this to a good state
Fix empty-path copy and clear state, add coverage for copying an empty path, clearing it, then adding a segment and checking elementCount() and apply(). Rerun the path and DisplayList path item tests and the project checks reported in the PR description on the new head.
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against eaefbb1da3:
- Conventions:
tools/check_conventions.pypassed. - Build:
nkwebkit_displaylistpathitems_tests,nkwebkit_path_testsbuilt cleanly. - CTest (
nkwebkit_displaylistpathitems,nkwebkit_path):1/2 Test #4798: nkwebkit_displaylistpathitems .... Passed 0.04 sec 2/2 Test #4864: nkwebkit_path .................... Passed 0.05 sec 100% tests passed, 0 tests failed out of 2 - Negative control: with
core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/src/DisplayListPathItems.cpp,core/libs/prx/libSceNKWebKit/src/Path.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/2 Test #4798: nkwebkit_displaylistpathitems ....***Failed 0.12 sec 2/2 Test #4864: nkwebkit_path ....................Subprocess aborted***Exception: 2.24 sec 0% tests passed, 2 tests failed out of 2 - Code reading:
- Verified WebCore::Path lifecycle methods (copy/move constructor, copy/move assignment, destructor, clear) in core/libs/prx/libSceNKWebKit/src/Path.cpp correctly manage m_path and m_elements without leaks or double frees
- Verified PathElement vector growth logic in AppendElement uses checked multiplication and WTF::fastMalloc/fastFree
- Verified fastBoundingRect and elementCount handle both engaged element lists and fallback cairo paths cleanly
- Verified DisplayList items (FillPath, StrokePath, DrawPath, ClipPath, ClipOutToPath, DrawFocusRingPath) construct, compute localBounds, and destroy their embedded Path according to WebCore DisplayList ABI
- Verified null pointer validation on all exported functions throwing std::invalid_argument when required arguments are null
Looks Good To Me
|
Fixed in 3640e56. Initialize now leaves the element list engaged and clear() engages it even without a cairo context, so an empty path copied or cleared before moveTo/�ddLineTo records and replays its elements. Added a regression case that copy-constructs an empty path, edits it, then clears an empty path, edits it, and checks elementCount() and �pply(). Also fixed the windows checks: the 33 exports are declared once in include/PathExports.hpp, with the duplicates removed from LegacyExports.hpp, InventoryExports.hpp, Api.hpp, PathAbi.hpp and DisplayListPathItems.cpp, and cairo calls go through the stable nid_no_patch bridge in libcairo so patched_libraries resolves them after NID patching. Re-ran |
3640e56 to
6131e72
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this change based on the reviewed code; its main path and DisplayList lifecycle behavior is implemented as described.
What I ran
Reviewed head 6131e72574fed59e29958bac783ccc9b82c6c229. No commands or tests were run; the Windows test results in the PR description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Diff and implementation review | passed | Path, DisplayList and Cairo bridge code inspected |
| Tests | not run | PR description reports Windows tests |
Findings
Blocking
None identified in the inspected code.
Non-blocking
None.
Not verified
The full text of Export.cpp and InventoryExports.hpp was excluded by the review bundle size limit. I reviewed their changes in the prepared diff, but did not inspect their complete head contents. I did not run tests, verify the build, or compare behavior against a console module. The PR description reports Windows 11 / MinGW-w64 GCC 16.2 Release test results; these were not run by me.
To get this to a good state
Nothing is required.
…t items Path keeps the console 32-byte layout: a cairo context at +0, the PathElement vector at +8 and the engaged flag at +0x18. The six path DisplayList item classes are constructed and destroyed with their Path member; replaying them still throws.
A default or copied empty Path keeps its element list engaged, and clear() engages it without a cairo context, so a later moveTo or addLineTo is counted and replayed. Moves the Path and path-item declarations into PathExports.hpp, drops the duplicates from LegacyExports.hpp, InventoryExports.hpp, Api.hpp, PathAbi.hpp and DisplayListPathItems.cpp, and routes cairo calls through the stable _nid_no_patch bridge in libcairo.
6131e72 to
1ca600c
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
The path implementation and its tests were inspected at head 1ca600ce52f6ca917b260f4b4571d22d93730f81; I did not run the author-reported checks, and one Cairo path-copy cleanup edge case remains.
What I ran
Read the prepared description, commits, manifest, diff, and selected changed files using repo_read.py at the pinned head. No build or test commands were run. The author reports Windows 11 and MinGW-w64 GCC 16.2 tests in the PR description; these were not independently verified.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted code review | passed | Main path logic inspected |
| Tests and build | not run | Author reports selected tests passed |
| Console comparison | not run | Author reports no console comparison |
Negative control
Not run; no checks were run in this review.
Findings
Blocking
None.
Non-blocking
Path::applyleaks the copied Cairo path if a guest callback throws during replay. InApplyCairoPath, the callback runs inside the loop beforeCairoPathDestroy_nid_no_patch(copy); use scoped cleanup so the copy is released on both normal and exceptional exits. (core/libs/prx/libSceNKWebKit/src/Path.cpp:309)
Sources
Not verified
No build, test, or console comparison was performed. Read: core/libs/prx/libSceNKWebKit/CMakeLists.txt, include/Api.hpp, include/LegacyExports.hpp, include/PathExports.hpp, libSceNKWebKit.hpp, src/DisplayListPathItems.cpp, src/Path.cpp, src/PathAbi.hpp, both added test files, and core/libs/prx/libcairo/CMakeLists.txt, Bridge.cpp, and include/Bridge.hpp, plus the review description, commits, manifest, and diff. Export.cpp and include/InventoryExports.hpp were excluded from the review bundle as too large; the debt fragment was not read.
To get this to a good state
Nothing is required. Consider ensuring the copied Cairo path is released if a callback throws.
…ions Wraps the Cairo path copy in unique_ptr so a throwing PathElement callback cannot leak it; adds a test that the exception propagates and the path stays usable.
|
Fixed in |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
The requested review folder and reader are not accessible through the available tools, so no changed files or checks could be inspected.
What I ran
Not run. The pinned head, diff, manifest, and repository sources were not available to read.
Results
| Check | Result | Note |
|---|---|---|
| Review materials | not run | Reader unavailable |
| Changed code audit | not run | Sources unavailable |
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
All changed files, diff hunks, tests, and repository behavior. Files read: none. Files listed for review: not verified.
To get this to a good state
Provide the prepared review folder and pinned reader through an accessible tool so the review can be completed.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
What
Implements 47
libSceNKWebKitexports that throw onmaintoday: theWebCore::Pathlifecycle and geometry entry points (17) and the lifecycle of six path-based DisplayList items (30).Pathuses the console 32-byte layout read from the 11.00libSceNKWebKit.sprx(Path::PathandPath::isNullbodies): the cairo context at +0, a 16-byteVector<PathElement>at +8 and the engaged flag at +0x18. It keeps both the cairo path and the element list, as the cairoPathCairo.cppdoes when inline path data is disabled. Implemented: copy/assignment/destruction,moveTo,addLineTo,addQuadCurveTo,addBezierCurveTo,closeSubpath,clear, bothaddRoundedRectoverloads,elementCount,applyandfastBoundingRect. Copying or clearing an empty path keeps the element list engaged, so a latermoveTooraddLineTois counted and replayed.applycalls the guestWTF::Functionwrapper and falls back to the cairo path when the element list is not engaged.The item work covers
FillPath,StrokePath,DrawPath,ClipPath,ClipOutToPathandDrawFocusRingPath: constructors and destructors copy and release the embeddedPath;FillPathandDrawPathalso answerlocalBoundsfromfastBoundingRect. Theirapplystill throws throughApplyWithoutGraphicsContext, so replaying these items remains future work;StrokePath::localBoundsreports no bounds.The 33 exports are declared once in
include/PathExports.hpp; the duplicate placeholders are removed frominclude/LegacyExports.hpp,include/InventoryExports.hpp,include/Api.hpp,src/PathAbi.hppand the forward declarations insrc/DisplayListPathItems.cpp. Cairo calls go through the internal_nid_no_patchhelpers inlibcairo/include/Bridge.hppandlibcairo/Bridge.cpp, the same mechanism as the existingCairoSurfaceDestroy_nid_no_patch, because the NID patcher rewrites libcairo exports but leaves non-SCE imports of a system library unchanged. The debt fragment adds the Functional entry and removes the eight inventory rows.New files:
include/PathExports.hpp,src/PathAbi.hpp,src/Path.cpp,src/DisplayListPathItems.cpp,tests/Path.cpp,tests/DisplayListPathItems.cpp,libcairo/include/Bridge.hpp,libcairo/Bridge.cpp.Overlap:
pr_overlap.py --namesfinds no open implementation of any of the 47 functions.--branchreports only file-level overlaps with the Export.cpp/CMakeLists edits of other PRs and the split refactors (#24322, #24910, #24917), which list these exports because they move the stubs, not because they implement them. The libcairo_nid_no_patchbridge files are also added by the independent #24980; both copies are identical, so whichever merges first, the other rebases without a semantic conflict.Tested
Windows 11, MinGW-w64 GCC 16.2, Release:
nkwebkit_pathandnkwebkit_displaylistpathitemspass, including layout asserts, copy/move/clear, segment application, rounded rects and null-object faults.nkwebkit_wtfandnkwebkit_dragimagestill pass.tools/check_conventions.py --base origin/mainpasses.tools/debt_fold.py --checkpasses for this fragment; the repository's unrelatedfeat-libwebrtc-rnn-vad.mdfragment fails on its own, so it was moved aside for the check.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)