Skip to content

Support Extend::None (decal) for images in vello, vello_cpu and vello_hybrid - #3

Open
nicoburns wants to merge 1 commit into
mainfrom
devin/1786399510-extend-none
Open

nicoburns wants to merge 1 commit into
mainfrom
devin/1786399510-extend-none

Conversation

@nicoburns

Copy link
Copy Markdown
Member

Summary

Implements peniko::Extend::None (Skia's "decal" tile mode: transparent outside the image) for image sampling in all three renderers, enabling native CSS background-repeat: no-repeat without renderer-side clipping workarounds. Depends on DioxusLabs/peniko#1; Cargo.toml pins peniko to that commit (rev = "4409521...").

Core sampling rule, applied uniformly:

  • Coordinates are still clamped for safe texture/memory access (Pad and None share the clamp path).
  • Transparency is applied via per-tap validity masks/weights computed from the unclamped coordinate: nearest zeroes the whole sample when out of bounds; bilinear/bicubic zero only the out-of-range taps, so valid edge taps still contribute (no edge-color smearing into the transparent region).

Per renderer:

  • vello_cpu: in_bounds_mask/mask_to_weights/apply_mask helpers in fine/common/image.rs, used by the nearest/bilinear/bicubic painters in both the f32 and u8 (lowp) kernels, including the axis-aligned fast paths.
  • classic vello: fine.wgsl gains EXTEND_NONE, extend_mode_unclamped, and tap_weight; nearest/bilinear/bicubic image sampling multiply taps by decal weights. The existing 2-bit extend fields in the packed encoding already fit value 3, so no encoding change.
  • vello_hybrid: same treatment in render.wesl for the atlas and external-texture paths (nearest/bilinear/bicubic).

EncodedImage::may_have_transparency is now forced when either axis uses Extend::None, so the sparse-strips renderers composite instead of overwriting the background (an Extend::None fill is inherently non-opaque outside the image).

Gradients don't get new behavior: Extend::None on a gradient falls back to Pad.

New snapshot tests: image_none_x_none_y{,_bilinear,_bicubic}, image_none_x_repeat_y, image_repeat_x_none_y, passing on all CPU variants and hybrid. (Running the hybrid tests locally requires mesa-vulkan-drivers/lavapipe, matching CI.)

Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/bfa7c4cb42024f28989602f3e38728aa
Requested by: @nicoburns

@nicoburns nicoburns self-assigned this Aug 10, 2026
@staging-devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

This branch has not been deployed

No deployments
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