Skip to content

Offscreencanvas#39

Merged
jsulpis merged 6 commits intomainfrom
offscreencanvas
Mar 8, 2026
Merged

Offscreencanvas#39
jsulpis merged 6 commits intomainfrom
offscreencanvas

Conversation

@jsulpis
Copy link
Owner

@jsulpis jsulpis commented Mar 8, 2026

Close #26

Copilot AI review requested due to automatic review settings March 8, 2026 14:29
@vercel
Copy link

vercel bot commented Mar 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
usegl Ready Ready Preview, Comment Mar 8, 2026 3:22pm

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to close issue #26 by adding a playground demo and test coverage for running glCanvas on an OffscreenCanvas in a web worker, and by hardening parts of the runtime for non-DOM environments.

Changes:

  • Add an OffscreenCanvas + worker playground demo and include it in Playwright screenshot runs.
  • Change uniform update callbacks to include the changed uniform name/value, and add promise/media-driven re-render handling in glCanvas.
  • Rework texture loading to support worker-friendly async image decoding (createImageBitmap) and update Docker/compose test setup.

Reviewed changes

Copilot reviewed 13 out of 16 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
packages/gl/tests/screenshots.spec.ts Adds expected render count for the new offscreencanvas demo route.
packages/gl/tests/screenshots/offscreencanvas/offscreencanvas-android.png Adds Android screenshot baseline for the new demo.
packages/gl/src/passes/renderPass.ts Updates UpdatedCallback signature/docs to report per-uniform changes.
packages/gl/src/passes/compositeEffectPass.ts Forwards updated callback args transparently.
packages/gl/src/internal/setupUniforms.ts Emits per-uniform update events (name/value/oldValue + snapshot).
packages/gl/src/global/glContext.ts Avoids accessing document when unavailable (worker/SSR).
packages/gl/src/global/glCanvas.ts Uses globalThis.devicePixelRatio, refactors resize logic, and adds promise/media re-render watching.
packages/gl/src/core/texture.ts Removes placeholder flow, adds async loadTexture via fetch + createImageBitmap, tightens texture param typings.
packages/gl/playwright.config.ts Skips offscreencanvas on Safari/iPhone projects.
packages/gl/playground/src/workers/offscreenGradient.worker.ts Adds worker-side OffscreenCanvas rendering demo.
packages/gl/playground/src/pages/textures/texture.astro Updates texture example to use placeholder data + async texture assignment.
packages/gl/playground/src/pages/core/offscreencanvas.astro Adds the OffscreenCanvas playground page driving the worker and resize messages.
packages/gl/compose.yml Updates docker build context to use additional_contexts.
packages/gl/Dockerfile Updates Docker build to use additional contexts and Corepack tooling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jsulpis jsulpis merged commit 575b3c3 into main Mar 8, 2026
8 checks passed
@jsulpis jsulpis deleted the offscreencanvas branch March 8, 2026 15:25
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.

Check support for OffscreenCanvas

2 participants