Use BitSet for canUseSimplifiedTextMeasuring#26213
Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom Mar 21, 2024
Merged
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 90d16d9) Details |
90d16d9 to
8eff576
Compare
Collaborator
|
EWS run on current version of this PR (hash 8eff576) Details |
anttijk
approved these changes
Mar 21, 2024
https://bugs.webkit.org/show_bug.cgi?id=271347 rdar://125124560 Reviewed by Antti Koivisto. This patch adds canUseSimplifiedTextMeasuringForNormalVariantCache BitSet cache in FontCascade so that we do not need to query to GlyphData multiple times to obtain information about canUseSimplifiedTextMeasuring for Latin-1 characters. Since this is stored in FontCascade, we can continue using this cache even beyond multiple different RenderText. Furthermore, we apply using this function in TextUtil::width etc. We also move CharacterProperties.h to WTF, and adding Latin-1 fast path to make caching condition clear and querying function fast (isEmojiWithPresentationByDefault). * Source/WTF/WTF.xcodeproj/project.pbxproj: * Source/WTF/wtf/CMakeLists.txt: * Source/WTF/wtf/text/CharacterProperties.h: Renamed from Source/WebCore/platform/text/CharacterProperties.h. (WTF::isEmojiGroupCandidate): (WTF::isEmojiFitzpatrickModifier): (WTF::isVariationSelector): (WTF::isEmojiKeycapBase): (WTF::isEmojiRegionalIndicator): (WTF::isEmojiWithPresentationByDefault): (WTF::isEmojiModifierBase): (WTF::isDefaultIgnorableCodePoint): (WTF::isControlCharacter): (WTF::isPrivateUseAreaCharacter): * Source/WTF/wtf/text/StringCommon.h: (WTF::isLatin1): * Source/WebCore/Headers.cmake: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp: (WebCore::Layout::canUseSimplifiedTextMeasuringForCharacters): * Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::canUseSimplifiedTextMeasuringForCharacters): * Source/WebCore/platform/graphics/ComplexTextController.cpp: * Source/WebCore/platform/graphics/Font.cpp: * Source/WebCore/platform/graphics/FontCascade.cpp: (WebCore::FontCascade::canUseSimplifiedTextMeasuring const): * Source/WebCore/platform/graphics/FontCascade.h: * Source/WebCore/platform/graphics/FontRanges.cpp: * Source/WebCore/platform/graphics/GlyphPage.h: (WebCore::GlyphPage::create): Deleted. (WebCore::GlyphPage::~GlyphPage): Deleted. (WebCore::GlyphPage::count): Deleted. (WebCore::GlyphPage::sizeForPageNumber): Deleted. (WebCore::GlyphPage::indexForCodePoint): Deleted. (WebCore::GlyphPage::pageNumberForCodePoint): Deleted. (WebCore::GlyphPage::startingCodePointInPageNumber): Deleted. (WebCore::GlyphPage::pageNumberIsUsedForArabic): Deleted. (WebCore::GlyphPage::glyphDataForCharacter const): Deleted. (WebCore::GlyphPage::glyphForCharacter const): Deleted. (WebCore::GlyphPage::glyphDataForIndex const): Deleted. (WebCore::GlyphPage::glyphForIndex const): Deleted. (WebCore::GlyphPage::colorGlyphTypeForIndex const): Deleted. (WebCore::GlyphPage::setGlyphForIndex): Deleted. (WebCore::GlyphPage::font const): Deleted. (WebCore::GlyphPage::GlyphPage): Deleted. * Source/WebCore/platform/graphics/WidthIterator.cpp: * Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: * Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp: (WebCore::FontCascade::resolveEmojiPolicy): * Source/WebCore/platform/graphics/freetype/FontSetCache.cpp: * Source/WebCore/platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp: * Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp: * Source/WebCore/platform/graphics/skia/FontCascadeSkia.cpp: * Source/WebCore/rendering/RenderText.cpp: (WebCore::RenderText::initiateFontLoadingByAccessingGlyphDataAndComputeCanUseSimplifiedTextMeasuring): * Tools/TestWebKitAPI/CMakeLists.txt: * Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * Tools/TestWebKitAPI/Tests/WTF/CharacterProperties.cpp: Added. (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/276466@main
8eff576 to
e3afdb4
Compare
Collaborator
|
Committed 276466@main (e3afdb4): https://commits.webkit.org/276466@main Reviewed commits have been landed. Closing PR #26213 and removing active labels. |
This file contains hidden or 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
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.
e3afdb4
8eff576