feat(libSceNKWebKit): implement WebCore::nativeImageSize for cairo surfaces #23493

Closed
noisyweather wants to merge 3 commits from upstream-pr/23493 into main
noisyweather commented 2026-11-19 05:07:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by noisyweather on 2026-11-19T05:07:10Z.


What

Follow NativeImageCairo.cpp and cairoSurfaceSize from WebKit 73a35b43:
a null RefPtr or a non-image surface gives an empty IntSize, an image
surface gives its width and height through libcairo.

Co-Authored-By: Claude Opus 5.5 [email protected]

Tested

  • Built affected library and unit test target cleanly with Ninja on Linux.
  • Ran and passed the new CTest unit tests locally.
  • Verified with tools/debt_fold.py --check and tools/check_conventions.py.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on:
  • Fixes:
  • Unblocks:
  • GPUs tested:
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5389185004 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23493). Originally posted by [noisyweather](https://github.com/noisyweather) on 2026-11-19T05:07:10Z. --- ### What Follow NativeImageCairo.cpp and cairoSurfaceSize from WebKit 73a35b43: a null RefPtr or a non-image surface gives an empty IntSize, an image surface gives its width and height through libcairo. Co-Authored-By: Claude Opus 5.5 <[email protected]> ### Tested - Built affected library and unit test target cleanly with Ninja on Linux. - Ran and passed the new CTest unit tests locally. - Verified with `tools/debt_fold.py --check` and `tools/check_conventions.py`. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes (Claude Code) <!-- yes / no -->
PrivacyOnion commented 2026-11-19 05:10:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T05:10:39Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 9e130bf60c:

  • Conventions: tools/check_conventions.py failed.
    (pull request): error: [pr-template] Fill in the pull request template: add the '### What' heading of the template
    (pull request): error: [pr-template] Fill in the pull request template: add the '### Tested' heading of the template
    (pull request): error: [pr-template] Fill in the pull request template: add the '### Checklist' heading of the template
    3 findings, 3 errors; GitHub shows at most 10 error annotations, the job summary lists all
    
  • Build: nkwebkit_nativeimagecairo_tests, nkwebkit_refptrcairo_tests built cleanly.
  • CTest (nkwebkit_nativeimagecairo, nkwebkit_refptrcairo):
    1/2 Test #4614: nkwebkit_refptrcairo .............   Passed    0.01 sec
    2/2 Test #4595: nkwebkit_nativeimagecairo ........   Passed    0.01 sec
    100% tests passed, 0 tests failed out of 2
    

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5969641308 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23493#pullrequestreview-5969641308). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T05:10:39Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `9e130bf60c`: - **Conventions**: `tools/check_conventions.py` failed. ``` (pull request): error: [pr-template] Fill in the pull request template: add the '### What' heading of the template (pull request): error: [pr-template] Fill in the pull request template: add the '### Tested' heading of the template (pull request): error: [pr-template] Fill in the pull request template: add the '### Checklist' heading of the template 3 findings, 3 errors; GitHub shows at most 10 error annotations, the job summary lists all ``` - **Build**: `nkwebkit_nativeimagecairo_tests`, `nkwebkit_refptrcairo_tests` built cleanly. - **CTest** (`nkwebkit_nativeimagecairo`, `nkwebkit_refptrcairo`): ``` 1/2 Test #4614: nkwebkit_refptrcairo ............. Passed 0.01 sec 2/2 Test #4595: nkwebkit_nativeimagecairo ........ Passed 0.01 sec 100% tests passed, 0 tests failed out of 2 ``` Requesting changes for the points above.
MarcZX10 commented 2026-11-19 05:12:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T05:12:33Z.

Review: APPROVED


Reviewed — looks good

The inspected implementation follows the stated null, image-surface, and non-image behavior; I did not run the tests, and Export.cpp was not fully read.

What I ran

Reviewed head 9e130bf60c8c41f7fe8df363e78e2e1e174fc1a3 and its prepared diff. No build or test command was run.

Results

Check Result Note
Source review passed Changed implementation and tests inspected
Build and tests not run No execution environment used

Findings

Blocking

None.

Non-blocking

None.

Not verified

  • Export.cpp was read only around removed stubs, not in full; no claim is made about unrelated code in that file.
  • Build, automated test execution, console behavior, and import compatibility against the console module were not verified.
  • Read: CMakeLists.txt, LegacyExports.hpp, both new export headers, libSceNKWebKit.hpp, both new source files, both new test files, both debt notes, plus the prepared description, commits, manifest, and diff. files.json was unavailable; the review folder listing showed Export.cpp excluded as too large. All other changed files were read.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5969656413 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23493#pullrequestreview-5969656413). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T05:12:33Z. **Review:** APPROVED --- # Reviewed — looks good The inspected implementation follows the stated null, image-surface, and non-image behavior; I did not run the tests, and `Export.cpp` was not fully read. ## What I ran Reviewed head `9e130bf60c8c41f7fe8df363e78e2e1e174fc1a3` and its prepared diff. No build or test command was run. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Changed implementation and tests inspected | | Build and tests | not run | No execution environment used | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified - `Export.cpp` was read only around removed stubs, not in full; no claim is made about unrelated code in that file. - Build, automated test execution, console behavior, and import compatibility against the console module were not verified. - Read: `CMakeLists.txt`, `LegacyExports.hpp`, both new export headers, `libSceNKWebKit.hpp`, both new source files, both new test files, both debt notes, plus the prepared description, commits, manifest, and diff. `files.json` was unavailable; the review folder listing showed `Export.cpp` excluded as too large. All other changed files were read. ## To get this to a good state Nothing is required.
PrivacyOnion commented 2026-11-20 00:30:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T00:30:13Z.

Review: CHANGES_REQUESTED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against e4674c4ba4:

  • Conventions: tools/check_conventions.py failed.
    (pull request): error: [pr-template] Fill in the pull request template: fill Depends on with #N or none
    1 findings, 1 errors; GitHub shows at most 10 error annotations, the job summary lists all
    
  • Build: guest_cairo_context_font_options_tests, guest_cairo_context_guest_pointers_tests, guest_cairo_context_tests, guest_cairo_drawing_tests, guest_cairo_geometry_tests, guest_cairo_glyph_drawing_tests, guest_cairo_graphics_state_tests, guest_cairo_path_extents_tests, guest_cairo_path_tests, guest_cairo_png_tests, guest_cairo_surface_pattern_tests, guest_cairo_surface_tests, guest_cairo_surface_user_data_allocation_tests, guest_cairo_surface_user_data_tests, guest_cairo_toy_text_tests, nkwebkit_nativeimagecairo_tests, nkwebkit_refptrcairo_tests built cleanly.
  • CTest (nkwebkit_nativeimagecairo, nkwebkit_refptrcairo, guest_cairo_surface_pattern_patterns, guest_cairo_surface_pattern_source, guest_cairo_surface_pattern_mask, guest_cairo_glyph_drawing_show, guest_cairo_glyph_drawing_errors, guest_cairo_glyph_drawing_path, guest_cairo_context_font_options_values, guest_cairo_context_font_options_render, guest_cairo_context_font_options_errors, guest_cairo_png, guest_cairo_surface, guest_cairo_surface_user_data, guest_cairo_surface_user_data_allocation, guest_cairo_context, guest_cairo_graphics_state, guest_cairo_path, guest_cairo_geometry, guest_cairo_path_extents, guest_cairo_drawing, guest_cairo_context_guest_pointers, guest_cairo_toy_text):
    13/23 Test #5479: guest_cairo_png ............................   Passed    0.01 sec
    14/23 Test #5482: guest_cairo_surface ........................   Passed    0.01 sec
    15/23 Test #5483: guest_cairo_surface_user_data ..............   Passed    0.01 sec
    16/23 Test #5484: guest_cairo_surface_user_data_allocation ...   Passed    0.01 sec
    17/23 Test #5485: guest_cairo_context ........................   Passed    0.02 sec
    18/23 Test #5490: guest_cairo_path ...........................   Passed    1.41 sec
    19/23 Test #5492: guest_cairo_geometry .......................   Passed    0.02 sec
    20/23 Test #5493: guest_cairo_path_extents ...................   Passed    0.02 sec
    21/23 Test #5494: guest_cairo_drawing ........................   Passed    0.02 sec
    22/23 Test #5495: guest_cairo_context_guest_pointers .........   Passed    0.02 sec
    23/23 Test #5488: guest_cairo_graphics_state .................   Passed    2.71 sec
    100% tests passed, 0 tests failed out of 23
    

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5985666384 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23493#pullrequestreview-5985666384). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-20T00:30:13Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `e4674c4ba4`: - **Conventions**: `tools/check_conventions.py` failed. ``` (pull request): error: [pr-template] Fill in the pull request template: fill Depends on with #N or none 1 findings, 1 errors; GitHub shows at most 10 error annotations, the job summary lists all ``` - **Build**: `guest_cairo_context_font_options_tests`, `guest_cairo_context_guest_pointers_tests`, `guest_cairo_context_tests`, `guest_cairo_drawing_tests`, `guest_cairo_geometry_tests`, `guest_cairo_glyph_drawing_tests`, `guest_cairo_graphics_state_tests`, `guest_cairo_path_extents_tests`, `guest_cairo_path_tests`, `guest_cairo_png_tests`, `guest_cairo_surface_pattern_tests`, `guest_cairo_surface_tests`, `guest_cairo_surface_user_data_allocation_tests`, `guest_cairo_surface_user_data_tests`, `guest_cairo_toy_text_tests`, `nkwebkit_nativeimagecairo_tests`, `nkwebkit_refptrcairo_tests` built cleanly. - **CTest** (`nkwebkit_nativeimagecairo`, `nkwebkit_refptrcairo`, `guest_cairo_surface_pattern_patterns`, `guest_cairo_surface_pattern_source`, `guest_cairo_surface_pattern_mask`, `guest_cairo_glyph_drawing_show`, `guest_cairo_glyph_drawing_errors`, `guest_cairo_glyph_drawing_path`, `guest_cairo_context_font_options_values`, `guest_cairo_context_font_options_render`, `guest_cairo_context_font_options_errors`, `guest_cairo_png`, `guest_cairo_surface`, `guest_cairo_surface_user_data`, `guest_cairo_surface_user_data_allocation`, `guest_cairo_context`, `guest_cairo_graphics_state`, `guest_cairo_path`, `guest_cairo_geometry`, `guest_cairo_path_extents`, `guest_cairo_drawing`, `guest_cairo_context_guest_pointers`, `guest_cairo_toy_text`): ``` 13/23 Test #5479: guest_cairo_png ............................ Passed 0.01 sec 14/23 Test #5482: guest_cairo_surface ........................ Passed 0.01 sec 15/23 Test #5483: guest_cairo_surface_user_data .............. Passed 0.01 sec 16/23 Test #5484: guest_cairo_surface_user_data_allocation ... Passed 0.01 sec 17/23 Test #5485: guest_cairo_context ........................ Passed 0.02 sec 18/23 Test #5490: guest_cairo_path ........................... Passed 1.41 sec 19/23 Test #5492: guest_cairo_geometry ....................... Passed 0.02 sec 20/23 Test #5493: guest_cairo_path_extents ................... Passed 0.02 sec 21/23 Test #5494: guest_cairo_drawing ........................ Passed 0.02 sec 22/23 Test #5495: guest_cairo_context_guest_pointers ......... Passed 0.02 sec 23/23 Test #5488: guest_cairo_graphics_state ................. Passed 2.71 sec 100% tests passed, 0 tests failed out of 23 ``` Requesting changes for the points above.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!23493
No description provided.