Conversation
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
This branch has not been deployed
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
Cached glyphs are drawn as image fills from the glyph atlas with the following settings:
Tint { mode: AlphaMask }PadextendBefore this change, those fills took the generic painter path:
paint_bufapply_tintpassThat path was ~18% of single-threaded cached rendering.
This PR adds a fast path to
Fine'sEncodedPaint::Imagearm. It is taken when all of the following hold:AlphaMaskPadEncodedImageExt::integer_translation()returnsSome((dx, dy)), i.e. the transform is exactly[1, 0, 0, 1]with near-integer offsetsOn that path:
The converted tint colour is cached across commands. Everything else still uses the existing painters.
A unit test compares
pad_alpha_maskagainst a scalar reference, including offsets outside the image.Part 3 of 3 of the CPU glyph-cache speedups. It conflicts with the
Fineimage-resolve cache PR infine/mod.rs; whichever merges second needs a trivial rebase. On its own it speeds up single-threaded rendering. Multithreaded scaling additionally needs the resolve-cache PR, because this path still resolves the image, and so bumps the sharedArcrefcount, on every command.Measurements
Throwaway probe: 1600×1200 target, ~9.3k glyphs, 14px,
atlas_cache(true), mean of 60 warm frames on a noisy VM. Render time, main → this branch:All three PRs combined, at 14px:
For comparison, uncached rendering at 8 threads is 8.0 ms total.
Probe output is pixel-identical to main, with the cache both on and off.
cargo test -p vello_cpu -p vello_commonpasses.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/55344a6e161d48b4a3a8688fabe11d4c
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/55344a6e161d48b4a3a8688fabe11d4c?variant=devin-insiders
Requested by: @nicoburns