feat(libSceNKWebKit): implement WebCore::TranslateTransformOperation #22872
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22872"
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 FinleyLaempe on 2026-11-18T13:13:36Z.
What
Implements the 20
WebCore::TranslateTransformOperationexports of libSceNKWebKit (bothcreateoverloads, theC1/C2constructors, theD0/D1/D2destructors, theLength- andFloatSize-takingx/y/z,isIdentity,isRepresentableIn2D,apply,dump,clone,operator==andblend), replacing theNotImplemented_nid_no_patchstubs inExport.cpp.TranslateTransformOperation.cppand itsLengthblending fromLength.cpp. The new file carries the upstream notices ofTranslateTransformOperation.cpp/.h,Length.cppandTransformOperation.cpp, as AGENTS.md asks for adapted code.RegionExports.hpp: a 16-byteTransformOperationbase (vptr, refCount, type enum), a 40-byteTranslateTransformOperation(m_x/m_y/m_zat offsets 16/24/32) and an 8-byteTransformOperationRef, with static asserts. The 12-slot vtable (destructors,clone,selfOrCopyWithResolvedCalculatedValues,operator==,isIdentity,apply,blend,primitiveType,isAffectedByTransformOrigin,isRepresentableIn2D,dump) is laid out per the pinnedTransformOperation.h.blendtakesdouble progressandbool blendToIdentitywhere the pinned class takes aBlendingContext, and the size getters export asx/y/z(FloatSize)where the pinned class hasxAsFloat/yAsFloat/zAsFloat. The implementation follows the firmware signatures and is not compared with a console module.blendreads the firmwaredoubleasBlendingContext::progresswith Replace semantics and computes the float blend in double before rounding; where the pinnedsharedPrimitiveTypefinds no shared primitive withfromit returns a ref to*thiswith the refcount bumped.WebCore::floatValueForLength(WebCoreLayoutExports.hpp) in the size getters,isIdentityand the vtable-onlyselfOrCopyWithResolvedCalculatedValues,WebCore::TransformationMatrix::translate3d(WebCoreExports.hpp) inapply, and the WTFTextStreamandfastMalloc/fastFreewrappers.Lengthdoes not modelCalculationValuereference counting, so the constructors,create,clone, the destructors and theLength-returningx/y/zthrowNotImplemented_nid_no_patchwhen a member is Calculated; the calculated branch ofblendMixedTypes,dumpandoperator==of calculated lengths, andfloatValueForLengthin the size getters,isIdentityandselfOrCopyWithResolvedCalculatedValuesalso throw.dumpthrows on an out-of-range operation type where the pinned stream operator prints nothing.thiswithstd::invalid_argument; the constructors andcreatealso reject non-translateTransformOperation::Typevalues.Api.hppandLegacyExports.hppto the new typed headerWebCoreTransformExports.hpp, included fromlibSceNKWebKit.hpp.RegionExports.hppgains a float-valueLengthconstructor (needed for blend results) and a<type_traits>include, and main'sPerspectiveTransformOperationfiles rename their base (see thePerspectiveTransformOperationpoint below).TranslateTransformOperationlayout-and-vtable and behaviour entries, both noting the work is not compared with a console module; no debt entries are removed.PerspectiveTransformOperation(include/PerspectiveTransformOperationExports.hpp) is exported by the 3.20 module only, whose WebKit revision stores the operation type as a 4-byteOperationTypewithPERSPECTIVE= 19, while this PR'sTranslateTransformOperationfollows the pinned 11.x one-byteTypeenum (TransformOperation.h:41), where Perspective is 20. The two bases therefore stay separate: sinceRegionExports.hppnow definesWebCore::TransformOperation, Perspective's own 16-byte base (type at 12) keeps its layout and behaviour under the nameLegacyTransformOperation, as main'sLegacyLengthdoes for the same module. Main's Perspective code and test change only in that name.Tested
Arch Linux x86-64, GCC 16.2.1, Release build with
-DBUILD_TESTING=ON: the newnkwebkit_translatetransformoperationtest and every othernkwebkit_*test, 155 of 155 passed.python3 tools/check_conventions.py --base upstream/mainpasses. Not tested on a console or on Windows.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 copilot-pull-request-reviewer[bot] on 2026-11-18T13:14:10Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T13:16:28Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
6a7183d781:tools/check_conventions.pypassed.nkwebkit_translatetransformoperation_testsbuilt cleanly.nkwebkit_translatetransformoperation):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/Api.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/include/RegionExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/TranslateTransformOperation.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.thischecks via Checked / CheckedConst throw std::invalid_argument as required by C++ runtime bindings.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T02:34:59Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the code inspected; the optional points below concern behaviors the author identifies as unverified.
What I ran
Reviewed head
0e76b433111e510ab456bfa5426c0183cf781ba. No commands were run;repo_read.pywas unavailable as a command in this interface. The description reports 155 of 155nkwebkit_*tests passed andcheck_conventions.pypassed; those results were not independently verified.Results
Findings
Blocking
None in the code inspected.
Non-blocking
dumpwith an out-of-range operation type; the description and debt entry record these limits. The behavior is not compared against a console module.Not verified
No build or tests were run. Console and Windows behavior were not verified.
Export.cppwas listed as excluded for size and only its opening and closing lines were inspected; the export-removal hunks were reviewed indiff.patch.LegacyExports.hppwas not read in full; the changed declaration-removal hunks were reviewed indiff.patch. The full test file and other included files listed under reviewed were not all read. No claim is made about uninspected code.Files read:
review/description.md,review/commits.md,review/manifest.json,review/diff.patch;core/libs/prx/libSceNKWebKit/src/TranslateTransformOperation.cpp,core/libs/prx/libSceNKWebKit/tests/TranslateTransformOperation.cpp,core/libs/prx/libSceNKWebKit/include/RegionExports.hpp,core/libs/prx/libSceNKWebKit/include/WebCoreTransformExports.hpp,core/libs/prx/libSceNKWebKit/include/WebCoreLayoutExports.hpp,core/libs/prx/libSceNKWebKit/include/PerspectiveTransformOperationExports.hpp,core/libs/prx/libSceNKWebKit/src/WebCoreLayout.cpp,core/libs/prx/libSceNKWebKit/src/PerspectiveTransformOperation.cpp,core/libs/prx/libSceNKWebKit/tests/PerspectiveTransformOperation.cpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/include/Api.hpp, andcore/libs/prx/libSceNKWebKit/Export.cpp(partial).Excluded from full text:
core/libs/prx/libSceNKWebKit/Export.cpp(too large for the review folder); the changed declaration-removal hunks ofApi.hppandLegacyExports.hppwere checked in the diff. The other changed files are included in the bundle, but were not all read in full.To get this to a good state
Nothing is required. Optional: compare the layout, vtable, and behavior with a console module when one is available.