Repository navigation
Fix native MV blur for noncanonical premultiplied pixels - #17
Merged
bbbreaddd merged 2 commits intoNov 15, 2026
Merged
Conversation
blurMv used the x86 Skia65 encoding of alpha 1/9 ((c*29)>>8), so on arm64 its result differed from the stock Bitmap.blur (round(c/9)) in most pixels, and it refused canvases with alpha-zero RGB, falling back to the ~2 s stock blur (e.g. snapshots taken during a white screen tint). The gate now measures once, through the same Canvas operations the stock blur uses, a per-channel scale table and the source-over batch width that decides which alpha-zero pixels survive the pad copy. The native blur uses the table and rebuilds the padded copy with that batch rule; if the batch width cannot be measured, alpha-zero content still falls back to stock. Adds node-mv-blur-equivalence: byte-exact comparison of native blurMv with the stock blur over canonical, over-alpha, opaque, transparent and alpha-zero content at many sizes (3,025 cases pass on the RG40XX-H). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Native MV blur currently rejects snapshots whose premultiplied RGB exceeds alpha, sending additive and fade snapshots through the stock Canvas path.
Accept pixels with nonzero alpha directly. For nonzero RGB at zero alpha, use the existing rasterizer for the first pass's five padded source-over copies, then run the separable convolution. Keep the existing browser-compatible rounding and native API.
Validation:
The accelerated-browser Canvas parity TODO is unchanged; pixel equivalence above targets the pinned CPU reference.