Skip to content

perf(2d): reuse a canvas source's pixels until it changes - #196

Merged
triniwiz merged 1 commit into
masterfrom
perf/draw-image-canvas-source
Nov 8, 2026
Merged

triniwiz merged 1 commit into
masterfrom
perf/draw-image-canvas-source

Conversation

@triniwiz

@triniwiz triniwiz commented Nov 8, 2026

Copy link
Copy Markdown
Member

Drawing a canvas or OffscreenCanvas into another read it back from the GPU (and, when threaded, waited on its render thread) on every call. The last image is now reused until the source is drawn to again.

Stamping ~1000 sprites from an OffscreenCanvas per frame on Linux: 1–2 fps → 60 fps.

drawImage, createPattern and friends read a canvas back from the GPU, and a
threaded one through its render thread, on every call. Both now reuse the last
image while nothing was drawn.
@coderabbitai

coderabbitai Bot commented Nov 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0efafc2c-0a59-40d3-a266-ec4ac0dcd431

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@triniwiz
triniwiz merged commit a3303b8 into master Nov 8, 2026
25 checks passed
@triniwiz
triniwiz deleted the perf/draw-image-canvas-source branch November 8, 2026 13:16
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

ℹ️ Note: npm publishing is disabled for pull requests.
Publishing is performed only from tag pushes via the npm Release workflow.
If you need a test publish, merge to master — pushes publish pr-tagged prereleases.

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.

1 participant