feat(libfreetype): implement FT_Bitmap_Blend #16399
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16399"
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 Noxy-HNR on 2026-11-06T16:08:17Z.
What
FT_Bitmap_Blend(C3-qsnriefE) in libfreetype currently throws. It now calls the bundled FreeType (3rdparty/freetype) through a thin adapter insrc/BitmapBlend.cpp. No FreeType logic is copied intocore/.The adapter takes the guest library handle from
libSceFreeType, the source and targetFT_Bitmaprecords, the 26.6 source offset (passed by value), the target offset and the colour.FT_Bitmaphas the same layout on the guest and both hosts, and astatic_assertchecks it. The adapter copies both records, converts the LP64 offsets to hostFT_Vector, calls FreeType, then copies the target record and offset back. FreeType allocates, grows and frees the target buffer through the library's allocator, so the guest can release it withlibSceFreeType'sFT_Bitmap_Done, as on native FreeType.Before calling FreeType, the adapter opens host writes on the target record, the target offset and the target's existing pixels. If any is refused, it returns
FT_Err_Invalid_Argumentwithout calling FreeType. Null arguments return FreeType's own error. Two cases throw throughNotImplemented_nid_no_patch:libSceFreeTypekeeps its host copy in sync, and growing it from another module would leave that copy stale;FT_Posrange.The console signature is not measured, and the debt file records this. No title unblock is claimed.
This branch is built on #16394 (LCD geometry and variation axis flags), which adds the module's
CMakeLists.txt, so the diff also shows that commit. This PR's own change is commitaeca597988. It goes right after #16394.Tested
Current verification (2026-11-07), head
fe4b731f2a, merging maineed8517b31: Windows 11 x86-64, WinLibs MinGW GCC 15.2, Ninja, Release, full project configuration withBUILD_TESTING=ON,-j 18. Builtguest_legacy_freetype_bitmap_blend_fixture guest_legacy_freetype_library_fixtureand ran the focused raw and NID-patched tests matchingguest_legacy_freetype_(bitmap_blend|library)(_nid)?: 4/4 passed in each of three runs, none skipped. Test-private patched modules and executable keep validation independent of the global all-library target. Current conventions, whitespace and public-header checks passed. The fixture uses configuration-specific output directories and publishes patched files only after successful patching. No new Linux, macOS, console or title runtime result is claimed.Manual full-build dispatch for this head returned HTTP 403 (repository admin rights required). Automatic checks are tracked separately; a skipped job is not a pass.
Historical verification follows; results below retain their original heads and do not establish validation of the current head.
New
guest_legacy_freetype_bitmap_blendandguest_legacy_freetype_bitmap_blend_nidtests load the raw and NID-patchedlibfreetypeandlibSceFreeTypemodules and run each call side by side with the bundled FreeType on a separate library:FT_Bitmap_Done.NONEsource; zero-width and zero-height sources; mismatched pitch signs; a non-BGRA target; a source wider than 0x7FFF; and offsets whose result exceeds FreeType's 0x10000-pixel limit. Negative pitches on both bitmaps are covered too.sceKernelMprotect(checked withVirtualQuery). Each call is refused without changing any page. A source on a read-only page still blends, and the in-place blend into guest memory matches FreeType once write access is restored.Results:
aeca597988on upstreamea3ae18716:ctest -R guest_legacy_freetype4/4 passed in each of 3 runs.aeca597988merged with upstream04ab293bc2:ctest -R guest_legacy_freetype4/4 passed in each of 3 runs, including the read-only page checks.python tools/check_conventions.py --base origin/mainandpython core/libs/tests/test_public_headers.py --audit-only(406 libraries, 30,649 exports): passed.python tools/pr_overlap.py --branch claude/freetype-bitmap-blend(1,883 open PRs): no shared exports. It shares the newcore/libs/prx/libfreetype/CMakeLists.txtand neighbouring lines ofExport.cpp,LegacyExports.hpp,libfreetype.hppand the debt file with #15408, #15439, #15442, #15444, #15447 and #15468, which implement other libfreetype exports, so whichever lands later mergesmainand keeps every source and test. No open PR adds or removesFT_Bitmap_Blendor its NID.No console or retail-title test.
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)