Changeset 286637 in webkit
- Timestamp:
- Dec 7, 2021, 6:11:05 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/ComplexTextController.cpp (modified) (1 diff)
-
platform/graphics/FontCascade.cpp (modified) (3 diffs)
-
platform/graphics/WidthIterator.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r286634 r286637 1 2021-12-07 Cameron McCormack <heycam@apple.com> 2 3 Remove expandAroundIdeographs static variables 4 https://bugs.webkit.org/show_bug.cgi?id=233750 5 6 Reviewed by Myles Maxfield. 7 8 With OffscreenCanvas, we can call into 9 ComplexTextController::adjustGlyphsAndAdvances, 10 FontCascade::expansionOpportunityCountInternal, and 11 WidthIterator::calculateAdditionalWidth from worker threads. 12 These all have a static variable variable with an initializer 13 that calls FontCascade::canExpandAroundIdeographsInComplexText, 14 and such initializers are not safe under -fno-threadsafe-statics. 15 16 canExpandAroundIdeographsInComplexText is a simple enough function in 17 all ports (it just returns a constant bool) that it's not worth caching 18 the result in a static. 19 20 * platform/graphics/ComplexTextController.cpp: 21 (WebCore::ComplexTextController::adjustGlyphsAndAdvances): 22 * platform/graphics/FontCascade.cpp: 23 (WebCore::FontCascade::expansionOpportunityCountInternal): 24 * platform/graphics/WidthIterator.cpp: 25 (WebCore::WidthIterator::calculateAdditionalWidth const): 26 1 27 2021-12-07 Cameron McCormack <heycam@apple.com> 2 28 -
trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp
r285009 r286637 753 753 forbidRightExpansion = m_run.ltr() ? isLastCharacter : isFirstCharacter; 754 754 // Handle justification and word-spacing. 755 static bool expandAroundIdeographs = FontCascade::canExpandAroundIdeographsInComplexText(); 756 bool ideograph = expandAroundIdeographs && FontCascade::isCJKIdeographOrSymbol(ch); 755 bool ideograph = FontCascade::canExpandAroundIdeographsInComplexText() && FontCascade::isCJKIdeographOrSymbol(ch); 757 756 if (treatAsSpace || ideograph || forceLeftExpansion || forceRightExpansion) { 758 757 // Distribute the run's total expansion evenly over all expansion opportunities in the run. -
trunk/Source/WebCore/platform/graphics/FontCascade.cpp
r286625 r286637 1002 1002 std::pair<unsigned, bool> FontCascade::expansionOpportunityCountInternal(const UChar* characters, unsigned length, TextDirection direction, ExpansionBehavior expansionBehavior) 1003 1003 { 1004 static bool expandAroundIdeographs = canExpandAroundIdeographsInComplexText();1005 1004 unsigned count = 0; 1006 1005 bool isAfterExpansion = (expansionBehavior & LeftExpansionMask) == ForbidLeftExpansion; … … 1021 1020 i++; 1022 1021 } 1023 if ( expandAroundIdeographs&& isCJKIdeographOrSymbol(character)) {1022 if (canExpandAroundIdeographsInComplexText() && isCJKIdeographOrSymbol(character)) { 1024 1023 if (!isAfterExpansion) 1025 1024 count++; … … 1042 1041 i--; 1043 1042 } 1044 if ( expandAroundIdeographs&& isCJKIdeographOrSymbol(character)) {1043 if (canExpandAroundIdeographsInComplexText() && isCJKIdeographOrSymbol(character)) { 1045 1044 if (!isAfterExpansion) 1046 1045 count++; -
trunk/Source/WebCore/platform/graphics/WidthIterator.cpp
r286139 r286637 391 391 bool forbidRightExpansion = isRightmostCharacter && (m_run.expansionBehavior() & RightExpansionMask) == ForbidRightExpansion; 392 392 393 static const bool expandAroundIdeographs = FontCascade::canExpandAroundIdeographsInComplexText(); 394 bool isIdeograph = expandAroundIdeographs && FontCascade::isCJKIdeographOrSymbol(character); 393 bool isIdeograph = FontCascade::canExpandAroundIdeographsInComplexText() && FontCascade::isCJKIdeographOrSymbol(character); 395 394 396 395 if (treatAsSpace || isIdeograph || forceLeftExpansion || forceRightExpansion) {
Note:
See TracChangeset
for help on using the changeset viewer.