Repository navigation
Fill: a tile draws only the cells it overlaps, not the ones right of and below it too - #20
Merged
Merged
Conversation
…and below it too drawCells found a tile's cells with an inclusive far edge, so a tile that ends exactly where a cell starts drew that cell as well: a fill that hadn't moved drew up to four cells per tile instead of one (21 fills for 8 tiles in objects.js's new section 32b). The pixels were right, since the extra cells are clipped away; only the work was up to 4x. The far edges are exclusive now. task.md records the A/B measured after PR 19, in Chromium and in WebKitGTK 2.52, pre-PR master vs after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bjaj6ac9XGsjJWsPrMECjo
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bjaj6ac9XGsjJWsPrMECjo
pathanin
marked this pull request as ready for review
October 20, 2026 21:05
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 pathanin/paint#19, found while measuring it in WebKit.
The bug
drawCells(assets.js) found the fill cells a tile meets with an inclusive far edge. A tile that ends exactly where a cell starts therefore drew that cell too. So a fill that hadn't moved drew up to four cells per tile instead of one.fill()21 times before this fix, and 8 after.The fix makes the far edges exclusive. A tile that partly overlaps a cell, as with a moved or scaled fill, still draws it.
A/B for PR 19 + this fix
Pre-PR
master(2315e42) against after, at 4000², on a software GPU. Run in-page with the same script in Playwright's Chromium and in WebKitGTK 2.52's MiniBrowser. MiniBrowser came from Ubuntu'swebkit2gtk-driver, run under Xvfb and driven over WebDriver, because Playwright's WebKit download is blocked in that environment.Pencil scribble (300 frames, 4 moves each), main-thread ms per frame:
Chromium's wall time for the scribble dropped from 99 s to 37 s.
Background fill around 12 rings, medians of 3 runs:
Before this fix, PR 19 alone measured 1023 ms total in WebKit.
Picker: about 1–2 ms in both engines before and after, when the GPU is idle.
WebKit functional pass (WebKitGTK 2.52)
These all check out:
Save and reopen in WebKit, compared with the picture before saving:
masterAll 3,757 are translucent pixels, changed by WebKit's premultiplied-alpha rounding. That rounding predates this work and also shows on
master; Chrome's round trip is exact.task.mdlists it as open.Testing
master: libs and filledge each fail one check, identically onmaster(2315e42) here, and both passed in CI on the merged PR 19.🤖 Generated with Claude Code
https://claude.ai/code/session_01Bjaj6ac9XGsjJWsPrMECjo