Waveform: batch grid lines into one geometry per render#12072
Merged
Conversation
With grid lines enabled, the grid was drawn as hundreds of individual DrawLine calls per frame (a vertical line every ~10 px plus matching horizontals) - real scene-graph overhead at 60 fps during playback. Collect the positions and draw the whole grid as a single StreamGeometry, the same approach the timeline ticks already use. Co-Authored-By: Claude Fable 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.
Follow-up to #12069.
With grid lines enabled,
DrawAllGridLinesissued onecontext.DrawLineper grid line — at default zoom that's ~250–400 separate scene-graph draw ops per render, 60 times a second during playback. The timeline ticks already solved this with aStreamGeometrybatch (DrawVerticalLineBatch); the grid never got the same treatment.The vertical/horizontal line positions are computed exactly as before (same 0.1 s / 1 s intervals, same frame-boundary stepping in frame mode, same square-grid spacing), collected into a pooled list, and drawn with a single
DrawGeometrycall.Verified visually on macOS — grid rendering is unchanged. All 512 UI tests pass.
🤖 Generated with Claude Code