Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7ae2169425c43f66c76f1c50c7722d379cf1f0c2
https://github.com/WebKit/WebKit/commit/7ae2169425c43f66c76f1c50c7722d379cf1f0c2
Author: Simon Fraser <[email protected]>
Date: 2025-10-13 (Mon, 13 Oct 2025)
Changed paths:
M Source/WebCore/platform/graphics/NativeImage.cpp
M Source/WebCore/platform/graphics/NativeImage.h
M Source/WebCore/platform/graphics/cg/NativeImageCG.cpp
Log Message:
-----------
Cache Headroom on NativeImage
https://bugs.webkit.org/show_bug.cgi?id=300650
rdar://162553270
Reviewed by Said Abou-Hallawa.
Profiling shows that each call to `RenderImage::paintReplaced()` calls
`NativeImage::headroom()` twice,
and this adds up to about 13% of the time under `RenderImage::paintReplaced()`;
there's some CG overhead.
Avoid this by caching headroom on the NativeImage.
This is intended to offset some of the cost of implementing
LargestContentfulPaint.
* Source/WebCore/platform/graphics/NativeImage.cpp:
(WebCore::NativeImage::NativeImage):
(WebCore::NativeImage::replacePlatformImage):
(WebCore::NativeImage::computeHeadroom):
* Source/WebCore/platform/graphics/NativeImage.h:
* Source/WebCore/platform/graphics/cg/NativeImageCG.cpp:
(WebCore::NativeImage::computeHeadroom):
(WebCore::NativeImage::headroom const):
Canonical link: https://commits.webkit.org/301459@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes