mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-04 22:35:08 +00:00
fix(vegas): smooth Vegas scroll pacing -- whole pixels per refresh, measured refresh, off-thread preview writes (#628)
Vegas scrolls a whole number of pixels per panel refresh, locked to SwapOnVSync, against the refresh the panel really holds (measured from swap gaps), instead of blending sub-pixel positions against the refresh cap. The web preview PNG is encoded off the render thread while scrolling, with writes ordered and retried. On hdpi, late frames fell from 6.3% to 0.7%. See docs/SCROLL_PERFORMANCE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -837,6 +837,10 @@ class TestCycleEndsBeforeWrap:
|
||||
return p
|
||||
|
||||
def _advance_to(self, pipeline, distance):
|
||||
# render_frame() steps before it checks, and a whole-pixel pace steps
|
||||
# a fixed amount; start one step short so the checked frame is at
|
||||
# `distance`.
|
||||
distance -= pipeline.scroll_helper.fixed_pixels_per_frame or 0
|
||||
pipeline.scroll_helper.total_distance_scrolled = distance
|
||||
pipeline.scroll_helper.scroll_position = float(distance)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user