Repository navigation
PDF: the next page drawn sharp, and zooming waits less (#388) - #412
Merged
Merged
Conversation
…de copies nothing Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Zoomed in, every tile drew its page image and detail patches whole under a clip, and dark pages drew them whole a second time: 60-150 megapixels of source in a frame on the iPad (discussion #400). drawWithin (canvas/night.ts) draws the source rect the tile shows, mapped as before: at most 29 MP. The worst frame per pinch did not change (238-283 ms before, 223-271 after), so this is less work, not the fix for the remaining stalls. Co-Authored-By: Claude Opus 5.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.
Fixes #388. Part of discussion #400 (PDF zoom lag).
What changed
Renderer.coverDryputs a new canvas in place of the old one and keeps the old one as the fade's cover. The copy made the iPad wait for WebKit to finish the whole layer.drawWithin, incanvas/night.ts), and so does the dark-page pass. The pixels are the same, and far less image is drawn mid-zoom.Proof
All on Joost's iPad over the bridge.
drawWithin(light pages, four runs per build): the most image drawn in one frame fell from 60–150 MP to at most 29 MP. The worst frame per run is unchanged: 238–283 ms before, 223–271 ms after. That frame is the zoom-out landing on the page grid, so this is less work, not the fix for the stalls. The dark-page pass was changed after the device runs and is covered by tests only.pdf-backdrop.test.ts,coverDryinrenderer-overscan.test.ts,shownRegioninpdf-raster.test.ts, source-rect draws inpdf-display.test.tsand in the dark-page pass innight.test.ts.npm run gates: all 11 steps green. On an earlier run,library-view.test.tsfailed once under load; it's a read-queue timing test this branch doesn't touch, and it passed 3 of 3 alone.check.mjs --changed: no finding in PDF painting. Its 7 text-ellipsis groups are in scenes this branch doesn't touch; the nightly already reports 6 such groups on main.Test on the device
Not verified
whole=on the overlay now counts the fades too; a strip landing can start a second fade right after the first; the ink-surface side of the swap has no test of its own.🤖 Generated with Claude Code