[webkit-reviews] review granted: [Bug 270492] [IFC] Let's try to reuse previously computed breaking positions : [Attachment 470296] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 11 12:05:21 PDT 2024


Antti Koivisto <koivisto at iki.fi> has granted  review:
Bug 270492: [IFC] Let's try to reuse previously computed breaking positions
https://bugs.webkit.org/show_bug.cgi?id=270492

Attachment 470296: Patch

https://bugs.webkit.org/attachment.cgi?id=470296&action=review




--- Comment #9 from Antti Koivisto <koivisto at iki.fi> ---
Comment on attachment 470296
  --> https://bugs.webkit.org/attachment.cgi?id=470296
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=470296&action=review

>
Source/WebCore/layout/formattingContexts/inline/text/TextBreakingPositionCache.
h:80
> +} // namespace Layout
> +} // namespace WebCore
> +
> +namespace WTF {
> +
> +template<> struct HashTraits<WebCore::Layout::TextBreakingPositionContext> :
GenericHashTraits<WebCore::Layout::TextBreakingPositionContext> {
> +    static void
constructDeletedValue(WebCore::Layout::TextBreakingPositionContext& slot) {
slot.isHashTableDeletedValue = true; }
> +    static bool isDeletedValue(const
WebCore::Layout::TextBreakingPositionContext& value) { return
value.isHashTableDeletedValue; }
> +    static WebCore::Layout::TextBreakingPositionContext emptyValue() {
return { }; }
> +};
> +
> +template<> struct DefaultHash<WebCore::Layout::TextBreakingPositionContext>
: WebCore::Layout::TextBreakingPositionContextHash { };
> +
> +} // namespace WTF
> +
> +namespace WebCore {
> +namespace Layout {

maybe put the HashTraits goo the the end of the file to avoid bouncing between
namespaces?

> Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:1127
> +    Layout::TextBreakingPositionCache::singleton().clear();

It would bet better to call this directly from MemoryRelease.cpp since now it
gets unnecessarily called repeatedly for each LineLayout


More information about the webkit-reviews mailing list