feat(libSceFreeType): copy and convert guest bitmaps #8286
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8286"
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 santhoshkumar-dev on 2026-10-20T08:46:32Z.
What
The existing
libSceFreeTypebridge can render a glyph bitmap but cannot initialize, retain, convert or release standalone bitmaps. AddFT_Bitmap_New,FT_Bitmap_Copy,FT_Bitmap_ConvertandFT_Bitmap_Doneusing the bundled FreeType allocator and bitmap routines. Copies own their pixel storage; conversion preserves native row direction, alignment, pixel-mode handling and partial output state when allocation fails.A tracked glyph-slot bitmap also updates its native record when changed or freed. The registration is removed when its guest face wrapper is destroyed, so reusing that storage cannot write through a stale native pointer. Copying a bitmap onto itself follows FreeType's no-op behavior; unsupported shared-buffer aliases throw before freeing storage.
Refresh onto fetched main
e3d03fbae64e1b49e5d4e84e753ccce6edf60da5, preserving all merged FreeType features and their registrations/debt entries. The implementation and behavioral fixtures are unchanged. Rechecked newer main74f6fa8e312462bc4b373b5ec498b2eea2b28efcbefore publication: no FreeType production/test/debt file changed in that interval and the branch merges cleanly. Results are pinned to the submitted head, not a claim of rebuilding newer upstream commits.Tested
Submitted head
7f5367d4e4bb603746dbcb91eaaf4d2f490467b0.Windows 11 x64, WinLibs GCC 15.2.0 r7, Ninja Release, bundled dependencies,
BUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=OFF: full default build passed; 4/4 focused CTests passed, zero skips.Local Ubuntu 24.04.1 x86-64/WSL2 (6.6.87.2), GCC 13.3.0, glibc 2.39, same build options: complete
libsbuild plus selected executables passed; 4/4 focused CTests each passed three consecutive times. This covers the feature, existing base/charmap APIs and the 368-library packaged loader. No fresh title, console or macOS result is claimed.The earlier Linux release and bitmap sanitizer validation by @jotitadev is retained as attributed historical evidence: https://github.com/boykopovar/AnyPS5/pull/8286#issuecomment-6350224579. The fresh Linux results below are local, without sanitizers; no fresh sanitizer claim is made.
Whitespace and conventions checks pass. The bitmap refresh retains main's outline, charmap, face-info, list and size-request source/test registrations alongside its own bitmap registration.
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 nikowolf123 on 2026-10-20T22:04:30Z.
docs/dev/debt/libSceFreeType.md#L3adds a new### Bitmap handlingsection. CONTRIBUTING.md asks for entries "under the same###sections as the index". The index has only four: Build, Silent stubs, Unknown function info and Functional. The Conventions check does not compare section names, so it passes.tools/debt_split.pydoes sort sections in index order, though, so the nextsplitorresolvethat rewrites this file will moveBitmap handlingbelowFunctional. Earlier custom sections were moved into index sections after merge (ddb135643a,cb7fd81933,f2558e7be6).The same paragraph asks that an entry state the gap first (what differs from the console, what is unverified, what throws). In this entry the first two sentences describe the implementation, "console behavior and errors have not been measured" comes third, and what throws comes last. I would move the entry under the existing
### Unknown function info, after the FreeType 2.13.3 entry, and open with the gap, for example:Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T22:05:11Z.
I checked the current head and confirmed the debt entry still sits under the new
### Bitmap handlingheading.tools/debt_split.pyorders sections from the shared debt index, whose headings are Build, Silent stubs, Unknown function info and Functional; an extra heading can be reordered by the next split/resolve. The entry also says console behavior and errors are unmeasured only after describing the implementation. The suggested move toUnknown function infowith the unverified console behavior first matches the documented debt format.Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-22T01:56:20Z.
I opened #9550 to add FT_New_Size, FT_Activate_Size and FT_Done_Size. I declared #8286 for merge order because both patches insert declarations before GuestFace. The size objects and bitmap registration implement different functions; retain both sets of declarations when resolving that insertion.
Imported from boykopovar/AnyPS5. Originally posted by santhoshkumar-dev on 2026-10-22T07:37:35Z.
Addressed the requested documentation placement in
6133773304. The customBitmap handlingheading is removed; the bitmap entry is underUnknown function info, immediately after the general FreeType 2.13.3 entry. It starts with the unmeasured console behavior/error-code gap and documents unsupported alias cases. Conventions passes; this commit changes only paragraph placement.For #9550, confirmed the merge order: bitmap registration and the additional size-object declarations are distinct and both must be retained.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T09:32:28Z.
Review: COMMENTED
First Linux run (the PR lists Windows only). Ubuntu 26.04, glibc 2.43, x86_64 i7-8700, GCC 15.2.0, head
613377330merged--no-commitontoorigin/main7e2ba73e4(clean, the branch is ~680 commits behind).guest_freetype_bitmap,guest_freetype,guest_freetype_charmapandpatched_librariespass.-DANYPS5_ENABLE_ASAN=ON(ASan + UBSan + LeakSanitizer):guest_freetype_bitmappasses with no report, including the forced allocation failure and the repeated convert/cleanup cases.guest_freetypepasses too.guest_freetype_charmapfails under LeakSanitizer onmainas well (16920 bytes in 95 allocations, fromFT_Init_FreeType_nid_postfixandFT_New_Face_nid_postfixatGuestFreeTypeCharmap.cpp:83-85, never released). Same result with and without this PR.No control run: the
FT_Bitmap_*exports don't exist onmain, so the new test doesn't link there.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.