New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't call FontCache invalidation callbacks when clearing FontCaches in response to memory pressure #10117
Draft
heycam
wants to merge
1
commit into
WebKit:main
Choose a base branch
from
heycam:font-cache-invalidate-callback
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
heycam
added
the
Text
For bugs in text layout and rendering, including international text support.
label
Feb 15, 2023
EWS run on previous version of this PR (hash 1b29d3a) |
β¦in response to memory pressure https://bugs.webkit.org/show_bug.cgi?id=251560 <rdar://problem/105197603> Reviewed by NOBODY (OOPS!). As of https://bugs.webkit.org/show_bug.cgi?id=249561, we call FontCache::invalidate in response to memory pressure, in order to clear some cache data. But we can end up calling FontCache invalidation callbacks and FontSelector invalidation callbacks, both of which cause a full style rebuild. This is not necessary when the FontCache is being invalidated due to memory pressure. We thread through the ShouldRunInvalidationCallbacks value through to individual FontCache::invalidate calls so that we can skip informing the FontSelectors about the invalidation. The ShouldRunInvalidationCallbacks argument is made non-default, to avoid future misuse. * Source/WebCore/platform/ThreadGlobalData.cpp: (WebCore::ThreadGlobalData::destroy): * Source/WebCore/platform/graphics/FontCache.cpp: (WebCore::FontCache::invalidate): (WebCore::FontCache::invalidateAllFontCaches): * Source/WebCore/platform/graphics/FontCache.h: * Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::fontCacheRegisteredFontsChangedNotificationCallback): (WebCore::FontCache::platformReleaseNoncriticalMemory): * Source/WebCore/testing/InternalSettings.cpp: (WebCore::InternalSettings::setShouldMockBoldSystemFontForAccessibility): * Source/WebCore/testing/Internals.cpp: (WebCore::Internals::invalidateFontCache): * Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::contentSizeCategoryDidChange): * Source/WebKit/WebProcess/WebProcess.cpp: (WebKit::WebProcess::terminate): * Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::accessibilityPreferencesDidChange):
heycam
force-pushed
the
font-cache-invalidate-callback
branch
from
February 15, 2023 04:36
1b29d3a
to
639f82d
Compare
EWS run on current version of this PR (hash 639f82d) |
This is not having the memory impact I'd expect. Back to draft. |
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.
639f82d
639f82d