Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1581)

Unified Diff: Source/platform/fonts/Font.cpp

Issue 567543002: Avoid re-parsing of string in fillText and measureText in Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating test expectation file Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/fonts/Font.h ('k') | Source/platform/fonts/WidthIterator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/Font.cpp
diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp
index 6cb92ab2b5087fc8661662665fade0c81b56d565..154fae7514dab94747a2b317267aca5b97e1e43e 100644
--- a/Source/platform/fonts/Font.cpp
+++ b/Source/platform/fonts/Font.cpp
@@ -427,7 +427,7 @@ static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForNonCJKCharacte
return std::make_pair(data, page);
}
-std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32 c, bool mirror, FontDataVariant variant) const
+std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32& c, bool mirror, bool normalizeSpace, FontDataVariant variant) const
{
ASSERT(isMainThread());
@@ -445,6 +445,9 @@ std::pair<GlyphData, GlyphPage*> Font::glyphDataAndPageForCharacter(UChar32 c, b
}
}
+ if (normalizeSpace && Character::isNormalizedCanvasSpaceCharacter(c))
+ c = space;
+
if (mirror)
c = mirroredChar(c);
@@ -602,7 +605,8 @@ bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphDa
character = U16_GET_SUPPLEMENTARY(character, low);
}
- glyphData = glyphDataForCharacter(character, false, EmphasisMarkVariant);
+ bool normalizeSpace = false;
+ glyphData = glyphDataForCharacter(character, false, normalizeSpace, EmphasisMarkVariant);
return true;
}
« no previous file with comments | « Source/platform/fonts/Font.h ('k') | Source/platform/fonts/WidthIterator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698