Repository navigation
feat(canvas): draw quads and sprites through compiled shaders - #2506
Merged
Merged
Conversation
oneo-me
marked this pull request as ready for review
November 26, 2026 10:48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
oneo-me
force-pushed
the
agiox/canvas-shader-drawing
branch
from
November 26, 2026 11:07
a76728f to
39b495b
Compare
oneo-me
enabled auto-merge (rebase)
November 26, 2026 11:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2260
A
Canvasdrawing can now run a compiledShaderProgramin its order, under its transform, clip, alpha and composite operator.program.Paint(uniforms, images...)makes acore.ShaderPaint. AnAnimatedNodeuniform becomes a drawing slot (ArgLane), so it redraws on the frame clock without a commit.Drawing.DrawShader(paint, x, y, w, h)shades a rectangle, withposin its own points.Drawing.SetShader(paint)/ClearShader()shade the images thatDrawImage*,DrawAtlasandDrawVerticesdraw.SaveandRestorekeep the setting. The drawn image isimage0, read atdst.xyin its pixels. A whole run of SDF glyphs is oneDrawAtlasop and one GPU pass.internal/platform/canvasshadelays out each shaded op as one pass in the target's pixels. Each backend renders that pass into a texture and the canvas player draws it in device space:DrawShaderout and draw shaded images plain. This is recorded in the roadmap.Tests
canvastest.Shadingis a shared sample. It checks:destination-over, rotation and stretchedpos/rectSize.TestCanvasShadingpasses on macOS, the iOS simulator, the web (headless Chrome), Windows 11, and Linux under Wayland, X11 and llvmpipe.BenchmarkPlayAtlas/BenchmarkPlayShadedAtlas(500 glyphs):🤖 Generated with Claude Code
🤖 Claude Opus 5.5