Skip to content

Feat: Extend platform abstraction#746

Merged
wouterlucas merged 14 commits intomainfrom
feat/platform-abstraction
Feb 25, 2026
Merged

Feat: Extend platform abstraction#746
wouterlucas merged 14 commits intomainfrom
feat/platform-abstraction

Conversation

@wouterlucas
Copy link
Contributor

@wouterlucas wouterlucas commented Feb 18, 2026

Move Image creation and GL wrapper to Platform.

This PR changes:

  • createImageBitmap support to Platform
  • Image fetch to Platform (by default using XMLHttpRequest)
  • ImageWorker handling to Platform
  • GLWrapper to Platform
  • Similar, support for TX compression and SVG handling has been moved to Platform

Removed:

  • createImageBitmap auto detection - this needs to be done by Platform
  • Image Fallback handling - this is done by Platform

NOTE: BREAKING CHANGES
This requires a different Platform import / init to make it work.

The concept is you create a Platform that matches the functionality the platform exposes. I.e. if the Platform does not support createImageBitmap or a less version of createImageBitmap you should extend the platform to match that.

@estobbart for ION you can create or upstream an ION specific platform (or we can create one) that:

  • Replace loadImage and createImage in Platform (possibly Fetch too?)
  • Replace the respective GL function

Todo:

  • Expose platforms in exports
  • Create Legacy Platform for non-createImageBitmap platform
  • Create Chrome 50 createImageBitmap platform
  • Create fetch supported platform

@wouterlucas wouterlucas added breaking change! This issue / PR may require downstream dependencies to make changes to retain existing functionality ION labels Feb 18, 2026
@wouterlucas wouterlucas force-pushed the feat/platform-abstraction branch from 26467af to dd3a25e Compare February 19, 2026 15:49
@wouterlucas wouterlucas marked this pull request as ready for review February 20, 2026 15:10
Copy link
Collaborator

@estobbart estobbart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of questions..
L2 had a force draw capability so that every raf would draw, is that possible here?

@wouterlucas wouterlucas merged commit ce8da66 into main Feb 25, 2026
2 checks passed
@wouterlucas wouterlucas deleted the feat/platform-abstraction branch February 25, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change! This issue / PR may require downstream dependencies to make changes to retain existing functionality ION

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants