Changeset 173476 in webkit
- Timestamp:
- Sep 10, 2014 11:58:05 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r173474 r173476 1 2014-09-10 Myles C. Maxfield <mmaxfield@apple.com> 2 3 Laying out a TextRun using an SVG font is O(n^2) 4 https://bugs.webkit.org/show_bug.cgi?id=136584 5 6 Reviewed by Darin Adler. 7 8 Addressing post-commit review from Darin. 9 10 No new tests. 11 12 * platform/graphics/Font.h: 13 (WebCore::Font::treatAsSpace): Un-inline. 14 (WebCore::Font::treatAsZeroWidthSpace): Ditto. 15 (WebCore::Font::treatAsZeroWidthSpaceInComplexScript): Ditto. 16 * svg/SVGFontData.cpp: 17 (WebCore::computeNormalizedSpaces): Avoid unnecessary copy. 18 1 19 2014-09-10 peavo@outlook.com <peavo@outlook.com> 2 20 -
trunk/Source/WebCore/platform/graphics/Font.h
r173349 r173476 269 269 270 270 FontSelector* fontSelector() const; 271 static inlinebool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == noBreakSpace; }272 static inlinebool treatAsZeroWidthSpace(UChar c) { return treatAsZeroWidthSpaceInComplexScript(c) || c == 0x200c || c == 0x200d; }273 static inlinebool treatAsZeroWidthSpaceInComplexScript(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || c == zeroWidthSpace || (c >= 0x200e && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == zeroWidthNoBreakSpace || c == objectReplacementCharacter; }271 static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == noBreakSpace; } 272 static bool treatAsZeroWidthSpace(UChar c) { return treatAsZeroWidthSpaceInComplexScript(c) || c == 0x200c || c == 0x200d; } 273 static bool treatAsZeroWidthSpaceInComplexScript(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || c == zeroWidthSpace || (c >= 0x200e && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == zeroWidthNoBreakSpace || c == objectReplacementCharacter; } 274 274 static bool canReceiveTextEmphasis(UChar32 c); 275 275 -
trunk/Source/WebCore/svg/SVGFontData.cpp
r173349 r173476 287 287 if (normalizedSpacesStringCache.length() == static_cast<unsigned>(run.charactersLength())) 288 288 return; 289 if (run.is8Bit()) { 290 normalizedSpacesStringCache = String(run.data8(0), run.charactersLength()); 291 normalizedSpacesStringCache = Font::normalizeSpaces(normalizedSpacesStringCache.characters8(), normalizedSpacesStringCache.length()); 292 } else { 293 normalizedSpacesStringCache = String(run.data16(0), run.charactersLength()); 294 normalizedSpacesStringCache = Font::normalizeSpaces(normalizedSpacesStringCache.characters16(), normalizedSpacesStringCache.length()); 295 } 289 if (run.is8Bit()) 290 normalizedSpacesStringCache = Font::normalizeSpaces(run.characters8(), run.charactersLength()); 291 else 292 normalizedSpacesStringCache = Font::normalizeSpaces(run.characters16(), run.charactersLength()); 296 293 if (mirror) 297 294 normalizedSpacesStringCache = createStringWithMirroredCharacters(normalizedSpacesStringCache);
Note: See TracChangeset
for help on using the changeset viewer.