Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 69f04237d9621ed418b2b9f7fe0c08cd97b1bd58
https://github.com/WebKit/WebKit/commit/69f04237d9621ed418b2b9f7fe0c08cd97b1bd58
Author: Ahmad Saleem <[email protected]>
Date: 2026-09-21 (Mon, 21 Sep 2026)
Changed paths:
M Source/WebCore/platform/graphics/cg/CGSubimageCacheWithTimer.h
Log Message:
-----------
CGSubimageCacheWithTimer's cache hash uses only the truncated x/y origin and
drops the subimage width and height
https://bugs.webkit.org/show_bug.cgi?id=324084
rdar://187311592
Reviewed by Kimmo Kinnunen.
CacheHash::hash() packed only the subimage rect's origin into the hash,
casting rect.x() and rect.y() to unsigned and OR-ing them into a single
32-bit value ((x << 16) | y). This had three problems:
- Width and height were never mixed in, so every subimage of a given
image sharing the same top-left corner but differing in size hashed
to the same bucket. Since equal() compares the full FloatRect, these
remained distinct entries that all probed the same slot.
- The << 16 pack overflows and drops high bits once a coordinate is
>= 65536, aliasing large images.
- Fractional coordinates were truncated to unsigned before hashing.
Replace the hand-rolled packing with computeHash(), mixing the image
pointer and all four rect components (x, y, width, height) through
WTF::Hasher, which handles the float values directly. This is purely a
hash-quality improvement; correctness was already guaranteed by the
full-rect comparison in equal().
* Source/WebCore/platform/graphics/cg/CGSubimageCacheWithTimer.h:
Canonical link: https://commits.webkit.org/321509@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications