Chrome HDR artefacting fix
Chrome's GPU rasterizer tiles large composited layers, and a lingering will-change: transform keeps an image promoted to one of those layers indefinitely — on HDR gain-map photos scaled down to fit the page, that can leave visible seam lines at the tile boundaries. Drop the hint once the fade transition actually ends so the image reverts to normal (non-promoted) painting afterwards. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
@@ -32,6 +32,14 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
img.classList.add("loaded");
|
img.classList.add("loaded");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Chrome HDR artefacting fix
|
||||||
|
const clearWillChange = (e) => {
|
||||||
|
if (e.propertyName !== "transform") return;
|
||||||
|
img.style.willChange = "auto";
|
||||||
|
img.removeEventListener("transitionend", clearWillChange);
|
||||||
|
};
|
||||||
|
img.addEventListener("transitionend", clearWillChange);
|
||||||
|
|
||||||
if (img.complete && img.naturalHeight !== 0) {
|
if (img.complete && img.naturalHeight !== 0) {
|
||||||
onLoad(); // already loaded
|
onLoad(); // already loaded
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user