vello_hybrid: paint external textures through the regular image paint path - #110
Merged
Merged
Conversation
… path Paint::Resource now maps to an ImageSource::external_texture image paint in anyrender_paint_to_vello_hybrid_paint, so textures work for fill, stroke and glyphs, and the full ImageBrush (sampler + brush_transform) is honoured. Also reset the paint transform before drawing glyphs.
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
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.
Summary
This follows up #109. With
vello_gpu0.3, external textures are an ordinary image paint (ImageSource::external_texture, linebender/vello#1824). Soanyrender_vello_hybridno longer needs to treat them as a special case.anyrender_paint_to_vello_hybrid_paintnow mapsPaint::Resource(ImageBrush<ResourceId>)toPaintType::Image(ImageBrush { image: ImageSource::external_texture(id, full_texture_rect, true), sampler }). It looks the texture up intexture_bindingsand falls back to transparent when there is no binding.fillno longer has its ownPaint::Resourcebranch. Textures now work forfill,strokeanddraw_glyphs(and so inside layers too), as they already did for the vello backend.ImageBrushis now used: sampler extend modes, quality and alpha, plusbrush_transformon any shape.brush_transform: None, the texture is now anchored at the shape's coordinate origin. Before, it was anchored at the shape's bounding-box origin. This matchesanyrender_vello. Blitz custom widgets (e.g.examples/wgpu_texture) fill a rect at(0, 0), so they are unaffected.draw_glyphsnow callsreset_paint_transform(). Previously, glyph paints could inherit a stalebrush_transformleft over from an earlier fill or stroke.No public API changes. WebGL is unchanged, since it has no texture bindings.
Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/45dbc6c083354777aaa43442ce8ef8ab
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/45dbc6c083354777aaa43442ce8ef8ab?variant=devin-insiders
Requested by: @nicoburns