Skip to content

feat(tvos): add Canvas platform support - #144

Merged
triniwiz merged 1 commit into
NativeScript:masterfrom
LorenzGit:contrib/tvos-support
Sep 9, 2026
Merged

feat(tvos): add Canvas platform support#144
triniwiz merged 1 commit into
NativeScript:masterfrom
LorenzGit:contrib/tvos-support

Conversation

@LorenzGit

@LorenzGit LorenzGit commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Add native tvOS targets, Rust platform gates, Siri Remote forwarding, tvOS storage/media guards, and CanvasSVG configuration. Keep OpenGL ES enabled on tvOS and exclude the private Cargo path override.

Validation

Both arm64 tvOS CanvasNative slices built from source. The pinned integration app passes platform, Canvas 2D, WebGL and WebGPU checks on the simulator. Current V8 requires #147; compute-only mapping also needs #148. The reviewer setup supplies the pinned rust-skia override until that dependency lands.

Reproduce

Revision-pinned reviewer setup builds the companion stack in an isolated workspace. It includes commands, requirements, dependency pins and physical-device limitations. No binary artifacts or private development paths are committed.

This PR contains one commit, 1dffcabf119046d7bea2c402150be24f0982ff1a, changing 41 files against 1fd6ef470dfdfd43b3385fa7ef43feddd1debd06. Its exported patch reproduces the committed tree from a fresh base index.

The source-built runtime was validated in the prepared runtime checkout; companion clones, native helpers, Canvas and clean npm installation were validated in a separate workspace on the same Mac. A second machine and one uninterrupted cold all run have not been tested.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 889dbaac-2e79-433c-8877-5b394f3d7554

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LorenzGit
LorenzGit force-pushed the contrib/tvos-support branch from 193234f to 1dffcab Compare September 8, 2026 16:21
@LorenzGit
LorenzGit marked this pull request as ready for review September 8, 2026 18:44
@triniwiz
triniwiz merged commit f2f6a56 into NativeScript:master Sep 9, 2026
1 check passed
triniwiz added a commit that referenced this pull request Sep 14, 2026
Brings in #144-#149. Conflict resolution notes:

* #147 (V8 14 native bridge) overlapped almost entirely with the V8 14
  migration this branch already carries. Both sides fix the same API break;
  master does it with dual-version shims (canvas::GetAlignedPointer,
  canvas::Receiver, CANVAS_FAST_FUNCTION, #if V8_MAJOR_VERSION >= 14) so one
  tree can build against V8 10.3 and 14, while this branch targets a single
  vendored V8 14.9 (tools/scripts/download-v8.sh) and calls the native APIs
  directly. 118 of the 127 conflicting sources were that difference alone --
  after rewriting master's shims into this branch's idiom, 112 compared
  byte-identical -- so those keep this branch's spelling and the now-unused
  shim block is dropped from Common.h.

* Master's shims also compile fast API calls out on V8 >= 14
  (CANVAS_FAST_FUNCTION -> v8::CFunction{}, c_function -> nullptr). V8 14.9
  still declares both FunctionTemplate::New(..., const CFunction*) and
  NewWithCFunctionOverloads, and this branch's fast paths are built against
  it, so taking that would have silently disabled every fast call in the
  binding layer. Helpers.h keeps this branch's version; the four
  CANVAS_FAST_FUNCTION call sites that auto-merged into
  OES_vertex_array_objectImpl and WEBGL_draw_buffersImpl -- no conflict was
  raised for those -- are restored to v8::CFunction::Make.

* Master's *Array fast overloads are all guarded #if V8_MAJOR_VERSION < 14,
  so they are dead on 14 and equivalent to this branch having removed them.

* #149 (ImageData double free) applies unchanged. canvas_native_image_data_get_data
  borrows its argument and returns a U8Buffer holding a second refcounted
  handle to the same pixels, so ImageDataBuffer must release only the buffer --
  ~ImageDataImpl already releases the ImageData. The comment is reworded from
  master's, which described the buffer as owning a clone of the pixel storage;
  it is a shared handle, and that is what makes the JS data view live.

* Package versions stay on the 3.0.0-alpha line.
* canvas-release.aar keeps this branch's binary; it predates the Android
  render fixes in 638a265 and needs rebuilding from the merged sources.
triniwiz added a commit that referenced this pull request Sep 14, 2026
triniwiz/rust-skia 91bf15b -> 1eafe30 (skia-safe 0.101.0 -> 0.153.4). No
source changes needed: FontMgr::new_from_data, fixed up in the 0.101 bump,
is the only break either step introduced, and canvas-2d, canvas-core and
canvas-svg all build clean.

The fork's platform support grew tvOS alongside visionOS
(skia-bindings/build_support/platform/{tvos,visionos}.rs), which lines up
with the tvOS targets #144 added to the Makefile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants